Lines Matching refs:w2
43 Weight w2 = weight_generator_(); variable
48 VLOG(1) << "w2 = " << w2;
51 TestSemiring(w1, w2, w3);
53 TestDivision(w1, w2);
54 TestReverse(w1, w2);
55 TestEquality(w1, w2, w3);
66 void TestSemiring(Weight w1, Weight w2, Weight w3) { in TestSemiring() argument
68 CHECK(Plus(w1, w2).Member()); in TestSemiring()
69 CHECK(Times(w1, w2).Member()); in TestSemiring()
72 CHECK(ApproxEqual(Plus(w1, Plus(w2, w3)), Plus(Plus(w1, w2), w3))); in TestSemiring()
73 CHECK(ApproxEqual(Times(w1, Times(w2, w3)), Times(Times(w1, w2), w3))); in TestSemiring()
89 CHECK(ApproxEqual(Plus(w1, w2), Plus(w2, w1))); in TestSemiring()
91 CHECK(ApproxEqual(Times(w1, w2), Times(w2, w1))); in TestSemiring()
108 CHECK(ApproxEqual(Times(w1, Plus(w2, w3)), in TestSemiring()
109 Plus(Times(w1, w2), Times(w1, w3)))); in TestSemiring()
111 CHECK(ApproxEqual(Times(Plus(w1, w2), w3), in TestSemiring()
112 Plus(Times(w1, w3), Times(w2, w3)))); in TestSemiring()
118 CHECK(Plus(w1, w2) == w1 || Plus(w1, w2) == w2); in TestSemiring()
129 void TestDivision(Weight w1, Weight w2) { in TestDivision() argument
130 Weight p = Times(w1, w2); in TestDivision()
141 Weight d = Divide(p, w2, DIVIDE_RIGHT); in TestDivision()
143 CHECK(ApproxEqual(p, Times(d, w2))); in TestDivision()
156 void TestReverse(Weight w1, Weight w2) { in TestReverse() argument
160 ReverseWeight rw2 = w2.Reverse(); in TestReverse()
163 CHECK(Plus(w1, w2).Reverse() == Plus(rw1, rw2)); in TestReverse()
164 CHECK(Times(w1, w2).Reverse() == Times(rw2, rw1)); in TestReverse()
168 void TestEquality(Weight w1, Weight w2, Weight w3) { in TestEquality() argument
173 CHECK((w1 == w2) == (w2 == w1)); in TestEquality()
176 if (w1 == w2 && w2 == w3) in TestEquality()