diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 4b3f9b2..3fdcae8 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-11-13T04:30:24","documenter_version":"1.1.2"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-11-13T04:42:03","documenter_version":"1.1.2"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index f29110e..921d367 100644 --- a/dev/index.html +++ b/dev/index.html @@ -35,4 +35,4 @@ ## solve least squares K_ls = K[:,1:200] -r_ls, x_ls = ma57_least_squares(K_ls, rhs) # == ma57_solve(K_ls, rhs) +r_ls, x_ls = ma57_least_squares(K_ls, rhs) # == ma57_solve(K_ls, rhs) diff --git a/dev/reference/index.html b/dev/reference/index.html index e9a819f..7f4da0e 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -4,16 +4,16 @@ julia> vals = T[2, 3, 4, 6, 1, 5, 1]; julia> A = sparse(rows, cols, vals); julia> M = Ma57(A) -HSL.Ma57{Float64}(5, 7, Cint[1, 1, 2, 2, 3, 3, 5], Cint[1, 2, 3, 5, 3, 4, 5], [2.0, 3.0, 4.0, 6.0, 1.0, 5.0, 1.0], HSL.Ma57_Control{Float64}(Cint[6, 6, 6, -1, 0, 5, 1, 0, 10, 1, 16, 16, 10, 100, 1, 0, 0, 0, 0, 0], [0.01, 1.0e-20, 0.5, 0.0, 0.0]), HSL.Ma57_Info{Float64}(Cint[0, 0, 0, 0, 12, 13, 4, 2, 48, 53 … 0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [10.0, 34.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 1.1, 81, Cint[5, 4, 3, 2, 1, 2, 9, 0, 0, 0 … 4, 3, 3, 2, 2, 1, 1, 0, 0, 0], 48, Float64[], 53, Cint[])source
HSL.Ma57ExceptionType

Exception type raised in case of error.

source
HSL.Ma57_ControlType

Main control type for MA57.

Ma57_Control(; kwargs...)

Keyword arguments:

  • sqd::Bool: Flag indicating symmetric quasi-definite matrix (default: false)
  • print_level::Int: integer controling the verbosit level. Accepted values are:
    • <0: no printing
    • 0: errors and warnings only (default)
    • 1: errors, warnings and basic diagnostics
    • 2: errors, warning and full diagnostics
  • unit_diagnostics::Int: Fortran file unit for diagnostics (default: 6)
  • unit_error::Int: Fortran file unit for errors (default: 6)
  • unit_warning::Int: Fortran file unit for warnings (default: 6)

Example:

julia> using HSL
+HSL.Ma57{Float64}(5, 7, Cint[1, 1, 2, 2, 3, 3, 5], Cint[1, 2, 3, 5, 3, 4, 5], [2.0, 3.0, 4.0, 6.0, 1.0, 5.0, 1.0], HSL.Ma57_Control{Float64}(Cint[6, 6, 6, -1, 0, 5, 1, 0, 10, 1, 16, 16, 10, 100, 1, 0, 0, 0, 0, 0], [0.01, 1.0e-20, 0.5, 0.0, 0.0]), HSL.Ma57_Info{Float64}(Cint[0, 0, 0, 0, 12, 13, 4, 2, 48, 53  …  0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [10.0, 34.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 1.1, 81, Cint[5, 4, 3, 2, 1, 2, 9, 0, 0, 0  …  4, 3, 3, 2, 2, 1, 1, 0, 0, 0], 48, Float64[], 53, Cint[])
source
HSL.Ma57ExceptionType

Exception type raised in case of error.

source
HSL.Ma57_ControlType

Main control type for MA57.

Ma57_Control(; kwargs...)

Keyword arguments:

  • sqd::Bool: Flag indicating symmetric quasi-definite matrix (default: false)
  • print_level::Int: integer controling the verbosit level. Accepted values are:
    • <0: no printing
    • 0: errors and warnings only (default)
    • 1: errors, warnings and basic diagnostics
    • 2: errors, warning and full diagnostics
  • unit_diagnostics::Int: Fortran file unit for diagnostics (default: 6)
  • unit_error::Int: Fortran file unit for errors (default: 6)
  • unit_warning::Int: Fortran file unit for warnings (default: 6)

Example:

julia> using HSL
 julia> Ma57_Control{Float64}(print_level=1)
-HSL.Ma57_Control{Float64}(Cint[6, 6, 6, -1, 1, 5, 1, 0, 10, 1, 16, 16, 10, 100, 1, 0, 0, 0, 0, 0], [0.01, 1.0e-20, 0.5, 0.0, 0.0])
source
HSL.Ma57_InfoType

Main info type for MA57

info = Ma57_Info{T <: Ma97Real}()

An info variable is used to collect statistics on the analysis, factorization, and solve.

Example:

julia> using HSL
+HSL.Ma57_Control{Float64}(Cint[6, 6, 6, -1, 1, 5, 1, 0, 10, 1, 16, 16, 10, 100, 1, 0, 0, 0, 0, 0], [0.01, 1.0e-20, 0.5, 0.0, 0.0])
source
HSL.Ma57_InfoType

Main info type for MA57

info = Ma57_Info{T <: Ma97Real}()

An info variable is used to collect statistics on the analysis, factorization, and solve.

Example:

julia> using HSL
 julia> T = Float64;
 julia> rows = Cint[1, 2, 3, 5, 3, 4, 5]; cols = Cint[1, 1, 2, 2, 3, 3, 5];
 julia> vals = T[2, 3, 4, 6, 1, 5, 1];
 julia> A = sparse(rows, cols, vals);
 julia> M = Ma57(A);
 julia> M.info
-HSL.Ma57_Info{Float64}(Cint[0, 0, 0, 0, 12, 13, 4, 2, 48, 53  …  0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [10.0, 34.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
source
HSL.Ma97Method

Instantiate and perform symbolic analysis on a sparse Julia matrix

M = Ma97(A; kwargs...)

Instantiate an object of type Ma97 and perform the symbolic analysis on a sparse Julia matrix.

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix. The lower triangle will be extracted.

Keyword arguments

All keyword arguments are passed directly to ma97_csc().

source
HSL.Ma97ExceptionType

Exception type raised in case of error.

source
HSL.ma97_controlMethod

Main control type for MA97.

ma97_control{T}(; kwargs...)

Keyword arguments:

  • print_level::Int: integer controling the verbosit level. Accepted values are:
    • <0: no printing
    • 0: errors and warnings only (default)
    • 1: errors, warnings and basic diagnostics
    • 2: errors, warning and full diagnostics
  • unit_diagnostics::Int: Fortran file unit for diagnostics (default: 6)
  • unit_error::Int: Fortran file unit for errors (default: 6)
  • unit_warning::Int: Fortran file unit for warnings (default: 6)
source
HSL.ma97_infoMethod

Main info type for MA97

info = ma97_info{T}()

An info structure used to collect statistics on the analysis, factorization and solve.

source
HSL.kb07Function
v, perm = kb07(v)

Sort an array of numbers v in-place into ascending order maintaining an index array perm to preserve a record of the original order.

source
HSL.ma57_alter_dFunction

Alter block diagonal matrix D

Input arguments:

  • M::Ma57: Ma57 object
  • F::Matrix{Float64}: diagonal adjustment

Example:

julia> using HSL
+HSL.Ma57_Info{Float64}(Cint[0, 0, 0, 0, 12, 13, 4, 2, 48, 53  …  0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [10.0, 34.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
source
HSL.Ma97Method

Instantiate and perform symbolic analysis on a sparse Julia matrix

M = Ma97(A; kwargs...)

Instantiate an object of type Ma97 and perform the symbolic analysis on a sparse Julia matrix.

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix. The lower triangle will be extracted.

Keyword arguments

All keyword arguments are passed directly to ma97_csc().

source
HSL.Ma97ExceptionType

Exception type raised in case of error.

source
HSL.ma97_controlMethod

Main control type for MA97.

ma97_control{T}(; kwargs...)

Keyword arguments:

  • print_level::Int: integer controling the verbosit level. Accepted values are:
    • <0: no printing
    • 0: errors and warnings only (default)
    • 1: errors, warnings and basic diagnostics
    • 2: errors, warning and full diagnostics
  • unit_diagnostics::Int: Fortran file unit for diagnostics (default: 6)
  • unit_error::Int: Fortran file unit for errors (default: 6)
  • unit_warning::Int: Fortran file unit for warnings (default: 6)
source
HSL.ma97_infoMethod

Main info type for MA97

info = ma97_info{T}()

An info structure used to collect statistics on the analysis, factorization and solve.

source
HSL.kb07Function
v, perm = kb07(v)

Sort an array of numbers v in-place into ascending order maintaining an index array perm to preserve a record of the original order.

source
HSL.ma57_alter_dFunction

Alter block diagonal matrix D

Input arguments:

  • M::Ma57: Ma57 object
  • F::Matrix{Float64}: diagonal adjustment

Example:

julia> using HSL
 
 julia> T = Float64;
 
@@ -41,12 +41,12 @@
 
 julia> F = [full(d1)' ; full(d2)']
 
-julia> ma57_alter_d(M, F)
source
HSL.ma57_factorize!Function

Factorize Ma57 object in-place.

ma57_factorize!(M)

Input arguments:

  • M::Ma57: Ma57 object

Return values:

  • M::Ma57: Ma57 object

Example:

``JULIA julia> using HSL julia> T = Float64; julia> rows = Cint[1, 2, 3, 5, 3, 4, 5]; cols = Cint[1, 1, 2, 2, 3, 3, 5]; julia> vals = T[2, 3, 4, 6, 1, 5, 1]; julia> A = sparse(rows, cols, vals); julia> M = Ma57(A) julia> ma57_factorize!(M) ## factorizeMa57` object in place

source
HSL.ma57_factorizeMethod

Factorize a sparse matrix.

M = ma57_factorize(A)

Input arguments:

  • A::SparseMatrixCSC{T<:Ma57Data,Int}: sparse matrix

Return values:

  • M::Ma57: factorized Ma57 object

Stored information:

  • M.info.largest_front::Int: order of largest frontal matrix
  • M.info.num_2x2_pivots::Int: number of 2x2 pivots used in factorization
  • M.info.num_delayed_pivots::Int: total number of fully-summed variables that were passed to the father node because of pivoting considerations
  • M.info.num_negative_eigs::Int: number of negative eigenvalues in factorization of A
  • M.info.rank::Int: rank of factorization of A
  • M.info.num_pivot_sign_changes::Int: number of sign changes of pivot when icntl(7) = 3 (ie, no pivoting)

Example:

julia> using HSL
+julia> ma57_alter_d(M, F)
source
HSL.ma57_factorize!Function

Factorize Ma57 object in-place.

ma57_factorize!(M)

Input arguments:

  • M::Ma57: Ma57 object

Return values:

  • M::Ma57: Ma57 object

Example:

``JULIA julia> using HSL julia> T = Float64; julia> rows = Cint[1, 2, 3, 5, 3, 4, 5]; cols = Cint[1, 1, 2, 2, 3, 3, 5]; julia> vals = T[2, 3, 4, 6, 1, 5, 1]; julia> A = sparse(rows, cols, vals); julia> M = Ma57(A) julia> ma57_factorize!(M) ## factorizeMa57` object in place

source
HSL.ma57_factorizeMethod

Factorize a sparse matrix.

M = ma57_factorize(A)

Input arguments:

  • A::SparseMatrixCSC{T<:Ma57Data,Int}: sparse matrix

Return values:

  • M::Ma57: factorized Ma57 object

Stored information:

  • M.info.largest_front::Int: order of largest frontal matrix
  • M.info.num_2x2_pivots::Int: number of 2x2 pivots used in factorization
  • M.info.num_delayed_pivots::Int: total number of fully-summed variables that were passed to the father node because of pivoting considerations
  • M.info.num_negative_eigs::Int: number of negative eigenvalues in factorization of A
  • M.info.rank::Int: rank of factorization of A
  • M.info.num_pivot_sign_changes::Int: number of sign changes of pivot when icntl(7) = 3 (ie, no pivoting)

Example:

julia> using HSL
 julia> T = Float64;
 julia> rows = Cint[1, 2, 3, 5, 3, 4, 5]; cols = Cint[1, 1, 2, 2, 3, 3, 5];
 julia> vals = T[2, 3, 4, 6, 1, 5, 1];
 julia> A = sparse(rows, cols, vals);
-julia> M = ma57_factorize(A)  ## factorize sparse matrix and return `Ma57` object
source
HSL.ma57_get_factorsFunction

Retrieve factors, scaling, and permutation.

L, D, s, iperm = ma57getfactors(M)

Function will retrieve a unit triangular matrix L, a block-diagonal matrix D a scaling vector s and a permutation vector p such that

P * S * A * S * P' = L * D * L'

where S = spdiagm(s) and P = speye(n)[p,:].

Note that the numerical factorization must have been performed and have succeeded.

Input arguments

  • M::Ma57: factorized Ma57 object

Return values

  • L::SparseMatrixCSC{T<:Ma57Data,Int}: L factor
  • D::SparseMatrixCSC{T<:Ma57Data,Int}: D factor
  • s::Vector{T}: diagonal components of scaling matrix S
  • iperm::Vector{Int}: array representin permutation matrix P

Example:


+julia> M = ma57_factorize(A)  ## factorize sparse matrix and return `Ma57` object
source
HSL.ma57_get_factorsFunction

Retrieve factors, scaling, and permutation.

L, D, s, iperm = ma57getfactors(M)

Function will retrieve a unit triangular matrix L, a block-diagonal matrix D a scaling vector s and a permutation vector p such that

P * S * A * S * P' = L * D * L'

where S = spdiagm(s) and P = speye(n)[p,:].

Note that the numerical factorization must have been performed and have succeeded.

Input arguments

  • M::Ma57: factorized Ma57 object

Return values

  • L::SparseMatrixCSC{T<:Ma57Data,Int}: L factor
  • D::SparseMatrixCSC{T<:Ma57Data,Int}: D factor
  • s::Vector{T}: diagonal components of scaling matrix S
  • iperm::Vector{Int}: array representin permutation matrix P

Example:


 julia> using HSL
 
 julia> T = Float64;
@@ -75,7 +75,7 @@
 
 julia> vecnorm(P * S * A * S * P' - L * D * L') ≤ ϵ * vecnorm(A)
 
-true
source
HSL.ma57_least_squaresMethod

Solve the least-squares problem minimize ‖Ax - b‖, where A has shape m-by-n with m > n, by solving the saddle-point system [ I A ] [ r ] [ b ] [ A' ] [ x ] = [ 0 ].

source
HSL.ma57_min_normMethod

Solve the minimum-norm problem minimize ‖x‖ subject to Ax=b, where A has shape m-by-n with m < n, by solving the saddle-point system [ I A' ] [ x ] [ 0 ] [ A ] [ y ] = [ b ].

source
HSL.ma57_solveFunction

System solve.

Solve after factorization without iterative refinement

ma57_solve(ma57, b; kwargs...)

Input arguments:

  • ma57::Ma57{T<:Ma57Data}: an Ma57 structure for which the analysis and factorization have been performed
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.

Keyword arguments:

  • job::Symbol=:A: task to perform. Accepted values are
    • :A: solve Ax = b
    • :LS: solve LPSx = PSb
    • :DS: solve DPS⁻¹x = PSb
    • :LPS: solve L'PS⁻¹x = PS⁻¹b

Return values:

  • x::Array{T}: an array of the same size as b containing the solutions.

Solve after factorization with iterative refinement

ma57_solve(A, b, nitref; kwargs...)

Input arguments:

  • A::SparseMatrixCSC{T<:Ma57Data,Int}: input matrix. A full matrix will be converted to sparse.
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.
  • nitref::Int: number of iterative refinement steps

Return values:

  • x::Array{T}: an array of the same size as b containing the solutions.

Stored information:

Accessible through the Ma57 matrix object's `info` attribute
  • ma57.info.backward_error1::T: max{i} |b - Ax|i / (|b| + |A| |x|)_i
  • ma57.info.backward_error2::T: max{i} |b - Ax|i / ((|A| |x|)i + ||Ai||{∞} ||x||{∞})
  • ma57.info.matrix_inf_norm::T: ||A||_{∞}
  • ma57.info.solution_inf_norm::T: ||x||_{∞}
  • ma57.info.scaled_residuals::T: norm of scaled residuals = max{i} |sumj a{ij} xj - bi| / ||A||{∞} ||x||_{∞})
  • ma57.info.cond1::T: condition number as defined in Arioli, M. Demmel, J. W., and Duff, I. S. (1989). Solving sparse linear systems with sparse backward error. SIAM J.Matrix Anal. and Applics. 10, 165-190.
  • ma57.info.cond2::T: condition number as defined in Arioli, M. Demmel, J. W., and Duff, I. S. (1989). Solving sparse linear systems with sparse backward error. SIAM J.Matrix Anal. and Applics. 10, 165-190.
  • ma57.info.error_inf_norm::T: upper bound for the infinity norm of the error in the solution

Example:

julia> using HSL
+true
source
HSL.ma57_least_squaresMethod

Solve the least-squares problem minimize ‖Ax - b‖, where A has shape m-by-n with m > n, by solving the saddle-point system [ I A ] [ r ] [ b ] [ A' ] [ x ] = [ 0 ].

source
HSL.ma57_min_normMethod

Solve the minimum-norm problem minimize ‖x‖ subject to Ax=b, where A has shape m-by-n with m < n, by solving the saddle-point system [ I A' ] [ x ] [ 0 ] [ A ] [ y ] = [ b ].

source
HSL.ma57_solveFunction

System solve.

Solve after factorization without iterative refinement

ma57_solve(ma57, b; kwargs...)

Input arguments:

  • ma57::Ma57{T<:Ma57Data}: an Ma57 structure for which the analysis and factorization have been performed
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.

Keyword arguments:

  • job::Symbol=:A: task to perform. Accepted values are
    • :A: solve Ax = b
    • :LS: solve LPSx = PSb
    • :DS: solve DPS⁻¹x = PSb
    • :LPS: solve L'PS⁻¹x = PS⁻¹b

Return values:

  • x::Array{T}: an array of the same size as b containing the solutions.

Solve after factorization with iterative refinement

ma57_solve(A, b, nitref; kwargs...)

Input arguments:

  • A::SparseMatrixCSC{T<:Ma57Data,Int}: input matrix. A full matrix will be converted to sparse.
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.
  • nitref::Int: number of iterative refinement steps

Return values:

  • x::Array{T}: an array of the same size as b containing the solutions.

Stored information:

Accessible through the Ma57 matrix object's `info` attribute
  • ma57.info.backward_error1::T: max{i} |b - Ax|i / (|b| + |A| |x|)_i
  • ma57.info.backward_error2::T: max{i} |b - Ax|i / ((|A| |x|)i + ||Ai||{∞} ||x||{∞})
  • ma57.info.matrix_inf_norm::T: ||A||_{∞}
  • ma57.info.solution_inf_norm::T: ||x||_{∞}
  • ma57.info.scaled_residuals::T: norm of scaled residuals = max{i} |sumj a{ij} xj - bi| / ||A||{∞} ||x||_{∞})
  • ma57.info.cond1::T: condition number as defined in Arioli, M. Demmel, J. W., and Duff, I. S. (1989). Solving sparse linear systems with sparse backward error. SIAM J.Matrix Anal. and Applics. 10, 165-190.
  • ma57.info.cond2::T: condition number as defined in Arioli, M. Demmel, J. W., and Duff, I. S. (1989). Solving sparse linear systems with sparse backward error. SIAM J.Matrix Anal. and Applics. 10, 165-190.
  • ma57.info.error_inf_norm::T: upper bound for the infinity norm of the error in the solution

Example:

julia> using HSL
 julia> T = Float64;
 julia> rows = Cint[1, 2, 3, 5, 3, 4, 5]; cols = Cint[1, 1, 2, 2, 3, 3, 5];
 julia> vals = T[2, 3, 4, 6, 1, 5, 1];
@@ -90,8 +90,8 @@
 true
 julia> xx = ma57_solve(M, b, 2)  ## solve with iterative refinement
 julia> norm(xx - xexact) ≤ ϵ * norm(xexact)
-true
source
HSL.ma57_solve!Function
ma57_solve!(ma57, b, work; job::Symbol = :A)

Solve a symmetric linear system ma57 * x = b, overwriting b to store x. work should be a Vector{eltype(b)} of length ma57.n * size(b, 2). The symbolic analysis and numerical factorization must have been performed and must have succeeded.

Solve with iterative refinement

ma57_solve!(ma57, b, x, resid, work, nitref)

Solve a symmetric linear system ma57 * x = b with iterative refinement. ma57.control.icntl[9] should have been set to the maximum number of iterative refinements wanted. resid should be a storage Vector{eltype(b)} of size ma57.n work should be a storage Vector{eltype(b)} of size ma57.n if ma57.control.icntl[9] == 1, and of size 4 * ma57.n otherwise. The symbolic analysis and numerical factorization must have been performed and must have succeeded.

source
HSL.ma97_coordFunction

Instantiate and perform symbolic analysis using coordinate arrays

M = ma97_coord(n, cols, rows, nzval; kwargs...)

Instantiate an object of type Ma97 and perform the symbolic analysis on a matrix described in sparse coordinate format.

Input arguments

  • n::Int: the matrix size
  • cols::Vector{T<:Integer}: array of column indices for the lower triangle
  • rows::Vector{T<:Integer}: array of row indices for the lower triangle
  • nzval::Vector{T}: array of values for the lower triangle

Keyword arguments

All keyword arguments are passed directly to the ma97_control constructor.

source
HSL.ma97_cscFunction

Instantiate and perform symbolic analysis using CSC arrays

M = ma97_csc(n, colptr, rowval, nzval; kwargs...)

Instantiate an object of type Ma97 and perform the symbolic analysis on a matrix described in sparse CSC format.

Input arguments

  • n::Int: the matrix size
  • colptr::Vector{T<:Integer}: CSC colptr array for the lower triangle
  • rowval::Vector{T<:Integer}: CSC rowval array for the lower triangle
  • nzval::Vector{T}: CSC nzval array for the lower triangle

Keyword arguments

All keyword arguments are passed directly to the ma97_control constructor.

source
HSL.ma97_enquireFunction

ma97enquire: see the documentation for `ma97inquire`.

source
HSL.ma97_factoriseFunction

ma97factorise: see the documentation for `ma97factorize`.

source
HSL.ma97_factorise!Function

ma97factorise!: see the documentation for `ma97factorize!`.

source
HSL.ma97_factorizeFunction

Combined Analysis and factorization

M = ma97_factorize(A; kwargs...)

Convenience method that combines the symbolic analysis and numerical factorization phases. An MA97 instance is returned, that can subsequently be passed to other functions, e.g., ma97_solve().

Input Arguments

  • A::SparseMatrixCSC{T,Int}: Julia sparse matrix

Keyword Arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.
source
HSL.ma97_factorize!Function

Perform numerical factorization.

ma97_factorize!(ma97; kwargs...)

The symbolic analysis must have been performed and must have succeeded.

Input Arguments

  • ma97::Ma97{T}: an Ma97 structure for which the analysis has been performed

Keyword Arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.
source
HSL.ma97_inquireFunction

Inquire about a factorization or solve

ma97_inquire(ma97; kwargs...)

Obtain information on the pivots after a successful factorization or solve.

Input Arguments

  • ma97::Ma97{T}: an Ma97 structure for which the analysis and factorization have been performed

Keyword arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.

Return values

An inquiry on a real or complex indefinite matrix returns two vectors:

  • piv_order: contains the pivot sequence; a negative value indicates that the corresponding variable is part of a 2x2 pivot,
  • d: a 2 by n array whose first row contains the diagonal of D⁻¹ in the factorization, and whose nonzeros in the second row contain the off-diagonals.

An inquiry on a positive definite matrix returns one vector with the pivot values.

source
HSL.ma97_least_squaresMethod

Solve least-squares problem

ma97_least_squares(A, b)

Solve the least-squares problem

minimize ‖Ax - b‖₂

where A has shape m-by-n with m > n, by solving the saddle-point system

[ I   A ] [ r ]   [ b ]
-[ Aᴴ    ] [ x ] = [ 0 ].

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix of shape m-by-n with m > n. A full matrix will be converted to sparse.
  • b::Vector{T}: right-hand side vector

Return value

  • x::Vector{T}: solution vector.
source
HSL.ma97_min_normMethod

Solve a minimum-norm problem

ma97_min_norm(A, b)

solves

minimize ‖x‖₂  subject to Ax = b,

where A has shape m-by-n with m < n, by solving the saddle-point system

[ I  Aᴴ ] [ x ]   [ 0 ]
-[ A     ] [ y ] = [ b ].

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix of shape m-by-n with m < n. A full matrix will be converted to sparse.
  • b::Vector{T}: right-hand side vector.

Return value

  • x::Vector{T}: solution vector.
source
HSL.ma97_solveFunction

System solve

Solve after factorization

ma97_solve(ma97, b; kwargs...)

Input arguments

  • ma97::Ma97{T}: an Ma97 structure for which the analysis and factorization have been performed
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.

Keyword arguments

  • job::Symbol=:A: task to perform. Accepted values are
    • :A: solve Ax = b
    • :PL: solve PLx = Sb
    • :D: solve Dx = b
    • :LPS: solve L'P'S⁻¹x = b
    • :DLPS: solve DL'P'S⁻¹x = b.

Return values

  • x::Array{T}: an array of the same size as b containing the solutions.

Combined analysis, factorization and solve

ma97_solve(A, b; kwargs...)

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix. A full matrix will be converted to sparse.
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.

Keyword arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.

Return values

  • x::Array{T}: an array of the same size as b containing the solutions.
source
HSL.ma97_solve!Function

In-place system solve

See the documentation for ma97_solve(). The only difference is that the right-hand side b is overwritten with the solution.

source
HSL.mc21Method
p = mc21(A::SparseMatrixCSC; sym::Bool=false)

Given a sparse matrix A, this function attempts to find a column permutation p that makes the matrix A[:,p] have nonzeros on its diagonal.

source
HSL.mc77Function
mc77(A::SparseMatrixCSC{T}, job::Integer)
+true
source
HSL.ma57_solve!Function
ma57_solve!(ma57, b, work; job::Symbol = :A)

Solve a symmetric linear system ma57 * x = b, overwriting b to store x. work should be a Vector{eltype(b)} of length ma57.n * size(b, 2). The symbolic analysis and numerical factorization must have been performed and must have succeeded.

Solve with iterative refinement

ma57_solve!(ma57, b, x, resid, work, nitref)

Solve a symmetric linear system ma57 * x = b with iterative refinement. ma57.control.icntl[9] should have been set to the maximum number of iterative refinements wanted. resid should be a storage Vector{eltype(b)} of size ma57.n work should be a storage Vector{eltype(b)} of size ma57.n if ma57.control.icntl[9] == 1, and of size 4 * ma57.n otherwise. The symbolic analysis and numerical factorization must have been performed and must have succeeded.

source
HSL.ma97_coordFunction

Instantiate and perform symbolic analysis using coordinate arrays

M = ma97_coord(n, cols, rows, nzval; kwargs...)

Instantiate an object of type Ma97 and perform the symbolic analysis on a matrix described in sparse coordinate format.

Input arguments

  • n::Int: the matrix size
  • cols::Vector{T<:Integer}: array of column indices for the lower triangle
  • rows::Vector{T<:Integer}: array of row indices for the lower triangle
  • nzval::Vector{T}: array of values for the lower triangle

Keyword arguments

All keyword arguments are passed directly to the ma97_control constructor.

source
HSL.ma97_cscFunction

Instantiate and perform symbolic analysis using CSC arrays

M = ma97_csc(n, colptr, rowval, nzval; kwargs...)

Instantiate an object of type Ma97 and perform the symbolic analysis on a matrix described in sparse CSC format.

Input arguments

  • n::Int: the matrix size
  • colptr::Vector{T<:Integer}: CSC colptr array for the lower triangle
  • rowval::Vector{T<:Integer}: CSC rowval array for the lower triangle
  • nzval::Vector{T}: CSC nzval array for the lower triangle

Keyword arguments

All keyword arguments are passed directly to the ma97_control constructor.

source
HSL.ma97_enquireFunction

ma97enquire: see the documentation for `ma97inquire`.

source
HSL.ma97_factoriseFunction

ma97factorise: see the documentation for `ma97factorize`.

source
HSL.ma97_factorise!Function

ma97factorise!: see the documentation for `ma97factorize!`.

source
HSL.ma97_factorizeFunction

Combined Analysis and factorization

M = ma97_factorize(A; kwargs...)

Convenience method that combines the symbolic analysis and numerical factorization phases. An MA97 instance is returned, that can subsequently be passed to other functions, e.g., ma97_solve().

Input Arguments

  • A::SparseMatrixCSC{T,Int}: Julia sparse matrix

Keyword Arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.
source
HSL.ma97_factorize!Function

Perform numerical factorization.

ma97_factorize!(ma97; kwargs...)

The symbolic analysis must have been performed and must have succeeded.

Input Arguments

  • ma97::Ma97{T}: an Ma97 structure for which the analysis has been performed

Keyword Arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.
source
HSL.ma97_inquireFunction

Inquire about a factorization or solve

ma97_inquire(ma97; kwargs...)

Obtain information on the pivots after a successful factorization or solve.

Input Arguments

  • ma97::Ma97{T}: an Ma97 structure for which the analysis and factorization have been performed

Keyword arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.

Return values

An inquiry on a real or complex indefinite matrix returns two vectors:

  • piv_order: contains the pivot sequence; a negative value indicates that the corresponding variable is part of a 2x2 pivot,
  • d: a 2 by n array whose first row contains the diagonal of D⁻¹ in the factorization, and whose nonzeros in the second row contain the off-diagonals.

An inquiry on a positive definite matrix returns one vector with the pivot values.

source
HSL.ma97_least_squaresMethod

Solve least-squares problem

ma97_least_squares(A, b)

Solve the least-squares problem

minimize ‖Ax - b‖₂

where A has shape m-by-n with m > n, by solving the saddle-point system

[ I   A ] [ r ]   [ b ]
+[ Aᴴ    ] [ x ] = [ 0 ].

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix of shape m-by-n with m > n. A full matrix will be converted to sparse.
  • b::Vector{T}: right-hand side vector

Return value

  • x::Vector{T}: solution vector.
source
HSL.ma97_min_normMethod

Solve a minimum-norm problem

ma97_min_norm(A, b)

solves

minimize ‖x‖₂  subject to Ax = b,

where A has shape m-by-n with m < n, by solving the saddle-point system

[ I  Aᴴ ] [ x ]   [ 0 ]
+[ A     ] [ y ] = [ b ].

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix of shape m-by-n with m < n. A full matrix will be converted to sparse.
  • b::Vector{T}: right-hand side vector.

Return value

  • x::Vector{T}: solution vector.
source
HSL.ma97_solveFunction

System solve

Solve after factorization

ma97_solve(ma97, b; kwargs...)

Input arguments

  • ma97::Ma97{T}: an Ma97 structure for which the analysis and factorization have been performed
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.

Keyword arguments

  • job::Symbol=:A: task to perform. Accepted values are
    • :A: solve Ax = b
    • :PL: solve PLx = Sb
    • :D: solve Dx = b
    • :LPS: solve L'P'S⁻¹x = b
    • :DLPS: solve DL'P'S⁻¹x = b.

Return values

  • x::Array{T}: an array of the same size as b containing the solutions.

Combined analysis, factorization and solve

ma97_solve(A, b; kwargs...)

Input arguments

  • A::SparseMatrixCSC{T,Int}: input matrix. A full matrix will be converted to sparse.
  • b::Array{T}: vector of array of right-hand sides. Note that b will be overwritten. To solve a system with multiple right-hand sides, b should have size n by nrhs.

Keyword arguments

  • matrix_type::Symbol=:real_indef: indicates the matrix type. Accepted values are
    • :real_spd for a real symmetric and positive definite matrix
    • :real_indef for a real symmetric and indefinite matrix.

Return values

  • x::Array{T}: an array of the same size as b containing the solutions.
source
HSL.ma97_solve!Function

In-place system solve

See the documentation for ma97_solve(). The only difference is that the right-hand side b is overwritten with the solution.

source
HSL.mc21Method
p = mc21(A::SparseMatrixCSC; sym::Bool=false)

Given a sparse matrix A, this function attempts to find a column permutation p that makes the matrix A[:,p] have nonzeros on its diagonal.

source
HSL.mc77Function
mc77(A::SparseMatrixCSC{T}, job::Integer)
 mc77(A::Matrix{T}, job::Integer)
-mc77(m::Integer, n::Integer, rows::Vector{Int32}, cols::Vector{Int32}, nzval::Vector{T}, job::Integer)
  • job=0 Equilibrate the infinity norm of rows and columns in matrix A.
  • job=p Equilibrate the p-th norm (p ≥ 1) of rows and columns in A.
  • job=-1 Equilibrate the p-th norm of rows and columns in A, with p ≥ 1 real. The value of p is given in CNTL[2].

Let A be an m × n real matrix, and ‖•‖ₚ, p ∈ [1, ∞] a p-norm for real vectors. mc77 computes the scaling diagonal matrices Dr and Dc such that the p-norms of all columns and rows of A̅ = (Dr)⁻¹A(Dc)⁻¹ are approximately equal to 1.

When A is symmetric Dr = Dc. In the case m ≠ n, mc77 allows the use of the ∞-norm only.

source
+mc77(m::Integer, n::Integer, rows::Vector{Int32}, cols::Vector{Int32}, nzval::Vector{T}, job::Integer)

Let A be an m × n real matrix, and ‖•‖ₚ, p ∈ [1, ∞] a p-norm for real vectors. mc77 computes the scaling diagonal matrices Dr and Dc such that the p-norms of all columns and rows of A̅ = (Dr)⁻¹A(Dc)⁻¹ are approximately equal to 1.

When A is symmetric Dr = Dc. In the case m ≠ n, mc77 allows the use of the ∞-norm only.

source diff --git a/dev/tutorial/index.html b/dev/tutorial/index.html index 9b0dda9..2faab5a 100644 --- a/dev/tutorial/index.html +++ b/dev/tutorial/index.html @@ -51,4 +51,4 @@ ## solve least squares K_ls = K[:,1:200] -r_ls, x_ls = ma57_least_squares(K_ls, rhs) # == ma57_solve(K_ls, rhs) +r_ls, x_ls = ma57_least_squares(K_ls, rhs) # == ma57_solve(K_ls, rhs)