def testGoldenNumber2d(self): A, B, R, Q = np.eye(2), np.eye(2), np.eye(2), np.eye(2) gold_diag = np.eye(2) * (1 + np.sqrt(5)) / 2. val = dare(A, B, R, Q) self.assertTrue(np.allclose(val, gold_diag))
def testGoldenNumberfloat(self): val = dare(self.A, self.B, self.R, self.Q) gold_ratio = (1 + np.sqrt(5)) / 2. self.assertTrue(abs(val - gold_ratio) < 1e-12)
def testGoldenNumberfloat(self): val = dare(self.A, self.B, self.R, self.Q) gold_ratio = (1 + np.sqrt(5)) / 2. self.assertTrue( abs(val - gold_ratio) < 1e-12)