Exemplo n.º 1
0
 def test_squared_length_batch(self):
     result = vector4.squared_length([
         [1.,1.,1.,1.],
         [-1.,-1.,-1.,1.],
         [0.,2.,7.,1.],
     ])
     expected = [
         4.,
         4.,
         54.,
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Exemplo n.º 2
0
 def test_squared_length_batch(self):
     result = vector4.squared_length([
         [1., 1., 1., 1.],
         [-1., -1., -1., 1.],
         [0., 2., 7., 1.],
     ])
     expected = [
         4.,
         4.,
         54.,
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Exemplo n.º 3
0
 def test_squared_length_single_vector(self):
     result = vector4.squared_length([1.,1.,1.,1.])
     np.testing.assert_almost_equal(result, 4., decimal=5)
Exemplo n.º 4
0
 def test_squared_length_single_vector(self):
     result = vector4.squared_length([1., 1., 1., 1.])
     np.testing.assert_almost_equal(result, 4., decimal=5)