Lines Matching refs:PairWeight
37 template<class W1, class W2> class PairWeight;
39 istream &operator>>(istream &strm, PairWeight<W1, W2> &w);
42 class PairWeight {
44 friend istream &operator>><W1, W2>(istream&, PairWeight<W1, W2>&);
46 typedef PairWeight<typename W1::ReverseWeight,
50 PairWeight() {}
52 PairWeight(const PairWeight& w) : value1_(w.value1_), value2_(w.value2_) {}
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),
114 // Reads PairWeight when there are not parentheses around pair terms
116 istream &strm, PairWeight<W1, W2>& w, char separator) {
139 w = PairWeight<W1, W2>(w1, w2);
143 // Reads PairWeight when there are parentheses around pair terms
145 istream &strm, PairWeight<W1, W2>& w,
202 w = PairWeight<W1, W2>(w1, w2);
213 inline bool operator==(const PairWeight<W1, W2> &w,
214 const PairWeight<W1, W2> &v) {
219 inline bool operator!=(const PairWeight<W1, W2> &w1,
220 const PairWeight<W1, W2> &w2) {
226 inline bool ApproxEqual(const PairWeight<W1, W2> &w1,
227 const PairWeight<W1, W2> &w2,
234 inline ostream &operator<<(ostream &strm, const PairWeight<W1, W2> &w) {
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);