Quadratic form functor: f(x) = x^T A x + b^T x + c. Commonly used for testing optimization algorithms.
More...
#include <MathUtils_FunctorVector.hxx>
Quadratic form functor: f(x) = x^T A x + b^T x + c. Commonly used for testing optimization algorithms.
Usage:
A(1,1) = 2.0; A(1,2) = 0.0;
A(2,1) = 0.0; A(2,2) = 2.0;
b(1) = -4.0;
b(2) = -4.0;
GLboolean GLboolean GLboolean b
Definition OpenGl_glext.h:1455
This class implements the real matrix abstract data type. Matrixes can have an arbitrary range which ...
Definition math_Matrix.hxx:75
math_VectorBase< double > math_Vector
Definition math_Recipes.hxx:25
◆ QuadraticForm()
Constructor from matrix, vector, and constant.
- Parameters
-
| theA | quadratic coefficient matrix (must be square) |
| theB | linear coefficient vector |
| theC | constant term |
◆ Gradient()
Evaluates the gradient: g = 2*A*x + b.
- Parameters
-
| [in] | theX | input vector |
| [out] | theG | gradient vector |
- Returns
- true if evaluation succeeded
◆ Value()
| bool MathUtils::QuadraticForm::Value |
( |
const math_Vector & | theX, |
|
|
double & | theY ) const |
|
inline |
Evaluates the quadratic form f(x) = x^T A x + b^T x + c.
- Parameters
-
| [in] | theX | input vector |
| [out] | theY | function value |
- Returns
- true if evaluation succeeded
◆ Values()
Evaluates both value and gradient.
- Parameters
-
| [in] | theX | input vector |
| [out] | theY | function value |
| [out] | theG | gradient vector |
- Returns
- true if evaluation succeeded
The documentation for this class was generated from the following file: