Home | History | Annotate | Download | only in fst

Lines Matching defs:arc

39 // An arc of weight w, with an origin state of potential p and
43 template <class Arc>
44 void Reweight(MutableFst<Arc> *fst,
45 const vector<typename Arc::Weight> &potential,
47 typedef typename Arc::Weight Weight;
68 StateIterator< MutableFst<Arc> > sit(*fst);
70 typename Arc::StateId state = sit.Value();
73 typename Arc::Weight weight = potential[state];
75 for (MutableArcIterator< MutableFst<Arc> > ait(fst, state);
78 Arc arc = ait.Value();
79 if (arc.nextstate >= potential.size())
81 typename Arc::Weight nextweight = potential[arc.nextstate];
85 arc.weight = Divide(Times(arc.weight, nextweight), weight,
88 arc.weight = Divide(Times(weight, arc.weight), nextweight,
90 ait.SetValue(arc);
101 typename Arc::StateId state = sit.Value();
106 typename Arc::Weight startweight = fst->Start() < potential.size() ?
110 typename Arc::StateId state = fst->Start();
111 for (MutableArcIterator< MutableFst<Arc> > ait(fst, state);
114 Arc arc = ait.Value();
116 arc.weight = Times(startweight, arc.weight);
118 arc.weight = Times(
120 arc.weight);
121 ait.SetValue(arc);
130 typename Arc::StateId state = fst->AddState();
133 Arc arc(0, 0, w, fst->Start());
134 fst->AddArc(state, arc);