Example #1
0
 def test_set_length_batch_vector(self):
     result = vector4.set_length([
         [1.,1.,1.,1.],
         [-1.,-1.,-1.,1.],
         [0.,2.,7.,1.],
         ], 2.0)
     expected = [
         [1.,1.,1.,1.],
         [-1.,-1.,-1.,1.],
         [0., 0.54433105, 1.90515869, 0.27216553],
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Example #2
0
 def test_set_length_batch_vector(self):
     result = vector4.set_length([
         [1., 1., 1., 1.],
         [-1., -1., -1., 1.],
         [0., 2., 7., 1.],
     ], 2.0)
     expected = [
         [1., 1., 1., 1.],
         [-1., -1., -1., 1.],
         [0., 0.54433105, 1.90515869, 0.27216553],
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Example #3
0
 def test_set_length(self):
     result = vector4.set_length([1.,1.,1.,1.],3.)
     expected = [1.5,1.5,1.5,1.5]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Example #4
0
 def test_set_length(self):
     result = vector4.set_length([1., 1., 1., 1.], 3.)
     expected = [1.5, 1.5, 1.5, 1.5]
     np.testing.assert_almost_equal(result, expected, decimal=5)