Beispiel #1
0
 def checkSolve(f, a, x0):
     sol = solveByMinimize(f, a, x0, length=length)
     self.assertAlmostEqual(la.norm(f(sol)[0] - a), 0.0)
Beispiel #2
0
 def checkSolve(f, a, x0):
     sol = solveByMinimize(f, a, x0, length=length)
     self.assertAlmostEqual(la.norm(f(sol)[0] - a), 0.0)
Beispiel #3
0
 def inv(self, y, length = -100):
     # (FIXME : could consider different starting points (e.g. 0.0))
     def F(x):
         return self(x), np.array([self.deriv(x)])
     return solveByMinimize(F, y, y, length = length)