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

Method combToIdx

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

Source from the content-addressed store, hash-verified

185
186 // combinations
187 public static int combToIdx(int[] comb, int k, int n) {
188 int idx = 0;
189 for (int i = n - 1; i >= 0; i--) {
190 if (comb[i] != 0) {
191 idx += Cnk[i][k--];
192 }
193 }
194 return idx;
195 }
196
197 public static void idxToComb(int[] comb, int index, int k, int n) {
198 for (int i = n - 1; i >= 0; i--) {

Callers 3

initMethod · 0.95
getEpmMethod · 0.95
getMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected