xerus
a general purpose tensor library
xerus::GeometricCGVariant Class Reference

Wrapper class for all geometric (ie. Riemannian) CG variants. More...

#include <cg.h>

Public Member Functions

 GeometricCGVariant (size_t _numSteps, value_t _convergenceEpsilon, bool _symPosOp, TTRetractionI _retraction, TTVectorTransport _vectorTransport)
 fully defining constructor. alternatively CGVariant can be created by copying a predefined variant and modifying it More...
 
 GeometricCGVariant (TTRetractionI _retraction, TTVectorTransport _vectorTransport)
 definition using only the retraction. In the following an operator() including either convergenceEpsilon or numSteps must be called or the algorithm will never terminate More...
 
double operator() (const TTOperator &_A, TTTensor &_x, const TTTensor &_b, value_t _convergenceEpsilon, PerformanceData &_perfData=NoPerfData) const
 
double operator() (const TTOperator &_A, TTTensor &_x, const TTTensor &_b, size_t _numSteps, PerformanceData &_perfData=NoPerfData) const
 
double operator() (const TTOperator &_A, TTTensor &_x, const TTTensor &_b, PerformanceData &_perfData=NoPerfData) const
 
double operator() (TTTensor &_x, const TTTensor &_b, value_t _convergenceEpsilon, PerformanceData &_perfData=NoPerfData) const
 
double operator() (TTTensor &_x, const TTTensor &_b, size_t _numSteps, PerformanceData &_perfData=NoPerfData) const
 
double operator() (TTTensor &_x, const TTTensor &_b, PerformanceData &_perfData=NoPerfData) const
 

Public Attributes

bool assumeSymmetricPositiveDefiniteOperator
 calculates the gradient as b-Ax instead of A^T(b-Ax) More...
 
value_t convergenceEpsilon
 default value for the change in the residual at which the algorithm assumes it is converged More...
 
size_t numSteps
 maximum number of steps to perform. set to 0 for infinite More...
 
TTRetractionI retraction
 the retraction type I to project from point + tangent vector to a new point on the manifold More...
 
TTVectorTransport vectorTransport
 the vector transport from old tangent space to new one More...
 

Protected Member Functions

double solve (const TTOperator *_Ap, TTTensor &_x, const TTTensor &_b, size_t _numSteps, value_t _convergenceEpsilon, PerformanceData &_perfData=NoPerfData) const
 

Detailed Description

Wrapper class for all geometric (ie. Riemannian) CG variants.

Note
only implemented for TTTensors at the moment.

By creating a new object of this class and modifying the member variables, the behaviour of the solver can be modified.

cf. Boumal, Absil. doi: 10.1016/j.laa.2015.02.027 cf. Hager, Zhang. https://www.math.lsu.edu/~hozhang/papers/cgsurvey.pdf for the beta rules

Definition at line 41 of file cg.h.

Constructor & Destructor Documentation

◆ GeometricCGVariant() [1/2]

xerus::GeometricCGVariant::GeometricCGVariant ( size_t  _numSteps,
value_t  _convergenceEpsilon,
bool  _symPosOp,
TTRetractionI  _retraction,
TTVectorTransport  _vectorTransport 
)
inline

fully defining constructor. alternatively CGVariant can be created by copying a predefined variant and modifying it

Definition at line 56 of file cg.h.

◆ GeometricCGVariant() [2/2]

xerus::GeometricCGVariant::GeometricCGVariant ( TTRetractionI  _retraction,
TTVectorTransport  _vectorTransport 
)
inline

definition using only the retraction. In the following an operator() including either convergenceEpsilon or numSteps must be called or the algorithm will never terminate

Definition at line 65 of file cg.h.

Member Function Documentation

◆ operator()() [1/6]

double xerus::GeometricCGVariant::operator() ( const TTOperator _A,
TTTensor _x,
const TTTensor _b,
value_t  _convergenceEpsilon,
PerformanceData _perfData = NoPerfData 
) const
inline

call to solve \( A\cdot x = b\) for \( x \) (in a least-squares sense)

Parameters
_Aoperator to solve for
[in,out]_xin: initial guess, out: solution as found by the algorithm
_bright-hand side of the equation to be solved
_convergenceEpsilonminimum change in residual / energy under which the algorithm terminates
_perfDatavector of performance data (residuals after every microiteration)
Returns
the residual \(|Ax-b|\) of the final _x

Definition at line 79 of file cg.h.

◆ operator()() [2/6]

double xerus::GeometricCGVariant::operator() ( const TTOperator _A,
TTTensor _x,
const TTTensor _b,
size_t  _numSteps,
PerformanceData _perfData = NoPerfData 
) const
inline

call to solve \( A\cdot x = b\) for \( x \) (in a least-squares sense)

Parameters
_Aoperator to solve for
[in,out]_xin: initial guess, out: solution as found by the algorithm
_bright-hand side of the equation to be solved
_numHalfSweepsmaximum number of half-sweeps to perform
_perfDatavector of performance data (residuals after every microiteration)
Returns
the residual \(|Ax-b|\) of the final _x

Definition at line 92 of file cg.h.

◆ operator()() [3/6]

double xerus::GeometricCGVariant::operator() ( const TTOperator _A,
TTTensor _x,
const TTTensor _b,
PerformanceData _perfData = NoPerfData 
) const
inline

call to solve \( A\cdot x = b\) for \( x \) (in a least-squares sense)

Parameters
_Aoperator to solve for
[in,out]_xin: initial guess, out: solution as found by the algorithm
_bright-hand side of the equation to be solved
_perfDatavector of performance data (residuals after every microiteration)
Returns
the residual \(|Ax-b|\) of the final _x

Definition at line 104 of file cg.h.

◆ operator()() [4/6]

double xerus::GeometricCGVariant::operator() ( TTTensor _x,
const TTTensor _b,
value_t  _convergenceEpsilon,
PerformanceData _perfData = NoPerfData 
) const
inline

call to minimze \( \|x - b\|^2 \) for \( x \)

Parameters
[in,out]_xin: initial guess, out: solution as found by the algorithm
_bright-hand side of the equation to be solved
_convergenceEpsilonminimum change in residual / energy under which the algorithm terminates
_perfDatavector of performance data (residuals after every microiteration)
Returns
the residual \(|x-b|\) of the final _x

Definition at line 116 of file cg.h.

◆ operator()() [5/6]

double xerus::GeometricCGVariant::operator() ( TTTensor _x,
const TTTensor _b,
size_t  _numSteps,
PerformanceData _perfData = NoPerfData 
) const
inline

call to minimze \( \|x - b\|^2 \) for \( x \)

Parameters
[in,out]_xin: initial guess, out: solution as found by the algorithm
_bright-hand side of the equation to be solved
_numHalfSweepsmaximum number of half-sweeps to perform
_perfDatavector of performance data (residuals after every microiteration)
Returns
the residual \(|x-b|\) of the final _x

Definition at line 128 of file cg.h.

◆ operator()() [6/6]

double xerus::GeometricCGVariant::operator() ( TTTensor _x,
const TTTensor _b,
PerformanceData _perfData = NoPerfData 
) const
inline

Definition at line 132 of file cg.h.

◆ solve()

value_t xerus::GeometricCGVariant::solve ( const TTOperator _Ap,
TTTensor _x,
const TTTensor _b,
size_t  _numSteps,
value_t  _convergenceEpsilon,
PerformanceData _perfData = NoPerfData 
) const
protected

Definition at line 38 of file cg.cpp.

Member Data Documentation

◆ assumeSymmetricPositiveDefiniteOperator

bool xerus::GeometricCGVariant::assumeSymmetricPositiveDefiniteOperator

calculates the gradient as b-Ax instead of A^T(b-Ax)

Definition at line 48 of file cg.h.

◆ convergenceEpsilon

value_t xerus::GeometricCGVariant::convergenceEpsilon

default value for the change in the residual at which the algorithm assumes it is converged

Definition at line 47 of file cg.h.

◆ numSteps

size_t xerus::GeometricCGVariant::numSteps

maximum number of steps to perform. set to 0 for infinite

Definition at line 46 of file cg.h.

◆ retraction

TTRetractionI xerus::GeometricCGVariant::retraction

the retraction type I to project from point + tangent vector to a new point on the manifold

Definition at line 50 of file cg.h.

◆ vectorTransport

TTVectorTransport xerus::GeometricCGVariant::vectorTransport

the vector transport from old tangent space to new one

Definition at line 51 of file cg.h.


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