Home | History | Annotate | Download | only in lib

Lines Matching refs:weight

32 #include "fst/lib/factor-weight.h"
49 typedef W Weight;
62 typedef StringWeight<L, S> Weight;
64 Weight operator()(const Weight &w1, const Weight &w2) const {
69 LOG(FATAL) << "LabelCommonDivisor: Weight needs to be left semiring";
72 return Weight::One();
73 else if (w1 == Weight::Zero())
74 return Weight(iter2.Value());
75 else if (w2 == Weight::Zero())
76 return Weight(iter1.Value());
78 return Weight(iter1.Value());
80 return Weight::One();
87 // weight component, which defaults to the default common divisor.
91 typedef GallicWeight<L, W, S> Weight;
93 Weight operator()(const Weight &w1, const Weight &w2) const {
94 return Weight(label_common_divisor_(w1.Value1(), w2.Value1()),
131 typedef typename A::Weight Weight;
157 Weight Final(StateId s) {
159 Weight final = ComputeFinal(s);
193 virtual Weight ComputeFinal(StateId s) = 0;
210 typedef typename A::Weight Weight;
216 Element(StateId s, Weight w) : state_id(s), weight(w) {}
219 Weight weight; // Residual weight
231 if (!(Weight::Properties() & kLeftSemiring))
232 LOG(FATAL) << "DeterminizeFst: Weight needs to be left distributive: "
233 << Weight::Type();
245 Element element(s, Weight::One());
251 virtual Weight ComputeFinal(StateId s) {
253 Weight final = Weight::Zero();
258 final = Plus(final, Times(element.weight,
316 Times(src_element.weight, arc.weight));
331 arc.weight = Weight::Zero();
337 // Computes label weight.
338 arc.weight = common_divisor_(arc.weight, dest_element.weight);
344 // Found duplicate state: sums state weight and deletes dup.
345 matching_element->weight = Plus(matching_element->weight,
346 dest_element.weight);
357 // Divides out label weight from destination subset elements.
364 dest_element.weight = Divide(dest_element.weight, arc.weight,
366 dest_element.weight = dest_element.weight.Quantize(delta_);
406 if (!element1 || element1->weight != element2.weight) {
438 element.weight.Hash();
476 typedef typename A::Weight Weight;
486 typedef GallicCommonDivisor<Label, Weight, S> CommonDivisor;
487 typedef GallicFactor<Label, Weight, S> FactorIterator;
496 virtual Weight ComputeFinal(StateId s) { return from_fst_->Final(s); }
540 typedef typename A::Weight Weight;
549 typedef DefaultCommonDivisor<Weight> D;
565 virtual Weight Final(StateId s) const { return impl_->Final(s); }