#include <cgnealg.hh>
Public Member Functions | |
CGNEAlg< Scalar > * | build (Vector< Scalar > &x, LinearOp< Scalar > const &A, Vector< Scalar > const &d, atype &rnorm, atype &nrnorm, ostream &str) const |
build method - see TRGNAlg specs | |
CGNEAlg< Scalar > * | build (Vector< Scalar > &x, LinearOp< Scalar > const &A, LinearOp< Scalar > const &M, Vector< Scalar > const &d, atype &rnorm, atype &nrnorm, ostream &str) const |
void | assign (atype _rtol, atype _nrtol, atype _Delta, int _maxcount, bool _verbose) |
post-construction initialization | |
void | assign (Table const &t) |
parameter table overload | |
void | assign (CGNEPolicyData< Scalar > const &s) |
data struct overload | |
CGNEPolicy (atype _rtol=numeric_limits< atype >::max(), atype _nrtol=numeric_limits< atype >::max(), atype _Delta=numeric_limits< atype >::max(), int _maxcount=0, bool _verbose=true) | |
main constructor - acts as default. | |
CGNEPolicy (CGNEPolicy< Scalar > const &p) | |
Public Attributes | |
atype | Delta |
only Delta need be changed repeatedly, as opposed to set post-construction. |
rtol = residual threshhold for convergence nrtol = normal residual (LS gradient) tolerance for convergence Delta = trust radius - truncate iteration when reached maxcount = max number of iterations permitted
Default values set to cause immediate return from CGNEAlg::run.
Other attributes are arguments of build method.
Conforms to specifications described in TRGNAlg docs.
Usage: use as policy type, i.e. class name as template parameter to TRGNAlg constructor. After construction of TRGNAlg, which IS a CGNEPolicy by inheritance, call the assign method on it to set rtol, nrtol, and maxcount, BEFORE calling TRGNAlg::run() - else you will get immediate termination, as intended.
Definition at line 703 of file cgnealg.hh.
RVLUmin::CGNEPolicy< Scalar >::CGNEPolicy | ( | atype | _rtol = numeric_limits<atype>::max() , |
|
atype | _nrtol = numeric_limits<atype>::max() , |
|||
atype | _Delta = numeric_limits<atype>::max() , |
|||
int | _maxcount = 0 , |
|||
bool | _verbose = true | |||
) |
main constructor - acts as default.
Default values of parameters set to result in immediate return, no iteration. Note that policy design requires that default construction must be valid, and all run-time instance data be initiated post-construction, in this case by the assign function, to be called by drivers of user classes (subclassed from this and with this as template param).
Definition at line 820 of file cgnealg.hh.
RVLUmin::CGNEPolicy< Scalar >::CGNEPolicy | ( | CGNEPolicy< Scalar > const & | p | ) |
Definition at line 827 of file cgnealg.hh.
CGNEAlg<Scalar>* RVLUmin::CGNEPolicy< Scalar >::build | ( | Vector< Scalar > & | x, | |
LinearOp< Scalar > const & | A, | |||
Vector< Scalar > const & | d, | |||
atype & | rnorm, | |||
atype & | nrnorm, | |||
ostream & | str | |||
) | const |
build method - see TRGNAlg specs
x | - solution vector, initialize to zero on input, estimated solution on output | |
A | - Linear Operator of least squares problem | |
d | - data vector of least squares problem | |
rnorm | - reference to residual norm scalar, norm of RHS on input, of residual on output | |
nrnorm | - reference to normal residual norm scalar, norm of normal residual (least squares gradient) on input, updated to estimated solution on output | |
str | - verbose output stream |
Definition at line 727 of file cgnealg.hh.
References RVLUmin::CGNEPolicy< Scalar >::Delta, RVL::Writeable::write(), and RVL::Vector< Scalar >::write().
CGNEAlg<Scalar>* RVLUmin::CGNEPolicy< Scalar >::build | ( | Vector< Scalar > & | x, | |
LinearOp< Scalar > const & | A, | |||
LinearOp< Scalar > const & | M, | |||
Vector< Scalar > const & | d, | |||
atype & | rnorm, | |||
atype & | nrnorm, | |||
ostream & | str | |||
) | const |
Definition at line 753 of file cgnealg.hh.
References RVLUmin::CGNEPolicy< Scalar >::Delta, RVL::Writeable::write(), and RVL::Vector< Scalar >::write().
void RVLUmin::CGNEPolicy< Scalar >::assign | ( | atype | _rtol, | |
atype | _nrtol, | |||
atype | _Delta, | |||
int | _maxcount, | |||
bool | _verbose | |||
) |
post-construction initialization
_rtol | - residual norm stopping threshhold | |
_nrtol | - normal residual (LS gradient) norm stopping threshhold | |
_maxcount | - max number of permitted iterations |
Definition at line 784 of file cgnealg.hh.
References RVLUmin::CGNEPolicy< Scalar >::Delta.
void RVLUmin::CGNEPolicy< Scalar >::assign | ( | Table const & | t | ) |
parameter table overload
Definition at line 789 of file cgnealg.hh.
References RVLUmin::CGNEPolicy< Scalar >::Delta.
void RVLUmin::CGNEPolicy< Scalar >::assign | ( | CGNEPolicyData< Scalar > const & | s | ) |
data struct overload
Definition at line 798 of file cgnealg.hh.
References RVLUmin::CGNEPolicyData< Scalar >::Delta, RVLUmin::CGNEPolicy< Scalar >::Delta, RVLUmin::CGNEPolicyData< Scalar >::maxcount, RVLUmin::CGNEPolicyData< Scalar >::nrtol, RVLUmin::CGNEPolicyData< Scalar >::rtol, and RVLUmin::CGNEPolicyData< Scalar >::verbose.
atype RVLUmin::CGNEPolicy< Scalar >::Delta [mutable] |
only Delta need be changed repeatedly, as opposed to set post-construction.
Simplest way to do this - make it public
Definition at line 810 of file cgnealg.hh.
Referenced by RVLUmin::CGNEPolicy< Scalar >::assign(), and RVLUmin::CGNEPolicy< Scalar >::build().