Skip to content

Commit

Permalink
Add the size of each linear system in the docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Oct 7, 2022
1 parent 95d36a5 commit bf37121
Show file tree
Hide file tree
Showing 33 changed files with 54 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/bicgstab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export bicgstab, bicgstab!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the square linear system Ax = b using BICGSTAB.
Solve the square linear system Ax = b of size n using BICGSTAB.
BICGSTAB requires two initial vectors `b` and `c`.
The relation `bᴴc ≠ 0` must be satisfied and by default `c = b`.
Expand Down
2 changes: 1 addition & 1 deletion src/bilq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export bilq, bilq!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the square linear system Ax = b using BiLQ.
Solve the square linear system Ax = b of size n using BiLQ.
BiLQ is based on the Lanczos biorthogonalization process and requires two initial vectors `b` and `c`.
The relation `bᴴc ≠ 0` must be satisfied and by default `c = b`.
Expand Down
4 changes: 2 additions & 2 deletions src/bilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Combine BiLQ and QMR to solve adjoint systems.
[Aᴴ 0] [x] [c]
The relation `bᴴc ≠ 0` must be satisfied.
BiLQ is used for solving primal system `Ax = b`.
QMR is used for solving dual system `Aᴴy = c`.
BiLQ is used for solving primal system `Ax = b` of size n.
QMR is used for solving dual system `Aᴴy = c` of size n.
An option gives the possibility of transferring from the BiLQ point to the
BiCG point, when it exists. The transfer is based on the residual norm.
Expand Down
7 changes: 3 additions & 4 deletions src/cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ export cg, cg!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
The conjugate gradient method to solve the symmetric linear system Ax = b.
The conjugate gradient method to solve the Hermitian linear system Ax = b of size n.
The method does _not_ abort if A is not definite.
A preconditioner M may be provided in the form of a linear operator and is
assumed to be symmetric and positive definite.
assumed to be Hermitian and positive definite.
M also indicates the weighted norm in which residuals are measured.
If `itmax=0`, the default number of iterations is set to `2 * n`,
with `n = length(b)`.
If `itmax=0`, the default number of iterations is set to `2 * n`.
CG can be warm-started from an initial guess `x0` with
Expand Down
6 changes: 2 additions & 4 deletions src/cg_lanczos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ export cg_lanczos, cg_lanczos!
`FC` is `T` or `Complex{T}`.
The Lanczos version of the conjugate gradient method to solve the
symmetric linear system
Ax = b
Hermitian linear system Ax = b of size n.
The method does _not_ abort if A is not definite.
A preconditioner M may be provided in the form of a linear operator and is
assumed to be hermitian and positive definite.
assumed to be Hermitian and positive definite.
CG-LANCZOS can be warm-started from an initial guess `x0` with
Expand Down
10 changes: 5 additions & 5 deletions src/cg_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export cg_lanczos_shift, cg_lanczos_shift!
The Lanczos version of the conjugate gradient method to solve a family
of shifted systems
(A + αI) x = b (α = α₁, ..., αₙ)
(A + αI) x = b (α = α₁, ..., αₚ)
The method does _not_ abort if A + αI is not definite.
of size n. The method does _not_ abort if A + αI is not definite.
A preconditioner M may be provided in the form of a linear operator and is
assumed to be hermitian and positive definite.
assumed to be Hermitian and positive definite.
The callback is called as `callback(solver)` and should return `true` if the main loop should terminate,
and `false` otherwise.
Expand All @@ -41,11 +41,11 @@ and `false` otherwise.
* `A`: a linear operator that models a Hermitian matrix of dimension n;
* `b`: a vector of length n;
* `shifts`: a vector of length nshifts.
* `shifts`: a vector of length p.
#### Output arguments
* `x`: a vector of nshifts dense vectors, each one of length n;
* `x`: a vector of p dense vectors, each one of length n;
* `stats`: statistics collected on the run in a [`LanczosShiftStats`](@ref) structure.
#### References
Expand Down
2 changes: 1 addition & 1 deletion src/cgls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Solve the regularized linear least-squares problem
minimize ‖b - Ax‖₂² + λ‖x‖₂²
using the Conjugate Gradient (CG) method, where λ ≥ 0 is a regularization
of size n × m using the Conjugate Gradient (CG) method, where λ ≥ 0 is a regularization
parameter. This method is equivalent to applying CG to the normal equations
(AᴴA + λI) x = Aᴴb
Expand Down
2 changes: 1 addition & 1 deletion src/cgne.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Solve the consistent linear system
Ax + √λs = b
using the Conjugate Gradient (CG) method, where λ ≥ 0 is a regularization
of size n × m using the Conjugate Gradient (CG) method, where λ ≥ 0 is a regularization
parameter. This method is equivalent to applying CG to the normal equations
of the second kind
Expand Down
2 changes: 1 addition & 1 deletion src/cgs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export cgs, cgs!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the consistent linear system Ax = b using conjugate gradient squared algorithm.
Solve the consistent linear system Ax = b of size n using CGS.
CGS requires two initial vectors `b` and `c`.
The relation `bᴴc ≠ 0` must be satisfied and by default `c = b`.
Expand Down
10 changes: 5 additions & 5 deletions src/cr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export cr, cr!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
A truncated version of Stiefel’s Conjugate Residual method to solve the symmetric linear system Ax = b or the least-squares problem min ‖b - Ax‖.
The matrix A must be positive semi-definite.
A truncated version of Stiefel’s Conjugate Residual method to solve the Hermitian linear system Ax = b
of size n or the least-squares problem min ‖b - Ax‖ if A is singular.
The matrix A must be Hermitian semi-definite.
A preconditioner M may be provided in the form of a linear operator and is assumed to be symmetric and positive definite.
A preconditioner M may be provided in the form of a linear operator and is assumed to be Hermitian and positive definite.
M also indicates the weighted norm in which residuals are measured.
In a linesearch context, 'linesearch' must be set to 'true'.
If `itmax=0`, the default number of iterations is set to `2 * n`,
with `n = length(b)`.
If `itmax=0`, the default number of iterations is set to `2 * n`.
CR can be warm-started from an initial guess `x0` with
Expand Down
2 changes: 1 addition & 1 deletion src/craig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Find the least-norm solution of the consistent linear system
Ax + λ²y = b
using the Golub-Kahan implementation of Craig's method, where λ ≥ 0 is a
of size n × m using the Golub-Kahan implementation of Craig's method, where λ ≥ 0 is a
regularization parameter. This method is equivalent to CGNE but is more
stable.
Expand Down
2 changes: 1 addition & 1 deletion src/craigmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Solve the consistent linear system
Ax + λ²y = b
using the CRAIGMR method, where λ ≥ 0 is a regularization parameter.
of size n × m using the CRAIGMR method, where λ ≥ 0 is a regularization parameter.
This method is equivalent to applying the Conjugate Residuals method
to the normal equations of the second kind
Expand Down
4 changes: 2 additions & 2 deletions src/crls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Solve the linear least-squares problem
minimize ‖b - Ax‖₂² + λ‖x‖₂²
using the Conjugate Residuals (CR) method. This method is equivalent to
applying MINRES to the normal equations
of size n × m using the Conjugate Residuals (CR) method.
This method is equivalent to applying MINRES to the normal equations
(AᴴA + λI) x = Aᴴb.
Expand Down
2 changes: 1 addition & 1 deletion src/crmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Solve the consistent linear system
Ax + √λs = b
using the Conjugate Residual (CR) method, where λ ≥ 0 is a regularization
of size n × m using the Conjugate Residual (CR) method, where λ ≥ 0 is a regularization
parameter. This method is equivalent to applying CR to the normal equations
of the second kind
Expand Down
2 changes: 1 addition & 1 deletion src/diom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export diom, diom!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the consistent linear system Ax = b using DIOM.
Solve the consistent linear system Ax = b of size n using DIOM.
DIOM only orthogonalizes the new vectors of the Krylov basis against the `memory` most recent vectors.
If CG is well defined on `Ax = b` and `memory = 2`, DIOM is theoretically equivalent to CG.
Expand Down
2 changes: 1 addition & 1 deletion src/dqgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export dqgmres, dqgmres!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the consistent linear system Ax = b using DQGMRES.
Solve the consistent linear system Ax = b of size n using DQGMRES.
DQGMRES algorithm is based on the incomplete Arnoldi orthogonalization process
and computes a sequence of approximate solutions with the quasi-minimal residual property.
Expand Down
2 changes: 1 addition & 1 deletion src/fgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export fgmres, fgmres!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the linear system Ax = b using FGMRES.
Solve the linear system Ax = b of size n using FGMRES.
FGMRES computes a sequence of approximate solutions with minimum residual.
FGMRES is a variant of GMRES that allows changes in the right preconditioner at each iteration.
Expand Down
2 changes: 1 addition & 1 deletion src/fom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export fom, fom!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the linear system Ax = b using FOM.
Solve the linear system Ax = b of size n using FOM.
FOM algorithm is based on the Arnoldi process and a Galerkin condition.
Expand Down
2 changes: 1 addition & 1 deletion src/gmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export gmres, gmres!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the linear system Ax = b using GMRES.
Solve the linear system Ax = b of size n using GMRES.
GMRES algorithm is based on the Arnoldi process and computes a sequence of approximate solutions with the minimum residual.
Expand Down
2 changes: 1 addition & 1 deletion src/gpmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ GPMR solves the unsymmetric partitioned linear system
[ λI A ] [ x ] = [ b ]
[ B μI ] [ y ] [ c ],
where λ and μ are real or complex numbers.
of size (n+m) × (n+m) where λ and μ are real or complex numbers.
`A` can have any shape and `B` has the shape of `Aᴴ`.
`A`, `B`, `b` and `c` must be all nonzero.
Expand Down
2 changes: 1 addition & 1 deletion src/lnlq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Find the least-norm solution of the consistent linear system
Ax + λ²y = b
using the LNLQ method, where λ ≥ 0 is a regularization parameter.
of size n × m using the LNLQ method, where λ ≥ 0 is a regularization parameter.
For a system in the form Ax = b, LNLQ method is equivalent to applying
SYMMLQ to AAᴴy = b and recovering x = Aᴴy but is more stable.
Expand Down
2 changes: 1 addition & 1 deletion src/lslq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Solve the regularized linear least-squares problem
minimize ‖b - Ax‖₂² + λ²‖x‖₂²
using the LSLQ method, where λ ≥ 0 is a regularization parameter.
of size n × m using the LSLQ method, where λ ≥ 0 is a regularization parameter.
LSLQ is formally equivalent to applying SYMMLQ to the normal equations
(AᴴA + λ²I) x = Aᴴb
Expand Down
2 changes: 1 addition & 1 deletion src/lsmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Solve the regularized linear least-squares problem
minimize ‖b - Ax‖₂² + λ²‖x‖₂²
using the LSMR method, where λ ≥ 0 is a regularization parameter.
of size n × m using the LSMR method, where λ ≥ 0 is a regularization parameter.
LSMR is formally equivalent to applying MINRES to the normal equations
(AᴴA + λ²I) x = Aᴴb
Expand Down
2 changes: 1 addition & 1 deletion src/lsqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Solve the regularized linear least-squares problem
minimize ‖b - Ax‖₂² + λ²‖x‖₂²
using the LSQR method, where λ ≥ 0 is a regularization parameter.
of size n × m using the LSQR method, where λ ≥ 0 is a regularization parameter.
LSQR is formally equivalent to applying CG to the normal equations
(AᴴA + λ²I) x = Aᴴb
Expand Down
8 changes: 4 additions & 4 deletions src/minres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# minimize ‖Ax - b‖₂
#
# where A is square and symmetric.
# where A is Hermitian.
#
# MINRES is formally equivalent to applying the conjugate residuals method
# to Ax = b when A is positive definite, but is more general and also applies
Expand Down Expand Up @@ -43,8 +43,8 @@ or the shifted linear system
(A + λI) x = b
using the MINRES method, where λ ≥ 0 is a shift parameter,
where A is square and symmetric.
of size n using the MINRES method, where λ ≥ 0 is a shift parameter,
where A is Hermitian.
MINRES is formally equivalent to applying CR to Ax=b when A is positive
definite, but is typically more stable and also applies to the case where
Expand All @@ -53,7 +53,7 @@ A is indefinite.
MINRES produces monotonic residuals ‖r‖₂ and optimality residuals ‖Aᴴr‖₂.
A preconditioner M may be provided in the form of a linear operator and is
assumed to be symmetric and positive definite.
assumed to be Hermitian and positive definite.
MINRES can be warm-started from an initial guess `x0` with
Expand Down
4 changes: 2 additions & 2 deletions src/minres_qlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export minres_qlp, minres_qlp!
`FC` is `T` or `Complex{T}`.
MINRES-QLP is the only method based on the Lanczos process that returns the minimum-norm
solution on singular inconsistent systems (A + λI)x = b, where λ is a shift parameter.
solution on singular inconsistent systems (A + λI)x = b of size n, where λ is a shift parameter.
It is significantly more complex but can be more reliable than MINRES when A is ill-conditioned.
A preconditioner M may be provided in the form of a linear operator and is
assumed to be symmetric and positive definite.
assumed to be Hermitian and positive definite.
M also indicates the weighted norm in which residuals are measured.
MINRES-QLP can be warm-started from an initial guess `x0` with
Expand Down
2 changes: 1 addition & 1 deletion src/qmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export qmr, qmr!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the square linear system Ax = b using QMR.
Solve the square linear system Ax = b of size n using QMR.
QMR is based on the Lanczos biorthogonalization process and requires two initial vectors `b` and `c`.
The relation `bᴴc ≠ 0` must be satisfied and by default `c = b`.
Expand Down
8 changes: 4 additions & 4 deletions src/symmlq.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# An implementation of SYMMLQ for the solution of the
# linear system Ax = b, where A is square and symmetric.
# linear system Ax = b, where A is Hermitian.
#
# This implementation follows the original implementation by
# Michael Saunders described in
Expand Down Expand Up @@ -27,13 +27,13 @@ Solve the shifted linear system
(A + λI) x = b
using the SYMMLQ method, where λ is a shift parameter,
and A is square and symmetric.
of size n using the SYMMLQ method, where λ is a shift parameter,
and A is Hermitian.
SYMMLQ produces monotonic errors ‖x* - x‖₂.
A preconditioner M may be provided in the form of a linear operator and is
assumed to be symmetric and positive definite.
assumed to be Hermitian and positive definite.
SYMMLQ can be warm-started from an initial guess `x0` with
Expand Down
2 changes: 1 addition & 1 deletion src/tricg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TriCG solves the symmetric linear system
[ τE A ] [ x ] = [ b ]
[ Aᴴ νF ] [ y ] [ c ],
where τ and ν are real numbers, E = M⁻¹ ≻ 0 and F = N⁻¹ ≻ 0.
of size (n+m) × (n+m) where τ and ν are real numbers, E = M⁻¹ ≻ 0 and F = N⁻¹ ≻ 0.
`b` and `c` must both be nonzero.
TriCG could breakdown if `τ = 0` or `ν = 0`.
It's recommended to use TriMR in these cases.
Expand Down
4 changes: 2 additions & 2 deletions src/trilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Combine USYMLQ and USYMQR to solve adjoint systems.
[0 A] [y] = [b]
[Aᴴ 0] [x] [c]
USYMLQ is used for solving primal system `Ax = b`.
USYMQR is used for solving dual system `Aᴴy = c`.
USYMLQ is used for solving primal system `Ax = b` of size n.
USYMQR is used for solving dual system `Aᴴy = c` of size m.
An option gives the possibility of transferring from the USYMLQ point to the
USYMCG point, when it exists. The transfer is based on the residual norm.
Expand Down
2 changes: 1 addition & 1 deletion src/trimr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TriMR solves the symmetric linear system
[ τE A ] [ x ] = [ b ]
[ Aᴴ νF ] [ y ] [ c ],
where τ and ν are real numbers, E = M⁻¹ ≻ 0, F = N⁻¹ ≻ 0.
of size (n+m) × (n+m) where τ and ν are real numbers, E = M⁻¹ ≻ 0, F = N⁻¹ ≻ 0.
`b` and `c` must both be nonzero.
TriMR handles saddle-point systems (`τ = 0` or `ν = 0`) and adjoint systems (`τ = 0` and `ν = 0`) without any risk of breakdown.
Expand Down
2 changes: 1 addition & 1 deletion src/usymlq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export usymlq, usymlq!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the linear system Ax = b using the USYMLQ method.
Solve the linear system Ax = b of size n × m using the USYMLQ method.
USYMLQ is based on the orthogonal tridiagonalization process and requires two initial nonzero vectors `b` and `c`.
The vector `c` is only used to initialize the process and a default value can be `b` or `Aᴴb` depending on the shape of `A`.
Expand Down
2 changes: 1 addition & 1 deletion src/usymqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export usymqr, usymqr!
`T` is an `AbstractFloat` such as `Float32`, `Float64` or `BigFloat`.
`FC` is `T` or `Complex{T}`.
Solve the linear system Ax = b using USYMQR.
Solve the linear system Ax = b of size n × m using USYMQR.
USYMQR is based on the orthogonal tridiagonalization process and requires two initial nonzero vectors `b` and `c`.
The vector `c` is only used to initialize the process and a default value can be `b` or `Aᴴb` depending on the shape of `A`.
Expand Down

0 comments on commit bf37121

Please sign in to comment.