Revision 5f8356d7
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/tablebases/TBCuboid323.java | ||
---|---|---|
40 | 40 |
{6,7,4,2,5,3,1,0} |
41 | 41 |
}; |
42 | 42 |
|
43 |
private static final int[][] CORNER_MAP_INVERTED = new int[8][8]; |
|
44 |
private static final int[][] EDGE_MAP_INVERTED = new int[8][8]; |
|
45 |
|
|
46 |
static |
|
47 |
{ |
|
48 |
for(int i=0; i<8; i++) |
|
49 |
for(int j=0; j<8; j++) |
|
50 |
{ |
|
51 |
CORNER_MAP_INVERTED[i][j] = findIndex(CORNER_MAP[i],j); |
|
52 |
EDGE_MAP_INVERTED[i][j] = findIndex(EDGE_MAP[i],j); |
|
53 |
} |
|
54 |
}; |
|
55 |
|
|
43 | 56 |
private int[][] mAngles; |
44 | 57 |
private boolean mUpsideDown; |
45 | 58 |
|
... | ... | |
323 | 336 |
|
324 | 337 |
public static void cornerFromQuats(int[] corner_perm, int[] quats) |
325 | 338 |
{ |
326 |
for(int i=0; i<8; i++) corner_perm[i] = findIndex( CORNER_MAP[i], quats[i]);
|
|
339 |
for(int i=0; i<8; i++) corner_perm[i] = CORNER_MAP_INVERTED[i][quats[i]];
|
|
327 | 340 |
} |
328 | 341 |
|
329 | 342 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
330 | 343 |
|
331 | 344 |
public static void edgeFromQuats(int[] edge_perm, int[] quats) |
332 | 345 |
{ |
333 |
for(int i=0; i<8; i++) edge_perm[i] = findIndex( EDGE_MAP[i], quats[i+8]);
|
|
346 |
for(int i=0; i<8; i++) edge_perm[i] = EDGE_MAP_INVERTED[i][quats[i+8]];
|
|
334 | 347 |
} |
335 | 348 |
|
336 | 349 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
347 | 360 |
int[] edge_perm7 = new int[7]; |
348 | 361 |
TablebaseHelpers.getPermutationFromNum(edge_perm7,7,edgePermNum); |
349 | 362 |
int[] edge_perm8 = edgePermTo8(edge_perm7); |
350 |
/* |
|
351 |
TablebaseHelpers.displayTable(corner_perm, "CORNER"); |
|
352 |
TablebaseHelpers.displayTable(edge_perm8, "EDGE8"); |
|
353 |
TablebaseHelpers.displayTable(edge_perm7, "EDGE7"); |
|
354 |
android.util.Log.e("D", "inPlace="+inPlace); |
|
355 |
*/ |
|
356 | 363 |
|
357 | 364 |
return quatsFromPermutations(corner_perm,edge_perm8,centers); |
358 | 365 |
} |
Also available in: Unified diff
CU_323 solver: speedups