コード例 #1
0
 def test_transform_concat(self):
     test_array = array([
         [1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1],
     ])
     assert_array_equal(
         LTFArray.generate_concatenated_transform(
             transform_1=LTFArray.transform_1_n_bent,
             nn=6,
             transform_2=LTFArray.transform_id,
         )(test_array, k=3), [
             [
                 [1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1],
                 [1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1],
                 [1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1],
             ],
         ])
コード例 #2
0
 def test_generate_concatenated_transform(self):
     """
     This method tests the concatenation of 1 to n bent and identity transformation with predefined input and output.
     """
     test_array = array([
         [1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1],
     ],
                        dtype=tools.BIT_TYPE)
     assert_array_equal(
         LTFArray.generate_concatenated_transform(
             transform_1=LTFArray.transform_id,
             bit_number_transform_1=6,
             transform_2=LTFArray.transform_atf,
         )(test_array, k=3), [
             [
                 [1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1],
                 [1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1],
                 [1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1],
             ],
         ])