Lines Matching defs:ProductWeight

30 class ProductWeight {
32 typedef ProductWeight<typename W1::ReverseWeight, typename W2::ReverseWeight>
35 ProductWeight() {}
37 ProductWeight(W1 w1, W2 w2) : value1_(w1), value2_(w2) {}
39 static const ProductWeight<W1, W2> &Zero() {
40 static const ProductWeight<W1, W2> zero(W1::Zero(), W2::Zero());
44 static const ProductWeight<W1, W2> &One() {
45 static const ProductWeight<W1, W2> one(W1::One(), W2::One());
64 ProductWeight<W1, W2> &operator=(const ProductWeight<W1, W2> &w) {
80 ProductWeight<W1, W2> Quantize(float delta = kDelta) const {
81 return ProductWeight<W1, W2>(value1_.Quantize(), value2_.Quantize());
105 inline bool operator==(const ProductWeight<W1, W2> &w,
106 const ProductWeight<W1, W2> &v) {
111 inline bool operator!=(const ProductWeight<W1, W2> &w1,
112 const ProductWeight<W1, W2> &w2) {
118 inline bool ApproxEqual(const ProductWeight<W1, W2> &w1,
119 const ProductWeight<W1, W2> &w2,
125 inline ostream &operator<<(ostream &strm, const ProductWeight<W1, W2> &w) {
132 inline istream &operator>>(istream &strm, ProductWeight<W1, W2> &w) {
166 w = ProductWeight<W1, W2>(w1, w2);
171 inline ProductWeight<W1, W2> Plus(const ProductWeight<W1, W2> &w,
172 const ProductWeight<W1, W2> &v) {
173 return ProductWeight<W1, W2>(Plus(w.Value1(), v.Value1()),
178 inline ProductWeight<W1, W2> Times(const ProductWeight<W1, W2> &w,
179 const ProductWeight<W1, W2> &v) {
180 return ProductWeight<W1, W2>(Times(w.Value1(), v.Value1()),
185 inline ProductWeight<W1, W2> Divide(const ProductWeight<W1, W2> &w,
186 const ProductWeight<W1, W2> &v,
188 return ProductWeight<W1, W2>(Divide(w.Value1(), v.Value1(), typ),