Lines Matching defs:arc
48 template <class Arc, class Queue>
50 : public ShortestDistanceOptions<Arc, Queue, EpsilonArcFilter<Arc> > {
52 typedef typename Arc::StateId StateId;
53 typedef typename Arc::Weight Weight;
62 : ShortestDistanceOptions< Arc, Queue, EpsilonArcFilter<Arc> >(
63 q, EpsilonArcFilter<Arc>(), kNoStateId, d),
70 template <class Arc, class Queue>
73 typedef typename Arc::Label Label;
74 typedef typename Arc::StateId StateId;
75 typedef typename Arc::Weight Weight;
77 RmEpsilonState(const Fst<Arc> &fst,
79 const RmEpsilonOptions<Arc, Queue> &opts)
87 vector<Arc> &Arcs() { return arcs_; }
132 const Fst<Arc> &fst_;
136 ShortestDistanceState<Arc, Queue, EpsilonArcFilter<Arc> > sd_state_;
142 EpsilonArcFilter<Arc> eps_filter_;
146 vector<Arc> arcs_; // Arcs of state being expanded
153 template <class Arc, class Queue>
154 const size_t RmEpsilonState<Arc, Queue>::kPrime0;
155 template <class Arc, class Queue>
156 const size_t RmEpsilonState<Arc, Queue>::kPrime1;
159 template <class Arc, class Queue>
160 void RmEpsilonState<Arc,Queue>::Expand(typename Arc::StateId source) {
177 for (ArcIterator< Fst<Arc> > ait(fst_, state);
180 Arc arc = ait.Value();
181 arc.weight = Times((*distance_)[state], arc.weight);
183 if (eps_filter_(arc)) {
184 while (visited_.size() <= arc.nextstate)
186 if (!visited_[arc.nextstate])
187 eps_queue_.push(arc.nextstate);
189 Element element(arc.ilabel, arc.olabel, arc.nextstate);
195 arcs_.push_back(arc);
199 w = Plus(w, arc.weight);
203 arcs_.push_back(arc);
227 template <class Arc, class Queue>
228 void RmEpsilon(MutableFst<Arc> *fst,
229 vector<typename Arc::Weight> *distance,
230 const RmEpsilonOptions<Arc, Queue> &opts) {
231 typedef typename Arc::StateId StateId;
232 typedef typename Arc::Weight Weight;
233 typedef typename Arc::Label Label;
244 for (ArcIterator<Fst<Arc> > aiter(*fst, i);
263 TopOrderVisitor<Arc> top_order_visitor(&order, &acyclic);
264 DfsVisit(*fst, &top_order_visitor, EpsilonArcFilter<Arc>());
277 SccVisitor<Arc> scc_visitor(&scc, 0, 0, &props);
278 DfsVisit(*fst, &scc_visitor, EpsilonArcFilter<Arc>());
291 RmEpsilonState<Arc, Queue>
302 vector<Arc> &arcs = rmeps_state.Arcs();
348 template <class Arc>
349 void RmEpsilon(MutableFst<Arc> *fst,
351 typename Arc::Weight weight_threshold = Arc::Weight::Zero(),
352 typename Arc::StateId state_threshold = kNoStateId,
354 typedef typename Arc::StateId StateId;
355 typedef typename Arc::Weight Weight;
356 typedef typename Arc::Label Label;
359 AutoQueue<StateId> state_queue(*fst, &distance, EpsilonArcFilter<Arc>());
360 RmEpsilonOptions<Arc, AutoQueue<StateId> >
513 // to visit an input state or arc is assumed and exclusive of caching.
528 typedef A Arc;
550 virtual void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) const {