Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)