MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / idxToComb

Method idxToComb

app/src/main/java/solver/Utils.java:197–204  ·  view source on GitHub ↗
(int[] comb, int index, int k, int n)

Source from the content-addressed store, hash-verified

195 }
196
197 public static void idxToComb(int[] comb, int index, int k, int n) {
198 for (int i = n - 1; i >= 0; i--) {
199 if (index >= Cnk[i][k]) {
200 index -= Cnk[i][k--];
201 comb[i] = 1;
202 } else comb[i] = 0;
203 }
204 }
205
206 public static boolean permutationSign(int[] permutation) {
207 int nInversions = 0;

Callers 5

initMethod · 0.95
getEpmMethod · 0.95
setMethod · 0.95
random3CornerMethod · 0.95
random3EdgeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected