15 #ifndef TASK_HIFST_LOCALPRUNINGCONDITIONS_HPP 16 #define TASK_HIFST_LOCALPRUNINGCONDITIONS_HPP 65 std::map<uint64, conditions> lpc_;
72 lpc_[c.
cat * 100000000000 + c.
span * 100000000 + c.
lpns % 100000000 ] = c;
83 bool operator () (
unsigned cc,
unsigned span,
unsigned numstates ,
float& w ) {
84 if ( ! lpc_.size() )
return false;
85 uint64 catspan = cc * 100000000000 + span * 100000000 +
86 ( numstates % 100000000 );
88 std::map <uint64, conditions>::iterator itx;
89 itx = lpc_.lower_bound ( catspan );
90 if ( itx == lpc_.end() ) --itx;
91 else if ( itx->first != catspan && itx != lpc_.begin() ) --itx;
92 while ( itx->second.cat == cc && ( itx->second.span > span
93 || itx->second.lpns > numstates ) && itx != lpc_.begin() ) --itx;
94 LINFO (
"AT " << cc <<
", ? ," << span - 1 <<
": actual cell=" << catspan <<
95 " closest conditions=" << itx->first );
96 if ( itx->second.cat != cc || itx->second.span > span
97 || itx->second.lpns > numstates )
return false;
120 #endif //TASK_HIFST_LOCALPRUNINGCONDITIONS_HPP #define ZDISALLOW_COPY_AND_ASSIGN(TypeName)
struct containing the elements that trigger local pruning.
unsigned lpns
number of states
conditions(unsigned category, unsigned span, unsigned numstates, float weight)
std::size_t size()
returns size of map
LocalPruningConditions()
Empty constructor.
void add(const conditions &c)
Add condition.
convenience class that takes care of local pruning conditions. Conditions are indexed by 1000*cc+y...
void clear()
Clears all conditions.