Revision 9e7ff8d2
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java | ||
---|---|---|
36 | 36 |
private final int[] mNumCuts; |
37 | 37 |
|
38 | 38 |
private int[][] mQuatMult; |
39 |
private int[] mInvertedQuat; |
|
39 | 40 |
|
40 | 41 |
Tablebase mTablebase; |
41 | 42 |
boolean mInitialized; |
... | ... | |
225 | 226 |
return -2; |
226 | 227 |
} |
227 | 228 |
|
229 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
230 |
|
|
231 |
int getInvertedQuat(int index) |
|
232 |
{ |
|
233 |
if( mInvertedQuat==null ) |
|
234 |
{ |
|
235 |
mInvertedQuat = new int[mNumQuats]; |
|
236 |
|
|
237 |
for(int i=0; i<mNumQuats; i++) |
|
238 |
for(int j=0; j<mNumQuats; j++) |
|
239 |
{ |
|
240 |
int result = getMultQuat(i,j); |
|
241 |
|
|
242 |
if( result==0 ) |
|
243 |
{ |
|
244 |
mInvertedQuat[i] = j; |
|
245 |
break; |
|
246 |
} |
|
247 |
} |
|
248 |
} |
|
249 |
|
|
250 |
return mInvertedQuat[index]; |
|
251 |
} |
|
252 |
|
|
228 | 253 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
229 | 254 |
// assumption: all layers have the same basicAngles! |
230 | 255 |
|
... | ... | |
263 | 288 |
} |
264 | 289 |
|
265 | 290 |
int childIndex = getIndex(tmpQuats); |
266 |
if( mTablebase.insertUnpacked(childIndex,newLevel) ) ret++; |
|
291 |
|
|
292 |
if( mTablebase.insertUnpacked(childIndex,newLevel) ) |
|
293 |
{ |
|
294 |
|
|
295 |
//android.util.Log.e("D", newLevel+" inserting "+childIndex+" ax="+ax+" layer="+layer+" angle="+angle+" SUCC "+index); |
|
296 |
|
|
297 |
ret++; |
|
298 |
} |
|
299 |
else |
|
300 |
{ |
|
301 |
|
|
302 |
//android.util.Log.d("D", newLevel+" inserting "+childIndex+" ax="+ax+" layer="+layer+" angle="+angle+" FAIL "+index); |
|
303 |
|
|
304 |
} |
|
267 | 305 |
} |
268 | 306 |
} |
269 | 307 |
|
Also available in: Unified diff
Dino6 solver: tablebase computed. It doesn't quite work yet though.