Skip to content

Commit e9996f2

Browse files
committed
Documentation: update exported, fix formatting
1 parent bd273ec commit e9996f2

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

docs/src/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ Please cite both [SuiteSparse](https://github.com/DrTimothyAldenDavis/SuiteSpars
4646

4747
```@docs
4848
klu
49+
klu!
50+
klu_refactor!
51+
nonzeros
52+
solve!
4953
```

src/KLU.jl

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using SparseArrays: SparseMatrixCSC
55
import SparseArrays: nnz, nonzeros
66

77
export klu, klu!
8-
export klu_analyze!, klu_factor!, klu_refactor!, solve!
8+
export klu_factor!, klu_refactor!, solve!
99
export nonzeros
1010

1111
const libklu = :libklu
@@ -68,10 +68,10 @@ Data structure for parameters of and statistics generated by KLU functions.
6868
# Fields
6969
- `tol::Float64`: Partial pivoting tolerance for diagonal preference
7070
- `btf::Int64`: If `btf != 0` use BTF pre-ordering
71-
- `ordering::Int64`: If `ordering == 0` use AMD to permute, if `ordering == 1` use COLAMD,
71+
- `ordering::Int64`: If `ordering == 0` use AMD to permute, if `ordering == 1` use COLAMD, \
7272
if `ordering == 3` use the user provided ordering function.
73-
- `scale::Int64`: If `scale == 1` then `A[:,i] ./= sum(abs.(A[:,i]))`, if `scale == 2` then
74-
`A[:,i] ./= maximum(abs.(A[:,i]))`. If `scale == 0` no scaling is done, and the input is
73+
- `scale::Int64`: If `scale == 1` then `A[:,i] ./= sum(abs.(A[:,i]))`, if `scale == 2` then \
74+
`A[:,i] ./= maximum(abs.(A[:,i]))`. If `scale == 0` no scaling is done, and the input is \
7575
checked for errors if `scale >= 0`.
7676
7777
See the [KLU User Guide](https://github.com/DrTimothyAldenDavis/SuiteSparse/raw/master/KLU/Doc/KLU_UserGuide.pdf)
@@ -184,12 +184,12 @@ end
184184

185185
nnz(K::AbstractKLUFactorization) = K.lnz + K.unz + K.nzoff
186186
"""The nonzeros of the factorization `K`.
187-
!!! warning "`nonzeros(K)` may or may not point to `nonzeros(A)`"
188-
After `K = klu(A)`, it may or may not be the case that `nonzeros(K) === nonzeros(A)`.
189-
If `A` is of type `SparseMatrixCSC{Float32, Int64}`, then `nonzeros(F)` will be
190-
a `Vector{Float64}`, while `nonzeros(A)` is a `Vector{Float32}`, so they're definitely distinct.
191-
On the other hand, if `A` has value type `Float64`, then changing the values in `nonzeros(A)`
192-
will change `nonzeros(F)` as well.
187+
!!! warning "nonzeros(K) may or may not point to nonzeros(A)"
188+
After `K = klu(A)`, it may or may not be the case that `nonzeros(K) === nonzeros(A)`. \
189+
If `A` is of type `SparseMatrixCSC{Float32, Int64}`, then `nonzeros(K)` will be \
190+
a `Vector{Float64}`, while `nonzeros(A)` is a `Vector{Float32}`, so they're definitely distinct. \
191+
On the other hand, if `A` has value type `Float64`, then changing the values in `nonzeros(A)` \
192+
will change `nonzeros(K)` as well.
193193
"""
194194
nonzeros(K::AbstractKLUFactorization) = K.nzval
195195

@@ -383,7 +383,10 @@ function show(io::IO, mime::MIME{Symbol("text/plain")}, K::AbstractKLUFactorizat
383383
end
384384
end
385385

386-
"""Compute and store (as `K._symbolic`) a symbolic factorization of the sparse matrix
386+
"""
387+
klu_analyze!(K::KLUFactorization; check = true)
388+
389+
Compute and store (as `K._symbolic`) a symbolic factorization of the sparse matrix \
387390
represented by the fields of `K`."""
388391
function klu_analyze!(K::KLUFactorization{Tv, Ti}; check=true) where {Tv, Ti<:KLUITypes}
389392
if K._symbolic != C_NULL return K end
@@ -396,7 +399,10 @@ function klu_analyze!(K::KLUFactorization{Tv, Ti}; check=true) where {Tv, Ti<:KL
396399
return K
397400
end
398401

399-
"""Variant of `klu_analyze!` that allows for user-provided permutation permutation vectors `P` and `Q`."""
402+
"""
403+
klu_analyze!(K::KLUFactorization{Tv, Ti}, P::Vector{Ti}, Q::Vector{Ti}; check = true)
404+
405+
Variant of `klu_analyze!` that allows for user-provided permutation permutation vectors `P` and `Q`."""
400406
function klu_analyze!(K::KLUFactorization{Tv, Ti}, P::Vector{Ti}, Q::Vector{Ti}; check=true) where {Tv, Ti<:KLUITypes}
401407
if K._symbolic != C_NULL return K end
402408
sym = __analyze!(K.n, K.colptr, K.rowval, P, Q, Ref(K.common))
@@ -487,11 +493,11 @@ existing `KLUFactorization` instance.
487493
# Arguments
488494
- `K::KLUFactorization`: The matrix factorization object to be factored.
489495
- `check::Bool`: If `true` (default) check for errors after the factorization. If `false` errors must be checked by the user with `klu.common.status`.
490-
- `allowsingular::Bool`: If `true` (default `false`) allow the factorization to proceed even if the matrix is singular. Note that this will allow for
491-
silent divide by zero errors in subsequent `solve!` or `ldiv!` calls if singularity is not checked by the user with `klu.common.status == KLU.KLU_SINGULAR`
496+
- `allowsingular::Bool`: If `true` (default `false`) allow the factorization to proceed even if the matrix is singular. Note that this will allow for \
497+
silent divide by zero errors in subsequent `solve!` or `ldiv!` calls if singularity is not checked by the user with `klu.common.status == KLU.KLU_SINGULAR`
492498
493-
The `K.common` struct can be used to modify certain options and parameters, see the
494-
[KLU documentation](https://github.com/DrTimothyAldenDavis/SuiteSparse/raw/master/KLU/Doc/KLU_UserGuide.pdf)
499+
The `K.common` struct can be used to modify certain options and parameters, see the \
500+
[KLU documentation](https://github.com/DrTimothyAldenDavis/SuiteSparse/raw/master/KLU/Doc/KLU_UserGuide.pdf) \
495501
or [`klu_common`](@ref) for more information.
496502
"""
497503
klu_factor!
@@ -529,9 +535,9 @@ The relation between `K` and `A` is
529535
# Arguments
530536
- `A::SparseMatrixCSC` or `n::Integer`, `colptr::Vector{Ti}`, `rowval::Vector{Ti}`, `nzval::Vector{Tv}`: The sparse matrix or the zero-based sparse matrix components to be factored.
531537
- `check::Bool`: If `true` (default) check for errors after the factorization. If `false` errors must be checked by the user with `klu.common.status`.
532-
- `allowsingular::Bool`: If `true` (default `false`) allow the factorization to proceed even if the matrix is singular. Note that this will allow for
533-
silent divide by zero errors in subsequent `solve!` or `ldiv!` calls if singularity is not checked by the user with `klu.common.status == KLU.KLU_SINGULAR`
534-
- `full_factor::Bool`: if `true` (default), perform both numeric and symbolic factorization. If `false`, only perform symbolic factorization.
538+
- `allowsingular::Bool`: If `true` (default `false`) allow the factorization to proceed even if the matrix is singular.\
539+
Note that this will allow for silent divide by zero errors in subsequent `solve!` or `ldiv!` calls if singularity is not checked by the user with `klu.common.status == KLU.KLU_SINGULAR`
540+
- `full_factor::Bool`: if `true` (default), perform both numeric and symbolic factorization. If `false`, only perform symbolic factorization. \
535541
Useful for cases where only the sparse structure of `A` is known at time of construction.
536542
537543
!!! note
@@ -607,7 +613,7 @@ See also: [`klu`](@ref)
607613
- `A::SparseMatrixCSC` or `n::Integer`, `colptr::Vector{Ti}`, `rowval::Vector{Ti}`, `nzval::Vector{Tv}`: The sparse matrix or the zero-based sparse matrix components to be factored.
608614
- `check::Bool`: If `true` (default) check for errors after the factorization. If `false` errors must be checked by the user with `klu.common.status`.
609615
- `allowsingular::Bool`: If `true` (default `false`) allow the factorization to proceed even if the matrix is singular. Note that this will allow for
610-
silent divide by zero errors in subsequent `solve!` or `ldiv!` calls if singularity is not checked by the user with `klu.common.status == KLU.KLU_SINGULAR`
616+
silent divide by zero errors in subsequent `solve!` or `ldiv!` calls if singularity is not checked by the user with `klu.common.status == KLU.KLU_SINGULAR`
611617
612618
!!! note
613619
`klu(A::SparseMatrixCSC)` uses the KLU[^ACM907] library that is part of

0 commit comments

Comments
 (0)