Hashes patterns by ring godel; use for fast checking. More...
#include <HashedPatternSet.hpp>
Public Member Functions | |
HashedPatternSet () | |
Creates empty set of hashed patterns. | |
~HashedPatternSet () | |
Destructor. | |
void | hash (const PatternSet &patterns) |
Hashes the given patterns. | |
const RotatedPatternList & | ListForGodel (const RingGodel &godel) const |
Returns list of rotated patterns for godel. | |
Private Attributes | |
std::vector< RotatedPatternList > | m_godel_list |
Will contain a RotatedPatternList for each of RingGodel::ValidGodels(). |
Hashes patterns by ring godel; use for fast checking.
For each valid ring godel, a list of RotatedPatterns is pre-computed from the given PatternSet. This allows PatternBoard to check if a set of patterns matches a cell extremely quickly; especially if the patterns have a max extension of one, since in that case no checking is actually required!
Definition at line 24 of file HashedPatternSet.hpp.
HashedPatternSet::HashedPatternSet | ( | ) |
Creates empty set of hashed patterns.
Definition at line 12 of file HashedPatternSet.cpp.
HashedPatternSet::~HashedPatternSet | ( | ) |
Destructor.
Definition at line 17 of file HashedPatternSet.cpp.
void HashedPatternSet::hash | ( | const PatternSet & | patterns | ) |
Hashes the given patterns.
Definition at line 27 of file HashedPatternSet.cpp.
References m_godel_list, PatternRingGodel::MatchesGodel(), Pattern::NUM_SLICES, Pattern::RingGodel(), and RingGodel::ValidGodels().
Referenced by IcePatternSet::LoadPatterns().
const RotatedPatternList & HashedPatternSet::ListForGodel | ( | const RingGodel & | godel | ) | const |
Returns list of rotated patterns for godel.
Definition at line 22 of file HashedPatternSet.cpp.
References RingGodel::Index(), and m_godel_list.
Referenced by PatternState::MatchOnCell().
std::vector<RotatedPatternList> HashedPatternSet::m_godel_list [private] |
Will contain a RotatedPatternList for each of RingGodel::ValidGodels().
Definition at line 44 of file HashedPatternSet.hpp.
Referenced by hash(), and ListForGodel().