Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
MathUtils::LinearResidual Class Reference

Linear system residual functor: f(x) = ||Ax - b||^2. Useful for solving overdetermined linear systems via optimization. More...

#include <MathUtils_FunctorVector.hxx>

Public Member Functions

 LinearResidual (const math_Matrix &theA, const math_Vector &theB)
 Constructor from matrix and right-hand side.
 
bool Value (const math_Vector &theX, double &theY) const
 Evaluates the residual ||Ax - b||^2.
 
bool Gradient (const math_Vector &theX, math_Vector &theG) const
 Evaluates the gradient: g = 2 * A^T * (Ax - b).
 
bool Values (const math_Vector &theX, double &theY, math_Vector &theG) const
 Evaluates both value and gradient.
 

Detailed Description

Linear system residual functor: f(x) = ||Ax - b||^2. Useful for solving overdetermined linear systems via optimization.

Usage:

math_Matrix A(1, 3, 1, 2); // 3x2 overdetermined system
math_Vector b(1, 3);
// ... fill A and b ...
aStart.Init(0.0);
GLboolean GLboolean GLboolean b
Definition OpenGl_glext.h:1455
Linear system residual functor: f(x) = ||Ax - b||^2. Useful for solving overdetermined linear systems...
Definition MathUtils_FunctorVector.hxx:628
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
This class implements the real matrix abstract data type. Matrixes can have an arbitrary range which ...
Definition math_Matrix.hxx:75
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

Constructor & Destructor Documentation

◆ LinearResidual()

MathUtils::LinearResidual::LinearResidual ( const math_Matrix & theA,
const math_Vector & theB )
inline

Constructor from matrix and right-hand side.

Parameters
theAcoefficient matrix (m x n)
theBright-hand side vector (m)

Member Function Documentation

◆ Gradient()

bool MathUtils::LinearResidual::Gradient ( const math_Vector & theX,
math_Vector & theG ) const
inline

Evaluates the gradient: g = 2 * A^T * (Ax - b).

Parameters
[in]theXsolution vector
[out]theGgradient 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]theXsolution vector (n)
[out]theYsquared residual norm
Returns
true (always succeeds)

◆ Values()

bool MathUtils::LinearResidual::Values ( const math_Vector & theX,
double & theY,
math_Vector & theG ) const
inline

Evaluates both value and gradient.

Parameters
[in]theXsolution vector
[out]theYsquared residual norm
[out]theGgradient vector
Returns
true (always succeeds)

The documentation for this class was generated from the following file: