Home | History | Annotate | Download | only in lib

Lines Matching full:weight

30 // vector in the direction defined by TYPE. Weight needs to be left
34 // An arc of weight w, with an origin state of potential p and
39 void Reweight(MutableFst<Arc> *fst, vector<typename Arc::Weight> potential,
41 typedef typename Arc::Weight Weight;
46 potential.push_back(Weight::Zero());
48 if (type == REWEIGHT_TO_FINAL && !(Weight::Properties() & kRightSemiring))
50 << "Weight to be right distributive: "
51 << Weight::Type();
53 if (type == REWEIGHT_TO_INITIAL && !(Weight::Properties() & kLeftSemiring))
55 << "Weight to be left distributive: "
56 << Weight::Type();
66 if ((potential[state] == Weight::Zero()) ||
67 (potential[arc.nextstate] == Weight::Zero()))
70 && (potential[state] != Weight::Zero()))
71 arc.weight = Divide(Times(arc.weight, potential[arc.nextstate]),
74 && (potential[arc.nextstate] != Weight::Zero()))
75 arc.weight = Divide(Times(potential[state], arc.weight),
80 && (potential[state] != Weight::Zero()))
87 if ((potential[fst->Start()] != Weight::One()) &&
88 (potential[fst->Start()] != Weight::Zero())) {
96 arc.weight = Times(potential[state], arc.weight);
98 arc.weight = Times(
99 Divide(Weight::One(), potential[state], DIVIDE_RIGHT),
100 arc.weight);
106 fst->SetFinal(state, Times(Divide(Weight::One(), potential[state],
112 Weight w = type == REWEIGHT_TO_INITIAL ?
114 Divide(Weight::One(), potential[fst->Start()], DIVIDE_RIGHT);