Lines Matching defs:arc
131 // an arc iterator, useful for FST composition. In particular,
133 // the transitions of the arc iterator, when iter_input is true
137 // With the arc iterator test of reachability, the begin position, end
138 // position and accumulated arc weight of the matches can be
139 // returned. The optional template argument controls how reachable arc
146 typedef A Arc;
154 : fst_(new VectorFst<Arc>(fst)),
211 void Relabel(MutableFst<Arc> *fst, bool relabel_input) {
212 for (StateIterator< MutableFst<Arc> > siter(*fst);
215 for (MutableArcIterator< MutableFst<Arc> > aiter(fst, s);
218 Arc arc = aiter.Value();
220 arc.ilabel = Relabel(arc.ilabel);
222 arc.olabel = Relabel(arc.olabel);
223 aiter.SetValue(arc);
227 ArcSort(fst, ILabelCompare<Arc>());
230 ArcSort(fst, OLabelCompare<Arc>());
261 // with arc iterator to be passed to Reach.
296 // Can reach any arc iterator label between iterator positions
299 // Arc iterator labels must be transformed by the Relabel methods
319 // Check each arc against intervals.
320 // Set arc iterator flags to only compute the ilabel or olabel values,
327 const A &arc = aiter->Value();
328 Label label = aiter_input ? arc.ilabel : arc.olabel;
336 // If the 'arc.weight' wasn't computed by the call
338 // 'aiter->Value()' again after having set the arc iterator
339 // flags to compute the arc weight value.
350 reach_weight_ = accumulator_->Sum(reach_weight_, arc.weight);
382 // Returns iterator position of first matching arc.
385 // Returns iterator position one past last matching arc.
417 for (MutableArcIterator< VectorFst<Arc> > aiter(fst_, s);
420 Arc arc = aiter.Value();
421 Label label = data_->ReachInput() ? arc.ilabel : arc.olabel;
428 arc.nextstate = label2state_[label];
429 aiter.SetValue(arc);
431 ++indeg[arc.nextstate]; // Finds in-degrees for next step.
442 Arc arc(kNoLabel, kNoLabel, final, label2state_[kNoLabel]);
443 fst_->AddArc(s, arc);
444 ++indeg[arc.nextstate]; // Finds in-degrees for next step.
461 Arc arc(0, 0, Weight::One(), s);
462 fst_->AddArc(start, arc);
545 VectorFst<Arc> *fst_;
551 Weight reach_weight_; // Gives weight sum of arc iterator
554 S *accumulator_; // Sums arc weights