Linear system residual functor: f(x) = ||Ax - b||^2. Useful for solving overdetermined linear systems via optimization.
More...
#include <MathUtils_FunctorVector.hxx>
Linear system residual functor: f(x) = ||Ax - b||^2. Useful for solving overdetermined linear systems via optimization.
Usage:
aStart.Init(0.0);
GLboolean GLboolean GLboolean b
Definition OpenGl_glext.h:1455
LinearResidual(const math_Matrix &theA, const math_Vector &theB)
Constructor from matrix and right-hand side.
Definition MathUtils_FunctorVector.hxx:633
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
VectorResult BFGS(Function &theFunc, const math_Vector &theStartingPoint, const Config &theConfig=Config())
BFGS (Broyden-Fletcher-Goldfarb-Shanno) quasi-Newton method. One of the most effective algorithms for...
Definition MathOpt_BFGS.hxx:58
◆ LinearResidual()
Constructor from matrix and right-hand side.
- Parameters
-
| theA | coefficient matrix (m x n) |
| theB | right-hand side vector (m) |
◆ Gradient()
Evaluates the gradient: g = 2 * A^T * (Ax - b).
- Parameters
-
| [in] | theX | solution vector |
| [out] | theG | gradient vector |
- Returns
- true (always succeeds)
◆ Value()
| bool MathUtils::LinearResidual::Value |
( |
const math_Vector & | theX, |
|
|
double & | theY ) const |
|
inline |
Evaluates the residual ||Ax - b||^2.
- Parameters
-
| [in] | theX | solution vector (n) |
| [out] | theY | squared residual norm |
- Returns
- true (always succeeds)
◆ Values()
Evaluates both value and gradient.
- Parameters
-
| [in] | theX | solution vector |
| [out] | theY | squared residual norm |
| [out] | theG | gradient vector |
- Returns
- true (always succeeds)
The documentation for this class was generated from the following file: