Home | History | Annotate | Download | only in fst

Lines Matching refs:W2

33 // Product semiring: W1 * W2
34 template<class W1, class W2>
35 class ProductWeight : public PairWeight<W1, W2> {
37 using PairWeight<W1, W2>::Zero;
38 using PairWeight<W1, W2>::One;
39 using PairWeight<W1, W2>::NoWeight;
40 using PairWeight<W1, W2>::Quantize;
41 using PairWeight<W1, W2>::Reverse;
43 typedef ProductWeight<typename W1::ReverseWeight, typename W2::ReverseWeight>
48 ProductWeight(const PairWeight<W1, W2>& w) : PairWeight<W1, W2>(w) {}
50 ProductWeight(W1 w1, W2 w2) : PairWeight<W1, W2>(w1, w2) {}
52 static const ProductWeight<W1, W2> &Zero() {
53 static const ProductWeight<W1, W2> zero(PairWeight<W1, W2>::Zero());
57 static const ProductWeight<W1, W2> &One() {
58 static const ProductWeight<W1, W2> one(PairWeight<W1, W2>::One());
62 static const ProductWeight<W1, W2> &NoWeight() {
63 static const ProductWeight<W1, W2> no_weight(
64 PairWeight<W1, W2>::NoWeight());
69 static const string type = W1::Type() + "_X_" + W2::Type();
75 uint64 props2 = W2::Properties();
80 ProductWeight<W1, W2> Quantize(float delta = kDelta) const {
81 return PairWeight<W1, W2>::Quantize(delta);
85 return PairWeight<W1, W2>::Reverse();
91 template <class W1, class W2>
92 inline ProductWeight<W1, W2> Plus(const ProductWeight<W1, W2> &w,
93 const ProductWeight<W1, W2> &v) {
94 return ProductWeight<W1, W2>(Plus(w.Value1(), v.Value1()),
98 template <class W1, class W2>
99 inline ProductWeight<W1, W2> Times(const ProductWeight<W1, W2> &w,
100 const ProductWeight<W1, W2> &v) {
101 return ProductWeight<W1, W2>(Times(w.Value1(), v.Value1()),
105 template <class W1, class W2>
106 inline ProductWeight<W1, W2> Divide(const ProductWeight<W1, W2> &w,
107 const ProductWeight<W1, W2> &v,
109 return ProductWeight<W1, W2>(Divide(w.Value1(), v.Value1(), typ),