Home | History | Annotate | Download | only in fst

Lines Matching refs:distance

33 #include <fst/shortest-distance.h>
46 bool has_distance; // distance vector already contains the
47 // shortest distance from the initial state
68 // 'ifst'. 'distance' returns the shortest distances from the source
80 vector<typename Arc::Weight> *distance,
103 distance->clear();
125 while (distance->size() < source) {
126 distance->push_back(Weight::Zero());
131 distance->push_back(Weight::One());
141 Weight sd = (*distance)[s];
159 while (distance->size() <= arc.nextstate) {
160 distance->push_back(Weight::Zero());
166 Weight &nd = (*distance)[arc.nextstate];
215 const vector<Weight>& distance,
217 : pairs_(pairs), distance_(distance), superfinal_(sfinal), delta_(d) {}
254 // 'distance' must contain the shortest distance from each state to a final
269 // the shortest-distance algorithm. There are some issues with the
273 // and at any state in its expansion the values of distance vector need only
278 const vector<typename Arc::Weight> &distance,
306 // distance from 'superfinal' to the final state is 'Weight::One()',
307 // hence 'distance[superfinal]' is not needed.
310 compare(pairs, distance, superfinal, delta);
318 distance.size() <= ifst.Start() ||
319 distance[ifst.Start()] == Weight::Zero() ||
332 Weight limit = Times(distance[ifst.Start()], weight_threshold);
340 p.first < distance.size() ? distance[p.first] : Weight::Zero();
390 // 'ofst' contains the n-shortest paths in 'ifst'. 'distance' returns
410 // the shortest-distance algorithm. There are some issues with the
414 vector<typename Arc::Weight> *distance,
422 SingleShortestPath(ifst, ofst, distance, opts);
434 ShortestDistance(ifst, distance, opts);
435 if (distance->size() == 1 && !(*distance)[0].Member()) {
440 // Algorithm works on the reverse of 'fst' : 'rfst', 'distance' is
441 // the distance to the final state in 'rfst', 'ofst' is built as the
450 if (s < distance->size())
451 d = Plus(d, Times(arc.weight.Reverse(), (*distance)[s]));
453 distance->insert(distance->begin(), d);
456 NShortestPath(rfst, ofst, *distance, n, opts.delta,
461 DeterminizeFst<ReverseArc> dfst(rfst, *distance, &ddistance, dopts);
465 distance->erase(distance->begin());
489 vector<typename Arc::Weight> distance;
491 AutoQueue<typename Arc::StateId> state_queue(ifst, &distance, arc_filter);
496 ShortestPath(ifst, ofst, &distance, opts);