コード例 #1
0
 def test_crispmatrix_triangle(self):
     m1 = CrispMatrix([[0, 1, 1], [-1, 0, 1], [-1, -1, 0]])
     m1.set_cseg = [0, 1, 2]
     triangle = numpy.array([[0, 1, 1], [0, 0, 1], [0, 0, 0]])
     self.assertEqual(m1.triangle().tolist(), triangle.tolist())
コード例 #2
0
 def test_crispmatrix_set_cseg(self):
     m1 = CrispMatrix([[0, 1, 1], [-1, 0, 1], [-1, -1, 0]])
     m1.cseg = [0, 1, 2]
     m2 = CrispMatrix([[0, 1, 1], [-1, 0, 1], [-1, -1, 0]])
     m2.set_cseg = [0, 1, 2]
     self.assertEqual(m1, m2)