Clp
1.17.8
|
This class implements LSQR. More...
#include <ClpLsqr.hpp>
Public Member Functions | |
Constructors and destructors | |
ClpLsqr () | |
Default constructor. More... | |
ClpLsqr (ClpInterior *model) | |
Constructor for use with Pdco model (note modified for pdco!!!!) More... | |
ClpLsqr (const ClpLsqr &) | |
Copy constructor. More... | |
ClpLsqr & | operator= (const ClpLsqr &rhs) |
Assignment operator. This copies the data. More... | |
~ClpLsqr () | |
Destructor. More... | |
Methods | |
bool | setParam (char *parmName, int parmValue) |
Set an int parameter. More... | |
void | do_lsqr (CoinDenseVector< double > &b, double damp, double atol, double btol, double conlim, int itnlim, bool show, Info info, CoinDenseVector< double > &x, int *istop, int *itn, Outfo *outfo, bool precon, CoinDenseVector< double > &Pr) |
Call the Lsqr algorithm. More... | |
void | matVecMult (int, CoinDenseVector< double > *, CoinDenseVector< double > *) |
Matrix-vector multiply - implemented by user. More... | |
void | matVecMult (int, CoinDenseVector< double > &, CoinDenseVector< double > &) |
void | borrowDiag1 (double *array) |
diag1 - we just borrow as it is part of a CoinDenseVector<double> More... | |
Public Attributes | |
Public member data | |
int | nrows_ |
Row dimension of matrix. More... | |
int | ncols_ |
Column dimension of matrix. More... | |
ClpInterior * | model_ |
Pointer to Model object for this instance. More... | |
double * | diag1_ |
Diagonal array 1. More... | |
double | diag2_ |
Constant diagonal 2. More... | |
This class implements LSQR.
LSQR solves Ax = b or min ||b - Ax||_2 if damp = 0, or min || (b) - ( A )x || otherwise. || (0) (damp I) ||2 A is an m by n matrix defined by user provided routines matVecMult(mode, y, x) which performs the matrix-vector operations where y and x are references or pointers to CoinDenseVector objects. If mode = 1, matVecMult must return y = Ax without altering x. If mode = 2, matVecMult must return y = A'x without altering x. ----------------------------------------------------------------------- LSQR uses an iterative (conjugate-gradient-like) method. For further information, see 1. C. C. Paige and M. A. Saunders (1982a). LSQR: An algorithm for sparse linear equations and sparse least squares, ACM TOMS 8(1), 43-71. 2. C. C. Paige and M. A. Saunders (1982b). Algorithm 583. LSQR: Sparse linear equations and least squares problems, ACM TOMS 8(2), 195-209. 3. M. A. Saunders (1995). Solution of sparse rectangular systems using LSQR and CRAIG, BIT 35, 588-604. Input parameters: atol, btol are stopping tolerances. If both are 1.0e-9 (say), the final residual norm should be accurate to about 9 digits. (The final x will usually have fewer correct digits, depending on cond(A) and the size of damp.) conlim is also a stopping tolerance. lsqr terminates if an estimate of cond(A) exceeds conlim. For compatible systems Ax = b, conlim could be as large as 1.0e+12 (say). For least-squares problems, conlim should be less than 1.0e+8. Maximum precision can be obtained by setting atol = btol = conlim = zero, but the number of iterations may then be excessive. itnlim is an explicit limit on iterations (for safety). show = 1 gives an iteration log, show = 0 suppresses output. info is a structure special to pdco.m, used to test if was small enough, and continuing if necessary with smaller atol. Output parameters: x is the final solution. *istop gives the reason for termination. *istop = 1 means x is an approximate solution to Ax = b. = 2 means x approximately solves the least-squares problem. rnorm = norm(r) if damp = 0, where r = b - Ax, = sqrt( norm(r)**2 + damp**2 * norm(x)**2 ) otherwise. xnorm = norm(x). var estimates diag( inv(A'A) ). Omitted in this special version. outfo is a structure special to pdco.m, returning information about whether atol had to be reduced. Other potential output parameters: anorm, acond, arnorm, xnorm
Definition at line 75 of file ClpLsqr.hpp.
ClpLsqr::ClpLsqr | ( | ) |
Default constructor.
ClpLsqr::ClpLsqr | ( | ClpInterior * | model | ) |
Constructor for use with Pdco model (note modified for pdco!!!!)
ClpLsqr::ClpLsqr | ( | const ClpLsqr & | ) |
Copy constructor.
ClpLsqr::~ClpLsqr | ( | ) |
Destructor.
bool ClpLsqr::setParam | ( | char * | parmName, |
int | parmValue | ||
) |
Set an int parameter.
void ClpLsqr::do_lsqr | ( | CoinDenseVector< double > & | b, |
double | damp, | ||
double | atol, | ||
double | btol, | ||
double | conlim, | ||
int | itnlim, | ||
bool | show, | ||
Info | info, | ||
CoinDenseVector< double > & | x, | ||
int * | istop, | ||
int * | itn, | ||
Outfo * | outfo, | ||
bool | precon, | ||
CoinDenseVector< double > & | Pr | ||
) |
Call the Lsqr algorithm.
void ClpLsqr::matVecMult | ( | int | , |
CoinDenseVector< double > * | , | ||
CoinDenseVector< double > * | |||
) |
Matrix-vector multiply - implemented by user.
void ClpLsqr::matVecMult | ( | int | , |
CoinDenseVector< double > & | , | ||
CoinDenseVector< double > & | |||
) |
|
inline |
diag1 - we just borrow as it is part of a CoinDenseVector<double>
Definition at line 124 of file ClpLsqr.hpp.
int ClpLsqr::nrows_ |
Row dimension of matrix.
Definition at line 85 of file ClpLsqr.hpp.
int ClpLsqr::ncols_ |
Column dimension of matrix.
Definition at line 87 of file ClpLsqr.hpp.
ClpInterior* ClpLsqr::model_ |
Pointer to Model object for this instance.
Definition at line 89 of file ClpLsqr.hpp.
double* ClpLsqr::diag1_ |
Diagonal array 1.
Definition at line 91 of file ClpLsqr.hpp.
double ClpLsqr::diag2_ |
Constant diagonal 2.
Definition at line 93 of file ClpLsqr.hpp.