Home | History | Annotate | Download | only in lib

Lines Matching refs:Weight

31   typedef typename A::Weight Weight;
34 Weight threshold;
39 vector<Weight> *idistance;
42 vector<Weight> *fdistance;
44 PruneOptions(const Weight& t, ArcFilter f, vector<Weight> *id = 0,
45 vector<Weight> *fd = 0)
52 // do not belong to a successful path whose weight is no more than
53 // 'opts.threshold' Times() the weight of the shortest path. Weights
58 typedef typename Arc::Weight Weight;
61 if ((Weight::Properties() & (kPath | kCommutative))
63 LOG(FATAL) << "Prune: Weight needs to have the path property and"
65 << Weight::Type();
70 vector<Weight> *idistance = opts.idistance;
71 vector<Weight> *fdistance = opts.fdistance;
74 idistance = new vector<Weight>(ns, Weight::Zero());
77 idistance->resize(ns, Weight::Zero());
81 fdistance = new vector<Weight>(ns, Weight::Zero());
84 fdistance->resize(ns, Weight::Zero());
89 NaturalLess<Weight> less;
90 Weight ceiling = Times((*fdistance)[fst->Start()], opts.threshold);
102 Weight weight = Times(Times((*idistance)[state], arc.weight),
104 if(less(ceiling, weight)) {
110 fst->SetFinal(state, Weight::Zero());
124 // 'fst' that do not belong to a successful path whose weight is no
125 // more than 'opts.threshold' Times() the weight of the shortest
128 void Prune(MutableFst<Arc> *fst, typename Arc::Weight threshold) {
137 // 'ifst' whose weight is no more than 'opts.threshold' Times() the
138 // weight of the shortest path. Weights need to be commutative and
144 typedef typename Arc::Weight Weight;
147 if ((Weight::Properties() & (kPath | kCommutative))
149 LOG(FATAL) << "Prune: Weight needs to have the path property and"
151 << Weight::Type();
158 vector<Weight> *idistance = opts.idistance;
159 vector<Weight> *fdistance = opts.fdistance;
162 idistance = new vector<Weight>;
167 fdistance = new vector<Weight>;
172 NaturalLess<Weight> less;
174 fdistance->push_back(Weight::Zero());
175 Weight ceiling = Times((*fdistance)[ifst.Start()], opts.threshold);
182 idistance->push_back(Weight::Zero());
184 fdistance->push_back(Weight::Zero());
204 idistance->push_back(Weight::Zero());
206 fdistance->push_back(Weight::Zero());
210 Weight weight = Times(Times((*idistance)[state], arc.weight),
213 if (!less(ceiling, weight)) {
234 // successful path in 'ifst' whose weight is no more than
235 // 'opts.threshold' Times() the weight of the shortest path. Weights
240 typename Arc::Weight threshold) {