Home | History | Annotate | Download | only in fst

Lines Matching refs:w1

39 template<class W1, class W2>
40 class LexicographicWeight : public PairWeight<W1, W2> {
42 using PairWeight<W1, W2>::Value1;
43 using PairWeight<W1, W2>::Value2;
44 using PairWeight<W1, W2>::SetValue1;
45 using PairWeight<W1, W2>::SetValue2;
46 using PairWeight<W1, W2>::Zero;
47 using PairWeight<W1, W2>::One;
48 using PairWeight<W1, W2>::NoWeight;
49 using PairWeight<W1, W2>::Quantize;
50 using PairWeight<W1, W2>::Reverse;
52 typedef LexicographicWeight<typename W1::ReverseWeight,
58 LexicographicWeight(const PairWeight<W1, W2>& w)
59 : PairWeight<W1, W2>(w) {}
61 LexicographicWeight(W1 w1, W2 w2) : PairWeight<W1, W2>(w1, w2) {
63 if ((W1::Properties() & props) != props) {
65 << "have the path property: " << W1::Type();
66 SetValue1(W1::NoWeight());
75 static const LexicographicWeight<W1, W2> &Zero() {
76 static const LexicographicWeight<W1, W2> zero(PairWeight<W1, W2>::Zero());
80 static const LexicographicWeight<W1, W2> &One() {
81 static const LexicographicWeight<W1, W2> one(PairWeight<W1, W2>::One());
85 static const LexicographicWeight<W1, W2> &NoWeight() {
86 static const LexicographicWeight<W1, W2> no_weight(
87 PairWeight<W1, W2>::NoWeight());
92 static const string type = W1::Type() + "_LT_" + W2::Type();
99 if (Value1() == W1::Zero() && Value2() == W2::Zero()) return true;
100 if (Value1() != W1::Zero() && Value2() != W2::Zero()) return true;
104 LexicographicWeight<W1, W2> Quantize(float delta = kDelta) const {
105 return PairWeight<W1, W2>::Quantize();
109 return PairWeight<W1, W2>::Reverse();
113 uint64 props1 = W1::Properties();
120 template <class W1, class W2>
121 inline LexicographicWeight<W1, W2> Plus(const LexicographicWeight<W1, W2> &w,
122 const LexicographicWeight<W1, W2> &v) {
124 return LexicographicWeight<W1, W2>::NoWeight();
125 NaturalLess<W1> less1;
134 template <class W1, class W2>
135 inline LexicographicWeight<W1, W2> Times(const LexicographicWeight<W1, W2> &w,
136 const LexicographicWeight<W1, W2> &v) {
137 return LexicographicWeight<W1, W2>(Times(w.Value1(), v.Value1()),
141 template <class W1, class W2>
142 inline LexicographicWeight<W1, W2> Divide(const LexicographicWeight<W1, W2> &w,
143 const LexicographicWeight<W1, W2> &v,
145 return LexicographicWeight<W1, W2>(Divide(w.Value1(), v.Value1(), typ),