15 #ifndef TASK_HIFST_EXPANDEDNUMSTATES_HPP 16 #define TASK_HIFST_EXPANDEDNUMSTATES_HPP 39 unordered_map< uint , uint > rtnnumstates_;
47 return rtnnumstates_[hieroindex];
61 void update ( uint cc, uint x, uint y, fst::VectorFst<Arc> *myfst ) {
63 uint& ns = rtnnumstates_[hieroindex];
64 ns = myfst->NumStates();
65 LDEBUG (
"AT: " << cc <<
"," << x <<
"," << y <<
":" <<
",NS=" <<
66 rtnnumstates_[hieroindex] );
67 typedef typename Arc::StateId StateId;
68 for ( fst::StateIterator< fst::VectorFst<Arc> > si ( *myfst ); !si.Done();
70 StateId state_id = si.Value();
71 for ( fst::ArcIterator< fst::VectorFst<Arc> > ai ( *myfst , si.Value() );
72 !ai.Done(); ai.Next() ) {
73 const Arc& arc = ai.Value();
75 ns += rtnnumstates_[arc.ilabel] - 2;
78 LINFO (
"AT: " << cc <<
"," << x <<
"," << y <<
":" <<
"NS (expanded) =" <<
89 #endif //ifndef TASK_HIFST_EXPANDEDNUMSTATES_HPP ExpandedNumStatesRTN()
Constructor.
void update(uint cc, uint x, uint y, fst::VectorFst< Arc > *myfst)
Estimates (expanded) number of states of rtn_[cc][x][y] Traverses arcs and and add number of states o...
uint operator()(uint cc, uint x, uint y)
Returns estimated number of states for an rtn with a root fst at (cc,x,y)
Utility class that, given an RTN with root at (cc,x,y), estimates the number of states of an expanded...