HOG2
Macros | Functions
RubiksCubeCorners.cpp File Reference
#include "RubiksCubeCorners.h"
#include "GLUtil.h"
#include <assert.h>
Include dependency graph for RubiksCubeCorners.cpp:

Go to the source code of this file.

Macros

#define LINEAR_RANK   1
 
#define POLYNOMIAL_RANK   0
 
#define MR
 

Functions

int get (uint64_t state, int whichLoc)
 Implementation details: More...
 
void set (uint64_t &state, int whichLoc, int cube)
 
void swap (uint64_t &state, int loc1, int loc2)
 

Macro Definition Documentation

◆ LINEAR_RANK

#define LINEAR_RANK   1

Definition at line 13 of file RubiksCubeCorners.cpp.

◆ MR

#define MR

Definition at line 1216 of file RubiksCubeCorners.cpp.

◆ POLYNOMIAL_RANK

#define POLYNOMIAL_RANK   0

Definition at line 14 of file RubiksCubeCorners.cpp.

Function Documentation

◆ get()

int get ( uint64_t  state,
int  whichLoc 
)
inline

Implementation details:

This just implements the 8 Corners. The RubiksCornerState has 24*4 = 48 bits for where each face is located

Faces are numbered 0...5 as follows.

+----—+ |\ \ | \ 0 \ | _______\ | 1| | \ | 2 | \ | | |_______|

+----—+ | |\ | 4 | \ | | \ |_______|3 | \ \ | \ 5 \ | _______|

Corners are numbered as follows:

4----—3 |\ \ | \ \ | \1_____2\ 8 | | \ | | \ | | \5_______6

4----—3 | |\ | | \ | | 2 8_______7 | \ \ | \ \ | \5______6|

Cubies (drawing purposes only) are labeled as follows

+----—+ |\6 7 8\ | \3 4 5\ | _______\ | |0 1 2| \ | | \ | | |_______|

Note that 9, 11, 13, 15

+----—+ |\1516 17\ | \1213 14\ | _______\ \ |9 10 11| \ | | |_______|

+----—+ |\2425 26\ | \2122 23\ | _______\ \ |18 1920| |_______|

The moves for each face are labeled with comments. There are three legal moves which rotate +90, -90 and +/-180.

The rotation starts with the top/bottm face and goes counter-clockwise

Definition at line 105 of file RubiksCubeCorners.cpp.

Referenced by RubiksCorner::GetStateFromHash(), and RubiksCorner::MRRank().

◆ set()

void set ( uint64_t &  state,
int  whichLoc,
int  cube 
)
inline

◆ swap()

void swap ( uint64_t &  state,
int  loc1,
int  loc2 
)
inline

Definition at line 119 of file RubiksCubeCorners.cpp.

Referenced by RubiksCorner::MRRank(), and RubiksCorner::MRUnrank2().