コード例 #1
0
ファイル: matrixtest.py プロジェクト: T-002/pycast
 def unify_test(self):
     """Test if the matrix is unified correctly."""
     rows = 3
     data = [[0], [4], [3]]
     vector = Vector(rows)
     vector.initialize(data, rowBased=True)
     exRes = [[0, 4 / 5.0, 3 / 5.0]]
     res = vector.unify()
     self.assertEqual(res.matrix, exRes)
コード例 #2
0
ファイル: matrixtest.py プロジェクト: yuvaraja2303/pycast
 def unify_test(self):
     """Test if the matrix is unified correctly."""
     rows = 3
     data = [[0], [4], [3]]
     vector = Vector(rows)
     vector.initialize(data, rowBased=True)
     exRes = [[0, 4 / 5.0, 3 / 5.0]]
     res = vector.unify()
     self.assertEqual(res.matrix, exRes)
コード例 #3
0
ファイル: matrixtest.py プロジェクト: T-002/pycast
 def norm_test(self):
     """Test the length calculation of a Vector."""
     rows = 3
     data = [[6], [4], [5]]
     vector = Vector(rows)
     vector.initialize(data, rowBased=True)
     exRes = 8.774964387392123
     res = vector.norm()
     self.assertEqual(res, exRes)
コード例 #4
0
ファイル: matrixtest.py プロジェクト: yuvaraja2303/pycast
 def norm_test(self):
     """Test the length calculation of a Vector."""
     rows = 3
     data = [[6], [4], [5]]
     vector = Vector(rows)
     vector.initialize(data, rowBased=True)
     exRes = 8.774964387392123
     res = vector.norm()
     self.assertEqual(res, exRes)