Lines Matching refs:weight
19 // Classes to accumulate arc weights. Useful for weight lookahead.
46 typedef typename A::Weight Weight;
56 Weight Sum(Weight w, Weight v) {
61 Weight Sum(Weight w, ArcIterator *aiter, ssize_t begin,
63 Weight sum = w;
66 sum = Plus(sum, aiter->Value().weight);
78 // assuming an arc weight has a WeightConvert specialization to
85 typedef typename A::Weight Weight;
95 Weight Sum(Weight w, Weight v) {
100 Weight Sum(Weight w, ArcIterator *aiter, ssize_t begin,
102 Weight sum = w;
105 sum = LogPlus(sum, aiter->Value().weight);
114 Weight LogPlus(Weight w, Weight v) {
123 WeightConvert<Weight, Log64Weight> to_log_weight_;
124 WeightConvert<Log64Weight, Weight> to_weight_;
143 // Cummulative weight per state for all states s.t. # of arcs >
147 // Maps from state to corresponding beginning weight position in
158 // assuming an arc weight has a WeightConvert specialization to and
160 // to setup pre-computed weight information.
166 typedef typename A::Weight Weight;
204 Weight Sum(Weight w, Weight v) {
209 Weight Sum(Weight w, ArcIterator *aiter, ssize_t begin,
211 if (error_) return Weight::NoWeight();
212 Weight sum = w;
227 sum = LogPlus(sum, aiter->Value().weight);
239 sum = LogPlus(sum, aiter->Value().weight);
268 sum = LogPlus(sum, arc.weight);
269 // Stores cumulative weight distribution per arc_period_.
294 Weight LogPlus(Weight w, Weight v) {
303 double LogPlus(double f1, Weight v) {
313 Weight LogMinus(double f1, double f2) {
318 return Weight::NoWeight();
326 WeightConvert<Weight, Log64Weight> to_log_weight_;
327 WeightConvert<Log64Weight, Weight> to_weight_;
347 typedef typename A::Weight Weight;
434 typedef typename A::Weight Weight;
493 Weight Sum(Weight w, Weight v) {
498 Weight Sum(Weight w, Iterator *aiter, ssize_t begin,
501 Weight sum = w;
504 sum = LogPlus(sum, aiter->Value().weight);
512 aiter->Value().weight));
529 x = LogPlus(x, aiter->Value().weight);
549 Weight LogPlus(Weight w, Weight v) {
558 double LogPlus(double f1, Weight v) {
568 Weight LogMinus(double f1, double f2) {
573 return Weight::NoWeight();
581 WeightConvert<Weight, Log64Weight> to_log_weight_;
582 WeightConvert<Log64Weight, Weight> to_weight_;
661 typedef typename Arc::Weight Weight;
704 (data_->GetFst(fst_id_)->Final(tuple.fst_state) != Weight::Zero())) {
709 offset_weight_ = Weight::Zero();
713 Weight Sum(Weight w, Weight v) {
714 if (error_) return Weight::NoWeight();
719 Weight Sum(Weight w, ArcIterator *aiter, ssize_t begin,
721 if (error_) return Weight::NoWeight();
722 Weight sum = begin == end ? Weight::Zero()
737 Weight offset_weight_;