Esempio n. 1
0
 def test_combine_ip_mod2(self):
     """This function tests the inner product mod 2 combiner function with two pairs of input and output."""
     assert_array_equal(
         LTFArray.combiner_ip_mod2(
             array([
                 [1, 1, -3, 1],
                 [-1, -1, -1, 1],
                 [-2, -2, 2, 1]
             ])
         ),
         [
             1,
             -1,
             -4
         ]
     )
     assert_array_equal(
         LTFArray.combiner_ip_mod2(
             array([
                 [1, 1, 1, 1, 1, 1],
                 [-1, -1, -1, 1, -1, -1],
                 [-2, -2, 2, 1, 10, 10]
             ])
         ),
         [
             1,
             1,
             -40
         ]
     )
Esempio n. 2
0
 def test_combine_ip_mod2(self):
     assert_array_equal(
         LTFArray.combiner_ip_mod2(
             array([[1, 1, -3, 1], [-1, -1, -1, 1], [-2, -2, 2, 1]])),
         [1, -1, -4])
     assert_array_equal(
         LTFArray.combiner_ip_mod2(
             array([[1, 1, 1, 1, 1, 1], [-1, -1, -1, 1, -1, -1],
                    [-2, -2, 2, 1, 10, 10]])), [1, 1, -40])