This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -7,6 +7,10 @@ namespace BITKit
{
public static class MathE
{
public static bool IndexInRange<T>(this IEnumerable<T> self, int index)
{
return index >= 0 && index < self.Count();
}
public static bool Equals<T>(params T[] objs)
{
var a = objs.FirstOrDefault();
@@ -25,7 +29,6 @@ namespace BITKit
return true;
}
public static IEnumerable<T> Subtract<T>(IEnumerable<T> a, IEnumerable<T> b) where T : IEnumerable
{
List<T> list = new();
@@ -61,7 +64,8 @@ namespace BITKit
{
foreach (var x in b)
{
if (a.Contains(x))
var enumerable = a as T[] ?? a.ToArray();
if (enumerable.Contains(x))
{
}
@@ -73,6 +77,7 @@ namespace BITKit
return true;
}
public static IEnumerable<T[]> Combinations<T>(IEnumerable<T> source)
{