Home | History | Annotate | Download | only in test

Lines Matching defs:w2

43       Weight w2 = weight_generator_();
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) {
68 CHECK(Plus(w1, w2).Member());
69 CHECK(Times(w1, w2).Member());
72 CHECK(ApproxEqual(Plus(w1, Plus(w2, w3)), Plus(Plus(w1, w2), w3)));
73 CHECK(ApproxEqual(Times(w1, Times(w2, w3)), Times(Times(w1, w2), w3)));
89 CHECK(ApproxEqual(Plus(w1, w2), Plus(w2, w1)));
91 CHECK(ApproxEqual(Times(w1, w2), Times(w2, w1)));
108 CHECK(ApproxEqual(Times(w1, Plus(w2, w3)),
109 Plus(Times(w1, w2), Times(w1, w3))));
111 CHECK(ApproxEqual(Times(Plus(w1, w2), w3),
112 Plus(Times(w1, w3), Times(w2, w3))));
118 CHECK(Plus(w1, w2) == w1 || Plus(w1, w2) == w2);
129 void TestDivision(Weight w1, Weight w2) {
130 Weight p = Times(w1, w2);
141 Weight d = Divide(p, w2, DIVIDE_RIGHT);
143 CHECK(ApproxEqual(p, Times(d, w2)));
156 void TestReverse(Weight w1, Weight w2) {
160 ReverseWeight rw2 = w2.Reverse();
163 CHECK(Plus(w1, w2).Reverse() == Plus(rw1, rw2));
164 CHECK(Times(w1, w2).Reverse() == Times(rw2, rw1));
168 void TestEquality(Weight w1, Weight w2, Weight w3) {
173 CHECK((w1 == w2) == (w2 == w1));
176 if (w1 == w2 && w2 == w3)