quad- module for representing quadratic functions
The quad module provides methods for representing and evaluating functions of the form
\[f(x)=x^{T}Ax+b^{T}x\]
where \(A \in \mathbb{R}^{n \times n}\) and \(b,x \in \mathbb{R}^{n}\).
- class quad.Function
Bases:
pybind11_object“Class for representing a function of the form
\[f(x)=x^{T}Ax+b^{T}x\]- Parameters:
matrix (NDArray) – Matrix \(A\) (dtype: float64)
vector (NDArray) – Vector \(b\) (dtype: float64)
- eval()
Evaluates the quadratic function at the given point.
- Parameters:
x (NDArray) – Point at which to evaluate the function (dtype: float64)
- grad()
Evaluates the gradient of the quadratic function at the given point.
- Parameters:
x (NDArray) – Point at which to evaluate the gradient of the function (dtype: float64)
- property matrix
Matrix \(A\)
- property vector
Vector \(b\)