public static Obj CreateSet(Obj[] objs, long count) { Miscellanea.Assert(objs.Length >= count); if (count != 0) { Obj[] norm_objs = Algs.SortUnique(objs, (int)count); return(new NeSetObj(norm_objs)); } else { return(EmptyRelObj.Singleton()); } }
public static Obj CreateBinRel(Obj[] col1, Obj[] col2, long count) { Miscellanea.Assert(count <= col1.Length & count <= col2.Length); if (count != 0) { Obj[] norm_col_1, norm_col_2; Algs.SortUnique(col1, col2, (int)count, out norm_col_1, out norm_col_2); return(new NeBinRelObj(norm_col_1, norm_col_2, !Algs.SortedArrayHasDuplicates(norm_col_1))); } else { return(EmptyRelObj.Singleton()); } }
public static Obj CreateTernRel(Obj[] col1, Obj[] col2, Obj[] col3, long count) { Miscellanea.Assert(count <= col1.Length && count <= col2.Length && count <= col3.Length); if (col1.Length != 0) { Obj[] norm_col_1, norm_col_2, norm_col_3; Algs.SortUnique(col1, col2, col3, (int)count, out norm_col_1, out norm_col_2, out norm_col_3); return(new NeTernRelObj(norm_col_1, norm_col_2, norm_col_3)); } else { return(EmptyRelObj.Singleton()); } }