Revision bf890718
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java | ||
---|---|---|
256 | 256 |
int currQuat = tmpQuats[cubit]; |
257 | 257 |
int newQuat = getMultQuat(quat,currQuat); |
258 | 258 |
tmpQuats[cubit] = newQuat; |
259 |
|
|
260 |
if( index==0 && ax==2 && layer==1 && angle==2 ) |
|
261 |
{ |
|
262 |
android.util.Log.e("D","cubit "+cubit+" belongs, oldQ="+currQuat+" quat="+quat+" new: "+newQuat); |
|
263 |
} |
|
259 | 264 |
} |
260 | 265 |
|
266 |
if( tmpQuats[4]==0 && tmpQuats[5]==1 && tmpQuats[6]==4 && tmpQuats[7]==3 && tmpQuats[8]==10 && tmpQuats[9]==9 ) |
|
267 |
{ |
|
268 |
android.util.Log.e("D","index="+index+" level="+level+" ax="+ax+" layer="+layer+" angle="+angle); |
|
269 |
android.util.Log.e("D", quats[4]+" "+quats[5]+" "+quats[6]+" "+quats[7]+" "+quats[8]+" "+quats[9]); |
|
270 |
} |
|
271 |
|
|
261 | 272 |
int childIndex = getIndex(tmpQuats); |
262 | 273 |
if( mTablebase.insertUnpacked(childIndex,newLevel) ) ret++; |
263 | 274 |
} |
src/main/java/org/distorted/objectlib/tablebases/TablebasesPyraminx.java | ||
---|---|---|
72 | 72 |
{ 0.5f, SQ2/4, 0.0f}, |
73 | 73 |
|
74 | 74 |
{ 0.0f,-SQ2/2, 0.0f}, |
75 |
{ 0.0f,-SQ2/2, 0.0f}, |
|
76 |
{ 0.0f,-SQ2/2, 0.0f}, |
|
77 |
{ 0.0f,-SQ2/2, 0.0f}, |
|
78 |
{ 0.0f,-SQ2/2, 0.0f}, |
|
79 |
{ 0.0f,-SQ2/2, 0.0f}, |
|
80 |
|
|
81 |
/* |
|
75 | 82 |
{ 0.5f, 0.0f,-0.5f}, |
76 | 83 |
{ 0.5f, 0.0f, 0.5f}, |
77 | 84 |
{-0.5f, 0.0f,-0.5f}, |
78 | 85 |
{-0.5f, 0.0f, 0.5f}, |
79 | 86 |
{ 0.0f, SQ2/2, 0.0f}, |
87 |
*/ |
|
80 | 88 |
}; |
81 | 89 |
} |
82 | 90 |
|
... | ... | |
147 | 155 |
int p = perm[i]; |
148 | 156 |
int t = twist%2; |
149 | 157 |
twist/=2; |
150 |
output[i] = EDGE_QUATS[p][t]; |
|
158 |
output[i+4] = EDGE_QUATS[p][t];
|
|
151 | 159 |
} |
152 | 160 |
} |
153 | 161 |
|
... | ... | |
240 | 248 |
int edgeTwist = twist[0]+ 2*(twist[1]+ 2*(twist[2]+ 2*(twist[3]+ 2*twist[4]))); |
241 | 249 |
int perm_num = TablebaseHelpers.computeEvenPermutationNum(permutation); |
242 | 250 |
|
251 |
int ret = vertexTwist + 81*(edgeTwist + 32*perm_num); |
|
252 |
|
|
253 |
if( ret<0 || ret>=933120 ) |
|
254 |
{ |
|
255 |
android.util.Log.e("D", "vertexTwist="+vertexTwist+" edgeTwist="+edgeTwist+" perm_num="+perm_num); |
|
256 |
android.util.Log.e("D", "perm: "+permutation[0]+" "+permutation[1]+" "+permutation[2]+" "+permutation[3]+" "+permutation[4]+" "+permutation[5]); |
|
257 |
android.util.Log.e("D", "quat: "+quats[4]+" "+quats[5]+" "+quats[6]+" "+quats[7]+" "+quats[8]+" "+quats[9]); |
|
258 |
} |
|
259 |
|
|
243 | 260 |
return vertexTwist + 81*(edgeTwist + 32*perm_num); |
244 | 261 |
} |
245 | 262 |
} |
Also available in: Unified diff
Pyraminx solver: progress