LSMR solves Ax = b
or min ||Ax - b||
with or without damping,
using the iterative algorithm of David Fong and Michael Saunders.
y := y + A*x
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ip), | intent(in) | :: | m | |||
integer(kind=ip), | intent(in) | :: | n | |||
real(kind=dp), | intent(in) | :: | x(n) | |||
real(kind=dp), | intent(inout) | :: | y(m) |
x := x + A'*y
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ip), | intent(in) | :: | m | |||
integer(kind=ip), | intent(in) | :: | n | |||
real(kind=dp), | intent(inout) | :: | x(n) | |||
real(kind=dp), | intent(in) | :: | y(m) |
LSMR finds a solution x to the following problems:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ip), | intent(in) | :: | m |
the number of rows in A. |
||
integer(kind=ip), | intent(in) | :: | n |
the number of columns in A. |
||
procedure(Aprod1_f) | :: | Aprod1 |
See above. |
|||
procedure(Aprod2_f) | :: | Aprod2 |
See above. |
|||
real(kind=dp), | intent(in) | :: | b(m) |
The rhs vector |
||
real(kind=dp), | intent(in) | :: | damp |
The damping parameter for problem 3 above.
(damp should be 0.0 for problems 1 and 2.)
If the system |
||
real(kind=dp), | intent(in) | :: | atol |
An estimate of the relative error in the data defining the matrix A. For example, if A is accurate to about 6 digits, set atol = 1.0e-6. |
||
real(kind=dp), | intent(in) | :: | btol |
An estimate of the relative error in the data defining the rhs b. For example, if b is accurate to about 6 digits, set btol = 1.0e-6. |
||
real(kind=dp), | intent(in) | :: | conlim |
An upper limit on cond(Abar), the apparent condition number of the matrix Abar. Iterations will be terminated if a computed estimate of cond(Abar) exceeds conlim. This is intended to prevent certain small or zero singular values of A or Abar from coming into effect and causing unwanted growth in the computed solution. |
||
integer(kind=ip), | intent(in) | :: | itnlim |
An upper limit on the number of iterations. Suggested value: |
||
integer(kind=ip), | intent(in) | :: | localSize |
No. of vectors for local reorthogonalization: |
||
integer(kind=ip), | intent(in) | :: | nout |
File number for printed output. If positive, a summary will be printed on file nout. |
||
real(kind=dp), | intent(out) | :: | x(n) |
Returns the computed solution |
||
integer(kind=ip), | intent(out) | :: | istop |
An integer giving the reason for termination: |
||
integer(kind=ip), | intent(out) | :: | itn |
The number of iterations performed. |
||
real(kind=dp), | intent(out) | :: | normA |
An estimate of the Frobenius norm of Abar. This is the square-root of the sum of squares of the elements of Abar. If damp is small and the columns of A have all been scaled to have length 1.0, normA should increase to roughly sqrt(n). A radically different value for normA may indicate an error in Aprod1 or Aprod2. |
||
real(kind=dp), | intent(out) | :: | condA |
An estimate of cond(Abar), the condition number of Abar. A very high value of condA may again indicate an error in Aprod1 or Aprod2. |
||
real(kind=dp), | intent(out) | :: | normr |
An estimate of the final value of norm(rbar), the function being minimized (see notation above). This will be small if A*x = b has a solution. |
||
real(kind=dp), | intent(out) | :: | normAr |
An estimate of the final value of
|
||
real(kind=dp), | intent(out) | :: | normx |
An estimate of norm(x) for the final solution x. |
Easy interface to lsmr.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ip), | intent(in) | :: | m | |||
integer(kind=ip), | intent(in) | :: | n | |||
integer, | intent(in), | dimension(:) | :: | irow |
row indices of nonzero elements of |
|
integer, | intent(in), | dimension(:) | :: | icol |
column indices of nonzero elements of |
|
real(kind=dp), | intent(in), | dimension(:) | :: | a |
nonzero elements of |
|
real(kind=dp), | intent(in) | :: | b(m) | |||
real(kind=dp), | intent(in) | :: | damp | |||
real(kind=dp), | intent(in) | :: | atol | |||
real(kind=dp), | intent(in) | :: | btol | |||
real(kind=dp), | intent(in) | :: | conlim | |||
integer(kind=ip), | intent(in) | :: | itnlim | |||
integer(kind=ip), | intent(in) | :: | localSize | |||
integer(kind=ip), | intent(in) | :: | nout | |||
real(kind=dp), | intent(out) | :: | x(n) | |||
integer(kind=ip), | intent(out) | :: | istop | |||
integer(kind=ip), | intent(out) | :: | itn | |||
real(kind=dp), | intent(out) | :: | normA | |||
real(kind=dp), | intent(out) | :: | condA | |||
real(kind=dp), | intent(out) | :: | normr | |||
real(kind=dp), | intent(out) | :: | normAr | |||
real(kind=dp), | intent(out) | :: | normx |