Home | History | Annotate | Download | only in fst

Lines Matching refs:rstate

183   // Samples 'rstate.nsamples' from state 'state_id'. The 'rstate.length' is
184 // the length of the path to 'rstate'. Returns true if samples were
189 bool Sample(const RandState<A> &rstate) {
191 if ((fst_.NumArcs(rstate.state_id) == 0 &&
192 fst_.Final(rstate.state_id) == Weight::Zero()) ||
193 rstate.length == max_length_) {
198 for (size_t i = 0; i < rstate.nsamples; ++i)
199 ++sample_map_[arc_selector_(fst_, rstate.state_id)];
268 bool Sample(const RandState<A> &rstate) {
270 if ((fst_.NumArcs(rstate.state_id) == 0 &&
271 fst_.Final(rstate.state_id) == Weight::Zero()) ||
272 rstate.length == max_length_) {
277 for (size_t i = 0; i < rstate.nsamples; ++i)
278 ++sample_map_[arc_selector_(fst_, rstate.state_id, accumulator_)];
392 RandState<A> *rstate = new RandState<A>(s, npath_, 0, 0, 0);
393 state_table_.push_back(rstate);
451 const RandState<A> &rstate = *state_table_[s];
452 arc_sampler_->Sample(rstate);
453 ArcIterator< Fst<A> > aiter(*fst_, rstate.state_id);
454 size_t narcs = fst_->NumArcs(rstate.state_id);
459 double prob = static_cast<double>(count)/rstate.nsamples;
467 new RandState<A>(aarc.nextstate, count, rstate.length + 1,
468 pos, &rstate);