discretize.tests.rosenbrock#
- discretize.tests.rosenbrock(x, return_g=True, return_H=True)[source]#
Evaluate the Rosenbrock function.
This is mostly used for testing Gauss-Newton schemes
- Parameters:
- x
numpy.ndarray The (x0, x1) location for the Rosenbrock test
- return_gbool,
optional If True, return the gradient at x
- return_Hbool,
optional If True, return the approximate Hessian at x
- x
- Returns:
tupleRosenbrock function evaluated at (x0, x1), the gradient at (x0, x1) if return_g = True and the Hessian at (x0, x1) if return_H = True