## Stats Types

`Krylov.KrylovStats`

— TypeAbstract type for statistics returned by a solver

`Krylov.SimpleStats`

— TypeType for statistics returned by the majority of Krylov solvers, the attributes are:

- niter
- solved
- inconsistent
- residuals
- Aresiduals
- Acond
- timer
- status

`Krylov.LanczosStats`

— TypeType for statistics returned by CG-LANCZOS, the attributes are:

- niter
- solved
- residuals
- indefinite
- Anorm
- Acond
- timer
- status

`Krylov.LanczosShiftStats`

— TypeType for statistics returned by CG-LANCZOS with shifts, the attributes are:

- niter
- solved
- residuals
- indefinite
- Anorm
- Acond
- timer
- status

`Krylov.SymmlqStats`

— TypeType for statistics returned by SYMMLQ, the attributes are:

- niter
- solved
- residuals
- residualscg
- errors
- errorscg
- Anorm
- Acond
- timer
- status

`Krylov.AdjointStats`

— TypeType for statistics returned by adjoint systems solvers BiLQR and TriLQR, the attributes are:

- niter
- solved_primal
- solved_dual
- residuals_primal
- residuals_dual
- timer
- status

`Krylov.LNLQStats`

— TypeType for statistics returned by the LNLQ method, the attributes are:

- niter
- solved
- residuals
- error
*with*bnd - error
*bnd*x - error
*bnd*y - timer
- status

`Krylov.LSLQStats`

— TypeType for statistics returned by the LSLQ method, the attributes are:

- niter
- solved
- inconsistent
- residuals
- Aresiduals
- err_lbnds
- error
*with*bnd - err
*ubnds*lq - err
*ubnds*cg - timer
- status

`Krylov.LsmrStats`

— TypeType for statistics returned by LSMR. The attributes are:

- niter
- solved
- inconsistent
- residuals
- Aresiduals
- Acond
- Anorm
- xNorm
- timer
- status

## Solver Types

`Krylov.KrylovSolver`

— TypeAbstract type for using Krylov solvers in-place

`Krylov.BlockKrylovSolver`

— TypeAbstract type for using block Krylov solvers in-place

`Krylov.MinresSolver`

— TypeType for storing the vectors required by the in-place version of MINRES.

The outer constructors

```
solver = MinresSolver(m, n, S; window :: Int=5)
solver = MinresSolver(A, b; window :: Int=5)
```

may be used in order to create these vectors.

`Krylov.MinaresSolver`

— TypeType for storing the vectors required by the in-place version of MINARES.

The outer constructors

```
solver = MinaresSolver(m, n, S)
solver = MinaresSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CgSolver`

— TypeType for storing the vectors required by the in-place version of CG.

The outer constructors

```
solver = CgSolver(m, n, S)
solver = CgSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CrSolver`

— TypeType for storing the vectors required by the in-place version of CR.

The outer constructors

```
solver = CrSolver(m, n, S)
solver = CrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CarSolver`

— TypeType for storing the vectors required by the in-place version of CAR.

The outer constructors

```
solver = CarSolver(m, n, S)
solver = CarSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.SymmlqSolver`

— TypeType for storing the vectors required by the in-place version of SYMMLQ.

The outer constructors

```
solver = SymmlqSolver(m, n, S)
solver = SymmlqSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CgLanczosSolver`

— TypeType for storing the vectors required by the in-place version of CG-LANCZOS.

The outer constructors

```
solver = CgLanczosSolver(m, n, S)
solver = CgLanczosSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CgLanczosShiftSolver`

— TypeType for storing the vectors required by the in-place version of CG-LANCZOS-SHIFT.

The outer constructors

```
solver = CgLanczosShiftSolver(m, n, nshifts, S)
solver = CgLanczosShiftSolver(A, b, nshifts)
```

may be used in order to create these vectors.

`Krylov.MinresQlpSolver`

— TypeType for storing the vectors required by the in-place version of MINRES-QLP.

The outer constructors

```
solver = MinresQlpSolver(m, n, S)
solver = MinresQlpSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.DiomSolver`

— TypeType for storing the vectors required by the in-place version of DIOM.

The outer constructors

```
solver = DiomSolver(m, n, memory, S)
solver = DiomSolver(A, b, memory = 20)
```

may be used in order to create these vectors. `memory`

is set to `n`

if the value given is larger than `n`

. `memory`

is an optional argument in the second constructor.

`Krylov.FomSolver`

— TypeType for storing the vectors required by the in-place version of FOM.

The outer constructors

```
solver = FomSolver(m, n, memory, S)
solver = FomSolver(A, b, memory = 20)
```

may be used in order to create these vectors. `memory`

is set to `n`

if the value given is larger than `n`

. `memory`

is an optional argument in the second constructor.

`Krylov.DqgmresSolver`

— TypeType for storing the vectors required by the in-place version of DQGMRES.

The outer constructors

```
solver = DqgmresSolver(m, n, memory, S)
solver = DqgmresSolver(A, b, memory = 20)
```

may be used in order to create these vectors. `memory`

is set to `n`

if the value given is larger than `n`

. `memory`

is an optional argument in the second constructor.

`Krylov.GmresSolver`

— TypeType for storing the vectors required by the in-place version of GMRES.

The outer constructors

```
solver = GmresSolver(m, n, memory, S)
solver = GmresSolver(A, b, memory = 20)
```

`memory`

is set to `n`

if the value given is larger than `n`

. `memory`

is an optional argument in the second constructor.

`Krylov.UsymlqSolver`

— TypeType for storing the vectors required by the in-place version of USYMLQ.

The outer constructors

```
solver = UsymlqSolver(m, n, S)
solver = UsymlqSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.UsymqrSolver`

— TypeType for storing the vectors required by the in-place version of USYMQR.

The outer constructors

```
solver = UsymqrSolver(m, n, S)
solver = UsymqrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.TricgSolver`

— TypeType for storing the vectors required by the in-place version of TRICG.

The outer constructors

```
solver = TricgSolver(m, n, S)
solver = TricgSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.TrimrSolver`

— TypeType for storing the vectors required by the in-place version of TRIMR.

The outer constructors

```
solver = TrimrSolver(m, n, S)
solver = TrimrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.TrilqrSolver`

— TypeType for storing the vectors required by the in-place version of TRILQR.

The outer constructors

```
solver = TrilqrSolver(m, n, S)
solver = TrilqrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CgsSolver`

— TypeType for storing the vectors required by the in-place version of CGS.

The outer constructorss

```
solver = CgsSolver(m, n, S)
solver = CgsSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.BicgstabSolver`

— TypeType for storing the vectors required by the in-place version of BICGSTAB.

The outer constructors

```
solver = BicgstabSolver(m, n, S)
solver = BicgstabSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.BilqSolver`

— TypeType for storing the vectors required by the in-place version of BILQ.

The outer constructors

```
solver = BilqSolver(m, n, S)
solver = BilqSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.QmrSolver`

— TypeType for storing the vectors required by the in-place version of QMR.

The outer constructors

```
solver = QmrSolver(m, n, S)
solver = QmrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.BilqrSolver`

— TypeType for storing the vectors required by the in-place version of BILQR.

The outer constructors

```
solver = BilqrSolver(m, n, S)
solver = BilqrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CglsSolver`

— TypeType for storing the vectors required by the in-place version of CGLS.

The outer constructors

```
solver = CglsSolver(m, n, S)
solver = CglsSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CglsLanczosShiftSolver`

— TypeWorkspace for the in-place version of CGLS-LANCZOS-SHIFT.

The outer constructors:

```
solver = CglsLanczosShiftSolver(m, n, nshifts, S)
solver = CglsLanczosShiftSolver(A, b, nshifts)
```

can be used to initialize this workspace.

`Krylov.CrlsSolver`

— TypeType for storing the vectors required by the in-place version of CRLS.

The outer constructors

```
solver = CrlsSolver(m, n, S)
solver = CrlsSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CgneSolver`

— TypeType for storing the vectors required by the in-place version of CGNE.

The outer constructors

```
solver = CgneSolver(m, n, S)
solver = CgneSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CrmrSolver`

— TypeType for storing the vectors required by the in-place version of CRMR.

The outer constructors

```
solver = CrmrSolver(m, n, S)
solver = CrmrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.LslqSolver`

— TypeType for storing the vectors required by the in-place version of LSLQ.

The outer constructors

```
solver = LslqSolver(m, n, S)
solver = LslqSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.LsqrSolver`

— TypeType for storing the vectors required by the in-place version of LSQR.

The outer constructors

```
solver = LsqrSolver(m, n, S)
solver = LsqrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.LsmrSolver`

— TypeType for storing the vectors required by the in-place version of LSMR.

The outer constructors

```
solver = LsmrSolver(m, n, S)
solver = LsmrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.LnlqSolver`

— TypeType for storing the vectors required by the in-place version of LNLQ.

The outer constructors

```
solver = LnlqSolver(m, n, S)
solver = LnlqSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CraigSolver`

— TypeType for storing the vectors required by the in-place version of CRAIG.

The outer constructors

```
solver = CraigSolver(m, n, S)
solver = CraigSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.CraigmrSolver`

— TypeType for storing the vectors required by the in-place version of CRAIGMR.

The outer constructors

```
solver = CraigmrSolver(m, n, S)
solver = CraigmrSolver(A, b)
```

may be used in order to create these vectors.

`Krylov.GpmrSolver`

— TypeType for storing the vectors required by the in-place version of GPMR.

The outer constructors

```
solver = GpmrSolver(m, n, memory, S)
solver = GpmrSolver(A, b, memory = 20)
```

may be used in order to create these vectors. `memory`

is set to `n + m`

if the value given is larger than `n + m`

. `memory`

is an optional argument in the second constructor.

`Krylov.FgmresSolver`

— TypeType for storing the vectors required by the in-place version of FGMRES.

The outer constructors

```
solver = FgmresSolver(m, n, memory, S)
solver = FgmresSolver(A, b, memory = 20)
```

`memory`

is set to `n`

if the value given is larger than `n`

. `memory`

is an optional argument in the second constructor.

`Krylov.BlockGmresSolver`

— TypeType for storing the vectors required by the in-place version of BLOCK-GMRES.

The outer constructors

```
solver = BlockGmresSolver(m, n, p, memory, SV, SM)
solver = BlockGmresSolver(A, B, memory = 5)
```

may be used in order to create these vectors. `memory`

is set to `div(n,p)`

if the value given is larger than `div(n,p)`

. `memory`

is an optional argument in the second constructor.

## Utilities

`Krylov.roots_quadratic`

— Function`roots = roots_quadratic(q₂, q₁, q₀; nitref)`

Find the real roots of the quadratic

`q(x) = q₂ x² + q₁ x + q₀,`

where q₂, q₁ and q₀ are real. Care is taken to avoid numerical cancellation. Optionally, `nitref`

steps of iterative refinement may be performed to improve accuracy. By default, `nitref=1`

.

`Krylov.sym_givens`

— Function`(c, s, ρ) = sym_givens(a, b)`

Numerically stable symmetric Givens reflection. Given `a`

and `b`

reals, return `(c, s, ρ)`

such that

```
[ c s ] [ a ] = [ ρ ]
[ s -c ] [ b ] = [ 0 ].
```

Numerically stable symmetric Givens reflection. Given `a`

and `b`

complexes, return `(c, s, ρ)`

with c real and (s, ρ) complexes such that

```
[ c s ] [ a ] = [ ρ ]
[ s̅ -c ] [ b ] = [ 0 ].
```

`Krylov.to_boundary`

— Function`roots = to_boundary(n, x, d, radius; flip, xNorm2, dNorm2)`

Given a trust-region radius `radius`

, a vector `x`

lying inside the trust-region and a direction `d`

, return `σ1`

and `σ2`

such that

`‖x + σi d‖ = radius, i = 1, 2`

in the Euclidean norm. `n`

is the length of vectors `x`

and `d`

. If known, ‖x‖² and ‖d‖² may be supplied with `xNorm2`

and `dNorm2`

.

If `flip`

is set to `true`

, `σ1`

and `σ2`

are computed such that

`‖x - σi d‖ = radius, i = 1, 2.`

`Krylov.vec2str`

— Function`s = vec2str(x; ndisp)`

Display an array in the form

`[ -3.0e-01 -5.1e-01 1.9e-01 ... -2.3e-01 -4.4e-01 2.4e-01 ]`

with (ndisp - 1)/2 elements on each side.

`Krylov.ktypeof`

— Function`S = ktypeof(v)`

Return the most relevant storage type `S`

based on the type of `v`

.

`Krylov.kzeros`

— Function`v = kzeros(S, n)`

Create a vector of storage type `S`

of length `n`

only composed of zero.

`Krylov.kones`

— Function`v = kones(S, n)`

Create a vector of storage type `S`

of length `n`

only composed of one.

`Krylov.vector_to_matrix`

— Function`M = vector_to_matrix(S)`

Return the dense matrix storage type `M`

related to the dense vector storage type `S`

.

`Krylov.matrix_to_vector`

— Function`S = matrix_to_vector(M)`

Return the dense vector storage type `S`

related to the dense matrix storage type `M`

.