Home | History | Annotate | Download | only in fst

Lines Matching defs:w1

37 template<class W1, class W2> class PairWeight;
38 template <class W1, class W2>
39 istream &operator>>(istream &strm, PairWeight<W1, W2> &w);
41 template<class W1, class W2>
44 friend istream &operator>><W1, W2>(istream&, PairWeight<W1, W2>&);
46 typedef PairWeight<typename W1::ReverseWeight,
54 PairWeight(W1 w1, W2 w2) : value1_(w1), value2_(w2) {}
56 static const PairWeight<W1, W2> &Zero() {
57 static const PairWeight<W1, W2> zero(W1::Zero(), W2::Zero());
61 static const PairWeight<W1, W2> &One() {
62 static const PairWeight<W1, W2> one(W1::One(), W2::One());
66 static const PairWeight<W1, W2> &NoWeight() {
67 static const PairWeight<W1, W2> no_weight(W1::NoWeight(), W2::NoWeight());
81 PairWeight<W1, W2> &operator=(const PairWeight<W1, W2> &w) {
97 PairWeight<W1, W2> Quantize(float delta = kDelta) const {
98 return PairWeight<W1, W2>(value1_.Quantize(delta),
106 const W1& Value1() const { return value1_; }
111 void SetValue1(const W1 &w) { value1_ = w; }
116 istream &strm, PairWeight<W1, W2>& w, char separator) {
132 W1 w1 = W1::Zero();
133 strm1 >> w1;
139 w = PairWeight<W1, W2>(w1, w2);
145 istream &strm, PairWeight<W1, W2>& w,
181 W1 w1 = W1::Zero();
182 strm1 >> w1;
202 w = PairWeight<W1, W2>(w1, w2);
207 W1 value1_;
212 template <class W1, class W2>
213 inline bool operator==(const PairWeight<W1, W2> &w,
214 const PairWeight<W1, W2> &v) {
218 template <class W1, class W2>
219 inline bool operator!=(const PairWeight<W1, W2> &w1,
220 const PairWeight<W1, W2> &w2) {
221 return w1.Value1() != w2.Value1() || w1.Value2() != w2.Value2();
225 template <class W1, class W2>
226 inline bool ApproxEqual(const PairWeight<W1, W2> &w1,
227 const PairWeight<W1, W2> &w2,
229 return ApproxEqual(w1.Value1(), w2.Value1(), delta) &&
230 ApproxEqual(w1.Value2(), w2.Value2(), delta);
233 template <class W1, class W2>
234 inline ostream &operator<<(ostream &strm, const PairWeight<W1, W2> &w) {
255 template <class W1, class W2>
256 inline istream &operator>>(istream &strm, PairWeight<W1, W2> &w) {
270 return PairWeight<W1, W2>::ReadWithParen(
274 return PairWeight<W1, W2>::ReadNoParen(strm, w, separator);