Project

General

Profile

« Previous | Next » 

Revision efc71331

Added by Leszek Koltunski about 1 year ago

minor speedup

View differences:

src/main/java/org/distorted/objectlib/tablebases/TBCuboid323.java
55 55

  
56 56
  private int[][] mAngles;
57 57
  private boolean mUpsideDown;
58
  private int[] mCornerPerm, mEdgePerm;
58 59

  
59 60
///////////////////////////////////////////////////////////////////////////////////////////////////
60 61
// remove perm[1] which is always equal to 1.
......
98 99
  public TBCuboid323()
99 100
    {
100 101
    super();
102

  
103
    allocate();
101 104
    }
102 105

  
103 106
///////////////////////////////////////////////////////////////////////////////////////////////////
......
106 109
    {
107 110
    super(os,new int[] {R.raw.cu_323_pruning7 ,R.raw.cu_323_pruning8 },
108 111
             new int[] {R.raw.cu_323_pruning17,R.raw.cu_323_pruning18} );
112

  
113
    allocate();
114
    }
115

  
116
///////////////////////////////////////////////////////////////////////////////////////////////////
117

  
118
  private void allocate()
119
    {
120
    mCornerPerm = new int[8];
121
    mEdgePerm = new int[7];
109 122
    }
110 123

  
111 124
///////////////////////////////////////////////////////////////////////////////////////////////////
......
376 389
    {
377 390
    int centers = centersInverted(quats);
378 391

  
379
    int[] corner_perm = new int[8];
380
    cornerFromQuats(corner_perm,quats);
381
    int corner_perm_num = TablebaseHelpers.computePermutationNum(corner_perm);
392
    cornerFromQuats(mCornerPerm,quats);
393
    int corner_perm_num = TablebaseHelpers.computePermutationNum(mCornerPerm);
382 394

  
383
    int[] edge_perm7  = new int[7];
384
    edgeFromQuats(edge_perm7,quats);
385
    int edge_perm_num = TablebaseHelpers.computePermutationNum(edge_perm7);
395
    edgeFromQuats(mEdgePerm,quats);
396
    int edge_perm_num = TablebaseHelpers.computePermutationNum(mEdgePerm);
386 397

  
387 398
    return corner_perm_num + 40320*( centers + 2*edge_perm_num);
388 399
    }

Also available in: Unified diff