LSMR solves Ax = b or min ||Ax - b|| with or without damping, using the iterative algorithm of David Fong and Michael Saunders: http://www.stanford.edu/group/SOL/software/lsmr.html.
More...
|
void | _sym_ortho (double a, double b, double &c, double &s, double &r) const |
| Routine of rotation from scipy. More...
|
|
|
double | m_damp |
| Damping factor for regularized least-squares. More...
|
|
double | m_atol |
| Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol. More...
|
|
double | m_btol |
| Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol. More...
|
|
double | m_conlim |
| LSMR terminates if an estimate of cond(A) exceeds conlim. More...
|
|
size_t | m_maxiter |
| LSMR terminates if the number of iterations reaches maxiter. More...
|
|
ElemUtils::Formatter * | m_output |
| Pointer to the stream where to write the output. More...
|
|
unsigned int | m_istop |
| Reason for stopping the iterations. More...
|
|
size_t | m_itn |
| Number of iterations. More...
|
|
double | m_normr |
|
double | m_normar |
|
double | m_normA |
|
double | m_condA |
|
double | m_normx |
|
std::string | m_stopMessage |
| Reason for stopping the iterations. More...
|
|
std::vector< std::string > | m_msg |
|
std::string | m_hdg1 |
|
std::string | m_hdg2 |
|
unsigned int | m_pfreq |
|
LSMR solves Ax = b or min ||Ax - b|| with or without damping, using the iterative algorithm of David Fong and Michael Saunders: http://www.stanford.edu/group/SOL/software/lsmr.html.
Adapted for C++ from the scipy implementation: https://github.com/scipy/scipy/blob/v0.18.1/scipy/sparse/linalg/isolve/lsmr.py
◆ LSMRSolver()
NumA::LSMRSolver::LSMRSolver |
( |
double |
damp = 0. , |
|
|
double |
atol = 1.e-6 , |
|
|
double |
btol = 1.e-6 , |
|
|
double |
conlim = 1.e8 , |
|
|
size_t |
maxiter = 0 , |
|
|
ElemUtils::Formatter * |
output = 0 |
|
) |
| |
Constructor.
- Parameters
-
damp | Damping factor for regularized least-squares. |
atol | Stopping tolerance. |
btol | Stopping tolerance. |
conlim | LSMR terminates if an estimate of cond(A) exceeds conlim. |
maxiter | LSMR terminates if the number of iterations reaches maxiter. |
output | Pointer to the stream where to write the output. |
◆ ~LSMRSolver()
NumA::LSMRSolver::~LSMRSolver |
( |
| ) |
|
|
virtual |
◆ _sym_ortho()
void NumA::LSMRSolver::_sym_ortho |
( |
double |
a, |
|
|
double |
b, |
|
|
double & |
c, |
|
|
double & |
s, |
|
|
double & |
r |
|
) |
| const |
|
private |
Routine of rotation from scipy.
- Parameters
-
◆ getConditionNumber()
double NumA::LSMRSolver::getConditionNumber |
( |
| ) |
const |
◆ getConditionNumberLimit()
double NumA::LSMRSolver::getConditionNumberLimit |
( |
| ) |
const |
LSMR terminates if an estimate of cond(A)
exceeds conlim.
◆ getDamping()
double NumA::LSMRSolver::getDamping |
( |
| ) |
const |
Damping factor for regularized least-squares.
◆ getMaximumIerations()
size_t NumA::LSMRSolver::getMaximumIerations |
( |
| ) |
const |
LSMR terminates if the number of iterations reaches maxiter.
◆ getNormA()
double NumA::LSMRSolver::getNormA |
( |
| ) |
const |
◆ getNormAr()
double NumA::LSMRSolver::getNormAr |
( |
| ) |
const |
◆ getNormr()
double NumA::LSMRSolver::getNormr |
( |
| ) |
const |
◆ getNormX()
double NumA::LSMRSolver::getNormX |
( |
| ) |
const |
◆ getNumberIterations()
size_t NumA::LSMRSolver::getNumberIterations |
( |
| ) |
const |
◆ getOutput()
ElemUtils::Formatter & NumA::LSMRSolver::getOutput |
( |
| ) |
const |
- Returns
- Reference to the stream where the output is written.
◆ getStoppingCase()
unsigned int NumA::LSMRSolver::getStoppingCase |
( |
| ) |
const |
Reason for stopping the iterations.
◆ getStoppingMessage()
const std::string & NumA::LSMRSolver::getStoppingMessage |
( |
| ) |
const |
Reason for stopping the iterations.
◆ getToleranceA()
double NumA::LSMRSolver::getToleranceA |
( |
| ) |
const |
Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol.
◆ getToleranceB()
double NumA::LSMRSolver::getToleranceB |
( |
| ) |
const |
Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol.
◆ setConditionNumberLimit()
void NumA::LSMRSolver::setConditionNumberLimit |
( |
double |
conlim | ) |
|
LSMR terminates if an estimate of cond(A)
exceeds conlim.
◆ setDamping()
void NumA::LSMRSolver::setDamping |
( |
double |
damp | ) |
|
Damping factor for regularized least-squares.
◆ setMaximumIerations()
void NumA::LSMRSolver::setMaximumIerations |
( |
size_t |
maxiter | ) |
|
LSMR terminates if the number of iterations reaches maxiter.
◆ setOutput()
void NumA::LSMRSolver::setOutput |
( |
ElemUtils::Formatter & |
output | ) |
|
- Parameters
-
output | Reference to the stream where the output is written. |
◆ setToleranceA()
void NumA::LSMRSolver::setToleranceA |
( |
double |
atol | ) |
|
Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol.
◆ setToleranceB()
void NumA::LSMRSolver::setToleranceB |
( |
double |
btol | ) |
|
Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol.
◆ solve()
Solves the linear system \( A X = B \) and returns \( X \) in the least-squares sense.
Iterative method for large sparse matrices.
- Parameters
-
- Returns
- VectorD Solution X.
◆ m_atol
double NumA::LSMRSolver::m_atol |
|
private |
Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol.
◆ m_btol
double NumA::LSMRSolver::m_btol |
|
private |
Stopping tolerance. LSMR continues iterations until a certain backward error estimate is smaller than some quantity depending on atol and btol.
◆ m_condA
double NumA::LSMRSolver::m_condA |
|
private |
◆ m_conlim
double NumA::LSMRSolver::m_conlim |
|
private |
LSMR terminates if an estimate of cond(A)
exceeds conlim.
◆ m_damp
double NumA::LSMRSolver::m_damp |
|
private |
Damping factor for regularized least-squares.
◆ m_hdg1
std::string NumA::LSMRSolver::m_hdg1 |
|
private |
◆ m_hdg2
std::string NumA::LSMRSolver::m_hdg2 |
|
private |
◆ m_istop
unsigned int NumA::LSMRSolver::m_istop |
|
private |
Reason for stopping the iterations.
◆ m_itn
size_t NumA::LSMRSolver::m_itn |
|
private |
◆ m_maxiter
size_t NumA::LSMRSolver::m_maxiter |
|
private |
LSMR terminates if the number of iterations reaches maxiter.
◆ m_msg
std::vector<std::string> NumA::LSMRSolver::m_msg |
|
private |
◆ m_normA
double NumA::LSMRSolver::m_normA |
|
private |
◆ m_normar
double NumA::LSMRSolver::m_normar |
|
private |
◆ m_normr
double NumA::LSMRSolver::m_normr |
|
private |
◆ m_normx
double NumA::LSMRSolver::m_normx |
|
private |
◆ m_output
ElemUtils::Formatter* NumA::LSMRSolver::m_output |
|
private |
Pointer to the stream where to write the output.
◆ m_pfreq
unsigned int NumA::LSMRSolver::m_pfreq |
|
private |
◆ m_stopMessage
std::string NumA::LSMRSolver::m_stopMessage |
|
private |
Reason for stopping the iterations.
The documentation for this class was generated from the following files: