(int depth)
| 517 | } |
| 518 | |
| 519 | public static int[][] easyCross(int depth) { |
| 520 | if (!inif) { |
| 521 | init(); |
| 522 | long t = System.currentTimeMillis(); |
| 523 | for (int i = 0; i < 23760; i++) ed[i] = -1; |
| 524 | setPruning(ed, 494 * 384, 0); |
| 525 | int c = 1; |
| 526 | for (int d = 0; d < 8; d++) { |
| 527 | // c=0; |
| 528 | for (int i = 0; i < 190080; i++) |
| 529 | if (getPruning(ed, i) == d) |
| 530 | for (int m = 0; m < 6; m++) { |
| 531 | int x = i; |
| 532 | for (int n = 0; n < 3; n++) { |
| 533 | int p = epm[x >> 4][m]; |
| 534 | int o = eom[x / 384 << 4 | (x & 15)][m]; |
| 535 | x = p << 4 | (o & 15); |
| 536 | if (getPruning(ed, x) == 0xf) { |
| 537 | setPruning(ed, x, d + 1); |
| 538 | c++; |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | Log.w("dct", d+1+"\t"+c); |
| 543 | } |
| 544 | t = System.currentTimeMillis() - t; |
| 545 | //Log.w("dct", t+"ms init"); |
| 546 | inif = true; |
| 547 | } |
| 548 | Random r = new Random(); |
| 549 | int i;// = r.nextInt(190080); |
| 550 | if (depth == 0) i = 494 * 384; |
| 551 | else do { |
| 552 | i = r.nextInt(190080); |
| 553 | } while (getPruning(ed, i) > depth); |
| 554 | int comb = i / 384; |
| 555 | int perm = (i >> 4) % 24; |
| 556 | int ori = i & 15; |
| 557 | int[] c = new int[12]; |
| 558 | int[] p = new int[4]; |
| 559 | Utils.idxToPerm(p, perm, 4, false); |
| 560 | idxToComb(c, p, comb, ori, new int[] {3, 2, 1, 0}); |
| 561 | int[][] arr = new int[2][12]; |
| 562 | for (i = 0; i < 12; i++) { |
| 563 | if (c[i] < 0) |
| 564 | arr[0][i] = arr[1][i] = -1; |
| 565 | else { |
| 566 | arr[0][i] = c[i] >> 1; |
| 567 | arr[1][i] = c[i] & 1; |
| 568 | } |
| 569 | } |
| 570 | return arr; |
| 571 | } |
| 572 | } |
no test coverage detected