Home | History | Annotate | Download | only in lib

Lines Matching refs:weight

31   // A final weight is mapped into a final weight. An error
35 // A final weight is mapped to an arc to the superfinal state
36 // when the result cannot be represented as a final weight.
40 // A final weight is mapped to an arc to the superfinal state
41 // unless the result can be represented as a final weight of weight
56 // // form A(0, 0, weight, kNoStateId).
83 typedef typename A::Weight Weight;
94 fst->SetFinal(superfinal, Weight::One());
109 fst->SetFinal(s, final_arc.weight);
119 fst->SetFinal(superfinal, Weight::One());
123 fst->SetFinal(s, Weight::Zero());
125 fst->SetFinal(s, final_arc.weight);
134 final_arc.weight != Weight::Zero())
136 final_arc.weight, superfinal));
137 fst->SetFinal(s, Weight::Zero());
160 typedef typename A::Weight Weight;
177 ofst->SetFinal(superfinal, B::Weight::One());
192 ofst->SetFinal(s, final_arc.weight);
201 ofst->SetFinal(superfinal, B::Weight::One());
205 ofst->SetFinal(s, B::Weight::Zero());
207 ofst->SetFinal(s, final_arc.weight);
214 final_arc.weight != B::Weight::Zero())
216 final_arc.weight, superfinal));
217 ofst->SetFinal(s, B::Weight::Zero());
266 typedef typename B::Weight Weight;
301 Weight Final(StateId s) {
309 this->SetFinal(s, final_arc.weight);
314 this->SetFinal(s, Weight::One());
319 this->SetFinal(s, final_arc.weight);
321 this->SetFinal(s, Weight::Zero());
326 this->SetFinal(s, s == superfinal_ ? Weight::One() : Weight::Zero());
371 if (!HasFinal(s) || Final(s) == Weight::Zero())
391 final_arc.weight != B::Weight::Zero())
393 final_arc.weight, superfinal_));
460 typedef typename B::Weight Weight;
488 virtual Weight Final(StateId s) const { return impl_->Final(s); }
656 return LogArc(arc.ilabel, arc.olabel, arc.weight.Value(), arc.nextstate);
671 return StdArc(arc.ilabel, arc.olabel, arc.weight.Value(), arc.nextstate);
687 typedef typename A::Weight AW;
688 typedef typename GallicArc<A, S>::Weight GW;
692 if (arc.nextstate == kNoStateId && arc.weight != AW::Zero())
693 return ToArc(0, 0, GW(SW::One(), arc.weight), kNoStateId);
696 return ToArc(0, 0, GW(SW::Zero(), arc.weight), kNoStateId);
700 GW(SW::One(), arc.weight), arc.nextstate);
704 GW(SW(arc.olabel), arc.weight), arc.nextstate);
723 typedef typename A::Weight AW;
724 typedef typename GallicArc<A, S>::Weight GW;
728 if (arc.nextstate == kNoStateId && arc.weight == GW::Zero())
731 SW w1 = arc.weight.Value1();
732 AW w2 = arc.weight.Value2();
763 typedef typename A::Weight AW;
764 typedef typename GallicArc<A, S>::Weight GW;
782 if (arc.nextstate == kNoStateId && arc.weight == GW::Zero())
785 SW w1 = arc.weight.Value1();
786 AW w2 = arc.weight.Value2();
851 typedef typename A::Weight Weight;
853 explicit PlusMapper(Weight w) : weight_(w) {}
856 if (arc.weight == Weight::Zero())
858 Weight w = Plus(arc.weight, weight_);
868 Weight weight_;
875 typedef typename A::Weight Weight;
877 explicit TimesMapper(Weight w) : weight_(w) {}
880 if (arc.weight == Weight::Zero())
882 Weight w = Times(arc.weight, weight_);
892 Weight weight_;
901 typedef typename FromArc::Weight FromWeight;
902 typedef typename ToArc::Weight ToWeight;
905 ToWeight w = arc.weight != FromWeight::Zero() ?
923 typedef typename FromArc::Weight FromWeight;
924 typedef typename ToArc::Weight ToWeight;
931 ToWeight w = arc.weight.Quantize(delta_);
946 // B::Weight = A::Weight::ReverseWeight
949 // The weight is reversed, while the label and nextstate preserved
957 return B(arc.ilabel, arc.olabel, arc.weight.Reverse(), arc.nextstate);