discretize.tests.get_quadratic#
- discretize.tests.get_quadratic(A, b, c=0)[source]#
Return a function that evaluates the given quadratic.
Given A, b and c, this returns a function that evaluates the quadratic for a vector x. Where
, and is a constant, this function evaluates the following quadratic:for a vector
. It also optionally returns the gradient of the above equation, and its Hessian.- Parameters:
- A(
N
,N
)numpy.ndarray
A square matrix
- b(
N
)numpy.ndarray
A vector
- c
float
A constant
- A(
- Returns:
function
The callable function that returns the quadratic evaluation, and optionally its gradient, and Hessian.