Go to the documentation of this file.
9 #ifndef __hog2_glut__RubiksCorner__
10 #define __hog2_glut__RubiksCorner__
29 void Rotate(uint64_t a, uint64_t b, uint64_t c, uint64_t
d);
30 void Swap(uint64_t a, uint64_t b, uint64_t c, uint64_t
d);
48 void Rotate(uint64_t a, uint64_t b, uint64_t c, uint64_t
d);
49 void Swap(uint64_t a, uint64_t b, uint64_t c, uint64_t
d);
74 for (
int x = 0; x < 16; x++)
75 result ^= (s.
state[x])<<(x*4);
90 for (
int x = 0; x < 16; x++)
98 for (
int x = 0; x < 8; x++)
119 for (
int x = 0; x < 18; x++)
189 static uint64_t
MRRank(
int n, uint64_t perm, uint64_t dual);
190 static void MRUnrank2(
int n, uint64_t r, uint64_t &perm);
206 virtual bool Load(
const char *prefix);
207 virtual void Save(
const char *prefix);
208 virtual bool Load(FILE *f);
209 virtual void Save(FILE *f);
210 virtual std::string
GetFileName(
const char *prefix);
225 #define Rubik RubiksCorner
226 #define RubikState RubiksCornerState
227 #define RubikMove RubikCornerMove
uint64_t GetPDBHash(const RubiksCornerState &s, int threadID=0) const
RubikCornerMove moves[18]
virtual uint64_t GetAbstractHash(const RubiksCornerState &s, int threadID=0) const
static bool operator==(const RubiksCornerStateBits &l1, const RubiksCornerStateBits &l2)
uint64_t GetCubeOrientation(unsigned int whichLoc) const
static void MRUnrank2(int n, uint64_t r, uint64_t &perm)
void OpenGLDrawCube(const RubiksCornerState &s, int cube) const
void GetStateFromPDBHash(uint64_t hash, RubiksCornerState &s, int threadID=0) const
uint64_t Factorial(int val) const
int GetFaceInLoc(unsigned int whichLoc) const
void Rotate(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
virtual bool InvertAction(RubiksCornersAction &a) const
RubiksCornerState GetStateFromAbstractState(RubiksCornerState &s) const
void rankPlayerRemaining(const RubiksCornerState &s, int who, int64_t &rank)
uint64_t GetCubeOrientation(unsigned int whichLoc) const
virtual double GCost(const RubiksCornerState &node, const RubiksCornersAction &act) const
virtual std::string GetFileName(const char *prefix)
void UndoMove(RubiksCornerState &s, RubikCornerMove *a)
size_t operator()(const RubiksCornerStateBits &s) const
void rankPlayer(RubiksCornerState &s, int who, int64_t &index1, int64_t &index2)
uint64_t GetStateHash(const RubiksCornerState &node) const
void SetCubeOrientation(unsigned int whichLoc, int orient)
virtual double HCost(const RubiksCornerState &node) const
Heuristic value between node and the stored goal.
virtual double HCost(const RubiksCornerState &node1, const RubiksCornerState &node2) const
Heuristic value between two arbitrary nodes.
void Rotate(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
void SetCubeInLoc(unsigned int whichLoc, int cube)
virtual void GetSuccessors(const RubiksCornerState &nodeID, std::vector< RubiksCornerState > &neighbors) const
void Swap(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
void SetCubeInLoc(unsigned int whichLoc, int cube)
static uint64_t GetStateSpaceSize()
virtual bool Load(const char *prefix)
virtual void ApplyAction(RubiksCornerState &s, RubiksCornersAction a) const
virtual void Save(const char *prefix)
static std::ostream & operator<<(std::ostream &out, const RubiksCornerState &s)
int GetFaceInLoc(unsigned int whichLoc) const
void Swap(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
virtual uint64_t GetActionHash(RubiksCornersAction act) const
uint64_t GetPDBSize() const
virtual void OpenGLDraw() const
int GetCubeInLoc(unsigned int whichLoc) const
static uint64_t GetStateHash(const RubiksCornerState &s)
int64_t rankPlayer(RubiksCornerState &s, int who)
void SetFaceColor(int face, const RubiksCornerState &) const
void rankPlayerFirstTwo(const RubiksCornerState &s, int who, int64_t &rank)
void SetCubeOrientation(unsigned int whichLoc, int orient)
int64_t getMaxSinglePlayerRank2()
static void GetStateFromHash(RubiksCornerState &s, uint64_t hash)
size_t operator()(const RubiksCornerStateArray &s) const
std::vector< int > corners
virtual void GetActions(const RubiksCornerState &nodeID, std::vector< RubiksCornersAction > &actions) const
static uint64_t MRRank(int n, uint64_t perm, uint64_t dual)
int GetCubeInLoc(unsigned int whichLoc) const
void ApplyMove(RubiksCornerState &s, RubikCornerMove *a)
void GetStateFromHash(uint64_t hash, RubiksCornerState &node) const
virtual RubiksCornersAction GetAction(const RubiksCornerState &s1, const RubiksCornerState &s2) const
virtual bool GoalTest(const RubiksCornerState &node, const RubiksCornerState &goal) const
int64_t getMaxSinglePlayerRank()
virtual void GetNextState(const RubiksCornerState &, RubiksCornersAction, RubiksCornerState &) const
RubiksCornerStateArray RubiksCornerState
RubikCornerPDB(RubiksCorner *e, const RubiksCornerState &s, std::vector< int > &distinctCorners)
uint64_t FactorialUpperK(int n, int k) const
virtual double GCost(const RubiksCornerState &node1, const RubiksCornerState &node2) const
Nodes to be stored within a Graph.
void unrankPlayer(uint64_t d, RubiksCornerState &s, int who)
RubikCornerMove * getMoves(RubiksCornerState &)
void freeMove(RubikCornerMove *m)