CCCoreLib 31 May 2022
CloudCompare Core algorithms
|
A class to perform a conjugate gradient optimization. More...
#include <ConjugateGradient.h>
Public Member Functions | |
ConjugateGradient () | |
Default constructor. | |
virtual | ~ConjugateGradient ()=default |
Default destructor. | |
SquareMatrixTpl< Scalar > & | A () |
Returns A matrix. | |
Scalar * | b () |
Returns b vector. | |
void | initConjugateGradient (const Scalar *X0) |
Initializes the conjugate gradient. More... | |
Scalar | iterConjugateGradient (Scalar *Xn) |
Iterates the conjugate gradient. More... | |
Protected Attributes | |
Scalar | cg_Gn [N] |
Residuals vector. | |
Scalar | cg_Hn [N] |
'Hn' vector More... | |
Scalar | cg_u [N] |
'u' vector More... | |
Scalar | cg_b [N] |
'b' vector More... | |
SquareMatrixTpl< Scalar > | cg_A |
'A' matrix More... | |
A class to perform a conjugate gradient optimization.
Inspired from the "Numerical Recipes". Template parameter 'N' is the dimension of the linear system. Lets "A*Xn=b" be the system to optimize (at iteration n). First the user must init the A matrix (N*N) and b vector (N*1). Then the solver is initialized with X0 (see initConjugateGradient). And the conjugate gradient is iterated with iterConjugateGradient.
|
inline |
Initializes the conjugate gradient.
X0 | the initial state (size N) |
|
inline |
Iterates the conjugate gradient.
Xn will be automatically updated to Xn+1 on output.
Xn | the current estimation of Xn (size N) |
|
protected |
'A' matrix
Equation solved: "A.X=b"
|
protected |
'b' vector
Equation solved: "A.X=b"
|
protected |
'Hn' vector
Intermediary computation result
|
protected |
'u' vector
Intermediary computation result