Пример #1
0
 def test_pyramid_invariant(self):
     a = np.random.rand(n, 3)
     f = Rotation._get_pyramid_order(a, 'forward')
     b = Rotation._get_pyramid_order(a, 'backward')
     assert np.all(
         np.take_along_axis(np.take_along_axis(a, f, -1), b, -1) == a)
Пример #2
0
 def test_pyramid_vectorization(self, direction):
     p = np.random.rand(n, 3)
     o = Rotation._get_pyramid_order(p, direction)
     for i, o_i in enumerate(o):
         assert np.all(o_i == Rotation._get_pyramid_order(p[i], direction))