def test_left_jacobian_of_exponential(self): tau = np.random.uniform(-np.pi, np.pi) R, Jr = SO2.Exp(tau, Jr=True) _, Jl = SO2.Exp(tau, Jl=True) Ad_R = Jl * (1.0 / Jr) self.assertEqual(1.0, Jl) self.assertEqual(Ad_R, R.Adj)
def testAdjoint(self): for i in range(100): theta = np.random.uniform(-np.pi, np.pi) R = SO2.fromAngle(theta) delta = np.random.uniform(-np.pi, np.pi) Adj_R = R.Adj Rf = R * SO2.Exp(delta) Rf_true = SO2.Exp(Adj_R * delta) * R np.testing.assert_allclose(Rf_true.R, Rf.R)
def test_right_jacobian_of_boxplusr(self): for i in range(100): R = SO2.random() theta = np.random.uniform(-np.pi, np.pi) R2, Jr = R.boxplusr(theta, Jr=1) _, Jr_true = SO2.Exp(theta, Jr=1) np.testing.assert_allclose(Jr_true, Jr)
def test_left_jacobian_of_logarithm(self): R = SO2.random() logR, Jl_inv = SO2.Log(R, Jl=True) _, Jl = SO2.Exp(logR, Jl=True) self.assertEqual(1/Jl, Jl_inv)
def test_right_jacobian_of_logarithm(self): R = SO2.random() logR, Jr_inv = SO2.Log(R, Jr=True) _, Jr = SO2.Exp(logR, Jr=True) self.assertEqual(1/Jr, Jr_inv)
def test_right_jacobian_of_exponential(self): tau = np.random.uniform(-np.pi, np.pi) R, Jr = SO2.Exp(tau, Jr=True) self.assertEqual(1.0, Jr)