public static bool FindDuplicates <T>(this Multiarray <T> list) { for (int i = 0; i < list.Array.Length; i++) { for (int j = 0; j < i; j++) { if (list[i].Equals(list[j])) { return(true); } } } return(false); }
public static bool FindDuplicates <T>(this Multiarray <T> list, out List <Twoint> twoint) { List <Twoint> ti = new List <Twoint>(); bool dup = false; for (int i = 0; i < list.Array.Length; i++) { for (int j = 0; j < i; j++) { if (list[i].Equals(list[j])) { ti.Add(new Twoint(i, j)); dup = true; } } } twoint = ti; return(dup); }
public static List <T> To1DList <T>(this Multiarray <T> arr) { List <T> list = arr.Array.Cast <T>().ToList(); return(list); }