Class Flipper

java.lang.Object
  extended by Flipper

public final class Flipper
extends Object


Method Summary
 int diagsInDest(PEdge[] diags, PEdge[] dest)
          Return bit map of which diagonals to dest array.
 int flipsInDest(PEdge[] diags, PEdge[] dest)
          Return bit map of which diagonals in the current flip array belong to dest array
 int[][] getCodes(PEdge[] diags)
           
 int[] getCoFlips(PEdge[] diags)
           
 int[] getFaces(PEdge[] diags)
          return copy of faces array.
 PEdge[] getFlipResult(PEdge[] diags, int index)
           
 PEdge[] getFlips(PEdge[] diags)
          Return a copy of the flip array just created by the call setFlips(diags).
 long hash(PEdge[] diags)
           
 void printCoFlips()
           
 void setCoFlips(PEdge[] diags)
          Compute coflip array.
 void setFaces(PEdge[] diags)
           
 void setFlipResult(PEdge[] diags, int index)
           
 void setFlips(PEdge[] diags)
           
 PEdge[] unhash(long code)
           
 int updatedSpin(PEdge[] diags, int index, int spin)
          return spin vector obtained by flipping edge with given index in the given diagonal set, assuming that the diagonal set has the given spin.
 PEdge[] xRotate(PEdge[] diags, int r, boolean rev)
          "Temporary" rotation routine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFlips

public PEdge[] getFlips(PEdge[] diags)
Return a copy of the flip array just created by the call setFlips(diags). Only for debugging purposes.


setFlips

public void setFlips(PEdge[] diags)

getFlipResult

public PEdge[] getFlipResult(PEdge[] diags,
                             int index)

setFlipResult

public void setFlipResult(PEdge[] diags,
                          int index)

updatedSpin

public int updatedSpin(PEdge[] diags,
                       int index,
                       int spin)
return spin vector obtained by flipping edge with given index in the given diagonal set, assuming that the diagonal set has the given spin. This call must be made immediately after flips has been called to generated the new diagonal set. An exception is thrown if this is not the case.


setFaces

public void setFaces(PEdge[] diags)

getFaces

public int[] getFaces(PEdge[] diags)
return copy of faces array. Only for debugging and testing purposes.


getCodes

public int[][] getCodes(PEdge[] diags)

getCoFlips

public int[] getCoFlips(PEdge[] diags)

setCoFlips

public void setCoFlips(PEdge[] diags)
Compute coflip array. coFlip[i] is an integer bit mask. Bit j of coFlips[i] is 1 iff diag[j] is a coflip of diag[i].


printCoFlips

public void printCoFlips()

hash

public long hash(PEdge[] diags)

unhash

public PEdge[] unhash(long code)

flipsInDest

public int flipsInDest(PEdge[] diags,
                       PEdge[] dest)
Return bit map of which diagonals in the current flip array belong to dest array


diagsInDest

public int diagsInDest(PEdge[] diags,
                       PEdge[] dest)
Return bit map of which diagonals to dest array. Both arrays are assumed sorted.


xRotate

public PEdge[] xRotate(PEdge[] diags,
                       int r,
                       boolean rev)
"Temporary" rotation routine. Should be replace by one that does a linear sort. If rev is false, rotation is clockwisre r positions. (a->a+r) If rev is true, roration is clockwisre r positions, followed by a reversal x-> n-1-x. So net effect is a-> n-1-r-a.