def test_51e(self): logger.debug("RUNNING 5.1E") x0 = np.array([1.0, 0]) maxit = 8 run_line_search = False result = undertest.pure_newton(x0, self.my_func, self.my_jacobian, self.merit_fn, maxit, self.ftol, run_line_search) self.assertFalse(np.all(result == self.zero) and np.all(result == self.other_zero))
def test_51f(self): logger.debug("RUNNING 5.1F") x0 = np.array([1.0, 0]) maxit = 8 run_line_search = True result = undertest.pure_newton(x0, self.my_func, self.my_jacobian, self.merit_fn, maxit, self.ftol, run_line_search) tst.assert_array_almost_equal(result, self.zero, decimal=4)
def test_51b(self): logger.debug("RUNNING 5.1B") x0 = np.array([1.0, -1]) maxit = 12 run_line_search = True result = undertest.pure_newton(x0, self.my_func, self.my_jacobian, self.merit_fn, maxit, self.ftol, run_line_search) logger.debug("5.1B yields root == {0}".format(result)) tst.assert_array_almost_equal(result, self.other_zero, decimal=4)