for solving the linear least squares problem
. More...
#include <chebalg.hh>
Inheritance diagram for RVLUmin::ChebAlg< Scalar >:
Public Member Functions | |
ChebAlg (RVL::Vector< Scalar > &_x, LinearOp< Scalar > const &_inA, Vector< Scalar > const &_rhs, atype &_rnorm, atype &_nrnorm, atype _gamma=0.04, atype _epsilon=0.001, atype _alpha=1.1, atype _lbd_est=0.0, int _maxcount=10, ostream &_str=cout) | |
Constructor. | |
~ChebAlg () | |
void | run () |
int | getCount () const |
int | getTotalCount () const |
int | getRestartCount () const |
atype | getSpectrumBound () const |
for solving the linear least squares problem
.
This is Chebyshev iteration Algorithm as stated in Symes and Kern, Geophysical Prospecting vol. 42 pp. 565-614 1994 (see p. 578). We use variable names following Symes and Kern's notation insofar as possible.
Step 1:
Choose an inversion level , typically 0.04; Choose an error reduction factor
; Choose a 'fudge factor'
.
Step 2: Compute the Chebyshev coefficients and estimate the necessary number of iterations.
;
;
.
Define error reduction factor after step as
. Let
be the smallest
which satisfies
.
For , compute
,
Step 3: Application of the Chebyshev polynomial by recursive application of the normal operator.
a. Initialization
,
.
.
.
b. Iteration
For
,
,
,
,
.
if , replace
by
. Recompute
, and restart step b.
The final outputs are the estimated solution and the estimated normal residual
.
Structure and function: Combines ChebStep with a Terminator which displays iteration count, residual norm, and normal residual norm on output stream (constructor argument _str), and terminates if iteration count exceeds max or residual norm or normal residual norm fall below threshhold (default = 10*sqrt(macheps)).
Usage: construct ChebAlg object by supplying appropriate arguments to constructor. On return from constructor, solution vector initialized to zero, residual norm to norm of RHS, and normal residual norm to norm of image of RHS under adjoint of operator. Then call run() method. Progress of iteration written on output unit. On return from run(), solution vector stores final estimate of solution, and residual norm and normal residual norm scalars have corresponding values.
Typical Use: see functional test source.
IMPORTANT NOTE: This class is also an RVLAlg::Terminator subclass.
IMPORTANT NOTE: The solution vector and residual and normal residual scalars are external objects, for which this algorithm stores mutable references. These objects are updated by constructing a ChebAlg object, and by calling its run() method.
IMPORTANT NOTE: this version of the algorithm initializes the solution vector to zero. To accommodate nontrivial initial guess, modify the right-hand-side vector (argument _rhs) externally.
IMPORTANT NOTE: in order that this algorithm function properly for complex scalar types, a careful distinction is maintained between the main template parameter (Scalar) type and its absolute value type. All of the scalars appearing in the algorithm are actually of the latter type.
See constructor documentation for description of parameters.
Definition at line 345 of file chebalg.hh.
RVLUmin::ChebAlg< Scalar >::ChebAlg | ( | RVL::Vector< Scalar > & | _x, | |
LinearOp< Scalar > const & | _inA, | |||
Vector< Scalar > const & | _rhs, | |||
atype & | _rnorm, | |||
atype & | _nrnorm, | |||
atype | _gamma = 0.04 , |
|||
atype | _epsilon = 0.001 , |
|||
atype | _alpha = 1.1 , |
|||
atype | _lbd_est = 0.0 , |
|||
int | _maxcount = 10 , |
|||
ostream & | _str = cout | |||
) |
Constructor.
_x | - mutable reference to solution vector (external), initialized to zero vector on construction, estimated solution on return from ChebAlg::run(). | |
_inA | - const reference to LinearOp (external) defining problem | |
_rhs | - const reference to RHS or target vector (external) | |
_rnorm | - mutable reference to residual norm scalar (external), initialized to norm of RHS on construction, norm of estimated residual at solution on return from ChebAlg::run() | |
_nrnorm | - mutable reference to normal residual (least squares gradient) norm scalar (external), initialized to morm of image of RHS under adjoint of problem LinearOp on construction, norm of estimated normal residual at solution on return from ChebAlg::run() | |
_gamma | - inversion level for Chebyshev | |
_epsilon | - stopping threshold for normal residual norm | |
_alpha | - 'fudge factor' | |
_maxcount | - max number of iterations permitted, default value = 10 |
_str | - output stream |
Definition at line 389 of file chebalg.hh.
RVLUmin::ChebAlg< Scalar >::~ChebAlg | ( | ) |
Definition at line 441 of file chebalg.hh.
void RVLUmin::ChebAlg< Scalar >::run | ( | ) | [virtual] |
Implements RVLAlg::Algorithm.
Definition at line 443 of file chebalg.hh.
References RVLAlg::CountTerminator::getCount(), RVLAlg::VectorCountingThresholdIterationTable< Scalar >::init(), and RVLAlg::LoopAlg::run().
int RVLUmin::ChebAlg< Scalar >::getCount | ( | ) | const |
Definition at line 476 of file chebalg.hh.
int RVLUmin::ChebAlg< Scalar >::getTotalCount | ( | ) | const |
Definition at line 477 of file chebalg.hh.
int RVLUmin::ChebAlg< Scalar >::getRestartCount | ( | ) | const |
Definition at line 478 of file chebalg.hh.
atype RVLUmin::ChebAlg< Scalar >::getSpectrumBound | ( | ) | const |
Definition at line 479 of file chebalg.hh.