internal static bool isAnyComposition(int[][] permutations) { for (int i = 0; i < permutations.Length; i++) { for (int j = 0; j < permutations.Length; j++) { int[] composition = WithoutRepetition.CompositionOfPermutation(permutations[i], permutations[j]); bool flag = false; for (int k = 0; k < permutations.Length; k++) { if (!flag) { if (ArrayFunctions.compareIntArrays(composition, permutations[k])) { flag = true; } } } if (!flag) { return(false); } } } return(true); }
internal static bool isIdentity(int[] permutation) { int[] identity = createIdentityPermutation(permutation.Length); if (ArrayFunctions.compareIntArrays(identity, permutation)) { return(true); } return(false); }
internal static bool isAnyIdentity(int[][] permutations) { int[] e = createIdentityPermutation(permutations[0].Length); for (int i = 0; i < permutations.Length; i++) { if (ArrayFunctions.compareIntArrays(permutations[i], e)) { return(true); } } return(false); }
internal static bool isAnyReverse(int[][] permutations) { for (int i = 0; i < permutations.Length; i++) { bool flag = false; for (int j = 0; j < permutations.Length; j++) { if (!flag) { int[] reverse = WithoutRepetition.ReversePermutation(permutations[j]); if (ArrayFunctions.compareIntArrays(permutations[i], reverse)) { flag = true; } } } if (!flag) { return(false); } } return(true); }