RVLUmin::LSQRPolicy< Scalar > Class Template Reference

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

#include <lsqr.hh>

List of all members.

Public Member Functions

LSQRAlg< 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
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 (LSQRPolicyData< Scalar > const &s)
 data struct overload
 LSQRPolicy (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.
 LSQRPolicy (LSQRPolicy< 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::LSQRPolicy< Scalar >

policy class for creation of LSQRAlg in trust region solver and any other algorithm needing a least squares solver component - build method creates LSQRAlg 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 LSQRAlg::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 LSQRPolicy 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 465 of file lsqr.hh.


Constructor & Destructor Documentation

template<typename Scalar>
RVLUmin::LSQRPolicy< Scalar >::LSQRPolicy ( 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 542 of file lsqr.hh.

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

Definition at line 549 of file lsqr.hh.


Member Function Documentation

template<typename Scalar>
LSQRAlg<Scalar>* RVLUmin::LSQRPolicy< 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 489 of file lsqr.hh.

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

template<typename Scalar>
void RVLUmin::LSQRPolicy< 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 506 of file lsqr.hh.

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

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

parameter table overload

Definition at line 511 of file lsqr.hh.

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

template<typename Scalar>
void RVLUmin::LSQRPolicy< Scalar >::assign ( LSQRPolicyData< Scalar > const &  s  ) 

data struct overload

Definition at line 520 of file lsqr.hh.

References RVLUmin::LSQRPolicyData< Scalar >::Delta, RVLUmin::LSQRPolicy< Scalar >::Delta, RVLUmin::LSQRPolicyData< Scalar >::maxcount, RVLUmin::LSQRPolicyData< Scalar >::nrtol, RVLUmin::LSQRPolicyData< Scalar >::rtol, and RVLUmin::LSQRPolicyData< Scalar >::verbose.


Member Data Documentation

template<typename Scalar>
atype RVLUmin::LSQRPolicy< 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 532 of file lsqr.hh.

Referenced by RVLUmin::LSQRPolicy< Scalar >::assign(), and RVLUmin::LSQRPolicy< 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