HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RCPDB Class Reference

#include <RC.h>

Inheritance diagram for RCPDB:
Inheritance graph
[legend]
Collaboration diagram for RCPDB:
Collaboration graph
[legend]

Public Member Functions

 RCPDB (RC *e, const std::array< bool, 12 > &edgeRotations, const std::array< bool, 12 > &edgeLocations, const std::array< bool, 8 > &cornerRotations, const std::array< bool, 8 > &cornerLocations)
 
uint64_t GetStateHash (const RCState &s) const
 
void GetStateFromHash (RCState &s, uint64_t hash) const
 
uint64_t GetPDBSize () const
 
uint64_t GetPDBHash (const RCState &s, int threadID=0) const
 
uint64_t GetAbstractHash (const RCState &s, int threadID=0) const
 
void GetStateFromPDBHash (uint64_t hash, RCState &s, int threadID=0) const
 
RCState GetStateFromAbstractState (RCState &s) const
 
void OpenGLDraw () const
 
bool Load (const char *prefix)
 
void Save (const char *prefix)
 
bool Load (FILE *f)
 
void Save (FILE *f)
 
std::string GetFileName (const char *prefix)
 
- Public Member Functions inherited from PDBHeuristic< RCState, RCAction, RC, RCState, 4 >
 PDBHeuristic (RC *e)
 
virtual ~PDBHeuristic ()
 
void SetGoal (const RCState &goal)
 
void SetGoal (const std::vector< RCState > &goals)
 
virtual double HCost (const RCState &a, const RCState &b) const
 
virtual uint64_t GetPDBSize () const=0
 
void ShuffleValues ()
 This methods randomizes the entries in the PDB. More...
 
void BuildPDB (const RCState &goal)
 
void BuildPDB (const RCState &goal, int numThreads)
 
void BuildPDBForward (const RCState &goal, int numThreads, bool useCoarseOpen=true, bool verbose=false)
 
void BuildPDBForward (const std::vector< RCState > &goal, int numThreads, bool useCoarseOpen=true, bool verbose=false)
 
void BuildPDBBackward (const RCState &goal, int numThreads)
 
void BuildPDBForwardBackward (const RCState &goal, int numThreads)
 
void BuildAdditivePDB (const RCState &goal, int numThreads, bool useCourseOpen=true)
 
void DivCompress (int factor, bool print_histogram)
 
void ModCompress (int factor, bool print_histogram)
 
void ModCompress (uint64_t newEntries, bool print_histogram)
 
void ZeroLowValues (int limit)
 
void DeltaCompress (Heuristic< RCState > *h, RCState goal, bool print_histogram)
 
void FractionalDivCompress (uint64_t count, bool print_histogram)
 
void FractionalModCompress (uint64_t factor, bool print_histogram)
 
void ValueCompress (int maxValue, bool print_histogram)
 
void ValueCompress (std::vector< int > cutoffs, bool print_histogram)
 
void ValueRangeCompress (int numBits, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RCState, RCAction, RC, RCState, 5 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RCState, RCAction, RC, RCState, 4 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RCState, RCAction, RC, RCState, 3 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RCState, RCAction, RC, RCState, 2 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RCState, RCAction, RC, RCState, 1 > *, bool print_histogram)
 
void CustomValueRangeCompress (std::vector< uint64_t > dist, int numBits, bool print_histogram)
 
double PrintHistogram ()
 
double GetAverageValue ()
 
void GetHistogram (std::vector< uint64_t > &histogram)
 
- Public Member Functions inherited from Heuristic< RCState >
 Heuristic ()
 
virtual ~Heuristic ()
 

Private Member Functions

uint64_t FactorialUpperK (int n, int k) const
 
uint64_t GetEdgeRotationSize () const
 
uint64_t GetEdgeLocationSize () const
 
uint64_t GetCornerRotationSize () const
 
uint64_t GetCornerLocationSize () const
 
uint64_t GetEdgeRotationHash (const RCState &s) const
 
uint64_t GetEdgeLocationHash (const RCState &s) const
 
uint64_t GetCornerRotationHash (const RCState &s) const
 
uint64_t GetCornerLocationHash (const RCState &s) const
 
void GetStateFromEdgeRotationHash (RCState &s, uint64_t hash) const
 
void GetStateFromEdgeLocationHash (RCState &s, uint64_t hash) const
 
void GetStateFromCornerRotationHash (RCState &s, uint64_t hash) const
 
void GetStateFromCornerLocationHash (RCState &s, uint64_t hash) const
 

Private Attributes

std::vector< int > edgeRotations
 
std::vector< int > edgeLocations
 
std::vector< int > cornerRotations
 
std::vector< int > cornerLocations
 

Additional Inherited Members

- Public Attributes inherited from PDBHeuristic< RCState, RCAction, RC, RCState, 4 >
NBitArray< pdbBits > PDB
 
int vrcValues [1<< pdbBits]
 
PDBLookupType type
 
uint64_t compressionValue
 
RCenv
 
std::vector< RCStategoalState
 
- Public Attributes inherited from Heuristic< RCState >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 

Detailed Description

Definition at line 449 of file RC.h.

Constructor & Destructor Documentation

◆ RCPDB()

RCPDB::RCPDB ( RC e,
const std::array< bool, 12 > &  edgeRotations,
const std::array< bool, 12 > &  edgeLocations,
const std::array< bool, 8 > &  cornerRotations,
const std::array< bool, 8 > &  cornerLocations 
)

Definition at line 1760 of file RC.cpp.

References cornerLocations, cornerRotations, edgeLocations, and edgeRotations.

Member Function Documentation

◆ FactorialUpperK()

uint64_t RCPDB::FactorialUpperK ( int  n,
int  k 
) const
private

◆ GetAbstractHash()

uint64_t RCPDB::GetAbstractHash ( const RCState s,
int  threadID = 0 
) const
inlinevirtual

Implements PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 458 of file RC.h.

References GetPDBHash().

◆ GetCornerLocationHash()

uint64_t RCPDB::GetCornerLocationHash ( const RCState s) const
private

Definition at line 1942 of file RC.cpp.

References cornerLocations, FactorialUpperK(), and RCState::indices.

Referenced by GetPDBHash().

◆ GetCornerLocationSize()

uint64_t RCPDB::GetCornerLocationSize ( ) const
private

Definition at line 1883 of file RC.cpp.

References cornerLocations, and FactorialUpperK().

Referenced by GetPDBHash(), GetPDBSize(), and GetStateFromPDBHash().

◆ GetCornerRotationHash()

uint64_t RCPDB::GetCornerRotationHash ( const RCState s) const
private

Definition at line 1930 of file RC.cpp.

References cornerRotations, min(), and RCState::rotation.

Referenced by GetPDBHash().

◆ GetCornerRotationSize()

uint64_t RCPDB::GetCornerRotationSize ( ) const
private

Definition at line 1876 of file RC.cpp.

References cornerRotations, and min().

Referenced by GetPDBHash(), GetPDBSize(), and GetStateFromPDBHash().

◆ GetEdgeLocationHash()

uint64_t RCPDB::GetEdgeLocationHash ( const RCState s) const
private

Definition at line 1900 of file RC.cpp.

References edgeLocations, FactorialUpperK(), and RCState::indices.

Referenced by GetPDBHash().

◆ GetEdgeLocationSize()

uint64_t RCPDB::GetEdgeLocationSize ( ) const
private

Definition at line 1871 of file RC.cpp.

References edgeLocations, and FactorialUpperK().

Referenced by GetPDBSize().

◆ GetEdgeRotationHash()

uint64_t RCPDB::GetEdgeRotationHash ( const RCState s) const
private

Definition at line 1888 of file RC.cpp.

References edgeRotations, min(), and RCState::rotation.

Referenced by GetPDBHash().

◆ GetEdgeRotationSize()

uint64_t RCPDB::GetEdgeRotationSize ( ) const
private

Definition at line 1865 of file RC.cpp.

References edgeRotations, and min().

Referenced by GetPDBHash(), GetPDBSize(), and GetStateFromPDBHash().

◆ GetFileName()

std::string RCPDB::GetFileName ( const char *  prefix)
inlinevirtual

Implements PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 470 of file RC.h.

◆ GetPDBHash()

uint64_t RCPDB::GetPDBHash ( const RCState s,
int  threadID = 0 
) const
virtual

◆ GetPDBSize()

uint64_t RCPDB::GetPDBSize ( ) const

◆ GetStateFromAbstractState()

RCState RCPDB::GetStateFromAbstractState ( RCState s) const
inlinevirtual

Implements PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 460 of file RC.h.

◆ GetStateFromCornerLocationHash()

void RCPDB::GetStateFromCornerLocationHash ( RCState s,
uint64_t  hash 
) const
private

Definition at line 2058 of file RC.cpp.

References cornerLocations, FactorialUpperK(), and RCState::indices.

Referenced by GetStateFromPDBHash().

◆ GetStateFromCornerRotationHash()

void RCPDB::GetStateFromCornerRotationHash ( RCState s,
uint64_t  hash 
) const
private

Definition at line 2035 of file RC.cpp.

References cornerRotations, min(), and RCState::rotation.

Referenced by GetStateFromPDBHash().

◆ GetStateFromEdgeLocationHash()

void RCPDB::GetStateFromEdgeLocationHash ( RCState s,
uint64_t  hash 
) const
private

Definition at line 1998 of file RC.cpp.

References edgeLocations, FactorialUpperK(), and RCState::indices.

Referenced by GetStateFromPDBHash().

◆ GetStateFromEdgeRotationHash()

void RCPDB::GetStateFromEdgeRotationHash ( RCState s,
uint64_t  hash 
) const
private

Definition at line 1973 of file RC.cpp.

References edgeRotations, min(), and RCState::rotation.

Referenced by GetStateFromPDBHash().

◆ GetStateFromHash()

void RCPDB::GetStateFromHash ( RCState s,
uint64_t  hash 
) const

Definition at line 1786 of file RC.cpp.

◆ GetStateFromPDBHash()

void RCPDB::GetStateFromPDBHash ( uint64_t  hash,
RCState s,
int  threadID = 0 
) const
virtual

◆ GetStateHash()

uint64_t RCPDB::GetStateHash ( const RCState s) const

Definition at line 1781 of file RC.cpp.

◆ Load() [1/2]

bool RCPDB::Load ( const char *  prefix)
inlinevirtual

Implements PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 466 of file RC.h.

◆ Load() [2/2]

bool RCPDB::Load ( FILE *  f)
inlinevirtual

Reimplemented from PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 468 of file RC.h.

◆ OpenGLDraw()

void RCPDB::OpenGLDraw ( ) const
inline

Definition at line 462 of file RC.h.

◆ Save() [1/2]

void RCPDB::Save ( const char *  prefix)
inlinevirtual

Implements PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 467 of file RC.h.

◆ Save() [2/2]

void RCPDB::Save ( FILE *  f)
inlinevirtual

Reimplemented from PDBHeuristic< RCState, RCAction, RC, RCState, 4 >.

Definition at line 469 of file RC.h.

Member Data Documentation

◆ cornerLocations

std::vector<int> RCPDB::cornerLocations
private

◆ cornerRotations

std::vector<int> RCPDB::cornerRotations
private

◆ edgeLocations

std::vector<int> RCPDB::edgeLocations
private

◆ edgeRotations

std::vector<int> RCPDB::edgeRotations
private

The documentation for this class was generated from the following files: