Example #1
0
 def checkSolve(f, a, x0):
     sol = solveByMinimize(f, a, x0, length=length)
     self.assertAlmostEqual(la.norm(f(sol)[0] - a), 0.0)
Example #2
0
 def checkSolve(f, a, x0):
     sol = solveByMinimize(f, a, x0, length=length)
     self.assertAlmostEqual(la.norm(f(sol)[0] - a), 0.0)
Example #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)