RVLUmin::CGNEPolicy< Scalar > Class Template Reference

policy class for creation of CGNEAlg in trust region solver and any other algorithm needing a least squares solver component - build method creates CGNEAlg with these attributes: More...

#include <cgnealg.hh>

List of all members.

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.


Detailed Description

template<typename Scalar>
class RVLUmin::CGNEPolicy< Scalar >

policy class for creation of CGNEAlg in trust region solver and any other algorithm needing a least squares solver component - build method creates CGNEAlg with these attributes:

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.


Constructor & Destructor Documentation

template<typename Scalar>
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.

template<typename Scalar>
RVLUmin::CGNEPolicy< Scalar >::CGNEPolicy ( CGNEPolicy< Scalar > const &  p  ) 

Definition at line 827 of file cgnealg.hh.


Member Function Documentation

template<typename Scalar>
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

Parameters:
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().

template<typename Scalar>
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().

template<typename Scalar>
void RVLUmin::CGNEPolicy< Scalar >::assign ( atype  _rtol,
atype  _nrtol,
atype  _Delta,
int  _maxcount,
bool  _verbose 
)

post-construction initialization

Parameters:
_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.

template<typename Scalar>
void RVLUmin::CGNEPolicy< Scalar >::assign ( Table const &  t  ) 

parameter table overload

Definition at line 789 of file cgnealg.hh.

References RVLUmin::CGNEPolicy< Scalar >::Delta.

template<typename Scalar>
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.


Member Data Documentation

template<typename Scalar>
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().


The documentation for this class was generated from the following file:
Generated on 5 Jan 2017 for RvlUmin by  doxygen 1.4.7