Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SparseArrays an extension #570

Merged
merged 31 commits into from
Feb 5, 2025
Merged

Make SparseArrays an extension #570

merged 31 commits into from
Feb 5, 2025

Conversation

ChrisRackauckas
Copy link
Member

We shouldn't need to load all of the sparse arrays infrastructure unless the user is using sparse arrays. There are a few things that need to be done here:

  1. KLU.jl code needs to be copied so we can default to KLU calls without requiring a user-level using KLU
  2. Some functions are made which only get a useful dispatch after using SparseArrays is loaded, but that should be sufficiently safe

But one big issue is that Krylov.jl has a dependency on SparseArrays, so we'd either need to drop it as a dependency and a new Krylov library, or fix Krylov.jl to make it an extension.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

for i 1:(length(Fp) - 1)


[JuliaFormatter] reported by reviewdog 🐶

last = Fp[i+1]


[JuliaFormatter] reported by reviewdog 🐶

return SparseMatrixCSC(klu.n, klu.n, increment!(p), increment!(i), Complex.(x, z))


[JuliaFormatter] reported by reviewdog 🐶

function LinearAlgebra.issuccess(K::AbstractKLUFactorization; allowsingular=false)
return (allowsingular ? K.common.status >= KLU_OK : K.common.status == KLU_OK) && K._numeric != C_NULL


[JuliaFormatter] reported by reviewdog 🐶

summary(io, K); println(io)


[JuliaFormatter] reported by reviewdog 🐶

function klu_analyze!(K::KLUFactorization{Tv, Ti}; check=true) where {Tv, Ti<:KLUITypes}
if K._symbolic != C_NULL return K end


[JuliaFormatter] reported by reviewdog 🐶

function klu_analyze!(K::KLUFactorization{Tv, Ti}, P::Vector{Ti}, Q::Vector{Ti}; check=true) where {Tv, Ti<:KLUITypes}
if K._symbolic != C_NULL return K end


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

function klu_factor!(K::KLUFactorization{$Tv, $Ti}; check=true, allowsingular=false)


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

ok = $rgrowth(K.colptr, K.rowval, K.nzval, K._symbolic, K._numeric, Ref(K.common))


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

- `K::KLUFactorization`: The matrix factorization object to be factored.


[JuliaFormatter] reported by reviewdog 🐶

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`


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

|:----------|:-----------------------------------------------------------------|


[JuliaFormatter] reported by reviewdog 🐶

- `LinearAlgebra.\\`


[JuliaFormatter] reported by reviewdog 🐶

- `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.


[JuliaFormatter] reported by reviewdog 🐶

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`


[JuliaFormatter] reported by reviewdog 🐶

`klu(A::SparseMatrixCSC)` uses the KLU[^ACM907] library that is part of


[JuliaFormatter] reported by reviewdog 🐶

function klu(n, colptr::Vector{Ti}, rowval::Vector{Ti}, nzval::Vector{Tv}; check=true, allowsingular=false) where {Ti<:KLUITypes, Tv<:AbstractFloat}


[JuliaFormatter] reported by reviewdog 🐶

function klu(n, colptr::Vector{Ti}, rowval::Vector{Ti}, nzval::Vector{Tv}; check=true, allowsingular=false) where {Ti<:KLUITypes, Tv<:Complex}


[JuliaFormatter] reported by reviewdog 🐶

function klu(A::SparseMatrixCSC{Tv, Ti}; check=true, allowsingular=false) where {Tv<:Union{AbstractFloat, Complex}, Ti<:KLUITypes}


[JuliaFormatter] reported by reviewdog 🐶

matrix used to create `K` must match the pattern of `A`.


[JuliaFormatter] reported by reviewdog 🐶

- `K::KLUFactorization`: The matrix factorization object, previously created by a call to `klu`, to be re-factored.


[JuliaFormatter] reported by reviewdog 🐶

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`


[JuliaFormatter] reported by reviewdog 🐶

`klu(A::SparseMatrixCSC)` uses the KLU[^ACM907] library that is part of


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::KLUFactorization{$Tv, $Ti}, nzval::Vector{$Tv}; check=true, allowsingular=false)
length(nzval) != length(K.nzval) && throw(DimensionMismatch())


[JuliaFormatter] reported by reviewdog 🐶

ok = $refactor(K.colptr, K.rowval, K.nzval, K._symbolic, K._numeric, Ref(K.common))


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::AbstractKLUFactorization{ComplexF64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:Complex}


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::AbstractKLUFactorization{Float64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:AbstractFloat}


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U}; check=true, allowsingular=false) where {U}


[JuliaFormatter] reported by reviewdog 🐶

(decrement!(K.colptr); decrement!(K.rowval);


[JuliaFormatter] reported by reviewdog 🐶

- `klu::KLUFactorization`: The matrix factorization of `A` to use in the solution.


[JuliaFormatter] reported by reviewdog 🐶

If the factorization object `klu` has `klu.common.status == KLU.KLU_SINGULAR` then the `solve!` or `ldiv!` will result in a silent divide by zero error.


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

function solve!(klu::AbstractKLUFactorization{$Tv, $Ti}, B::StridedVecOrMat{$Tv}; check=true)


[JuliaFormatter] reported by reviewdog 🐶

isok = $solve(klu._symbolic, klu._numeric, size(B, 1), size(B, 2), B, Ref(klu.common))


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

call = :($tsolve(klu._symbolic, klu._numeric, size(B, 1), size(B, 2), B, conj, Ref(klu.common)))


[JuliaFormatter] reported by reviewdog 🐶

call = :($tsolve(klu._symbolic, klu._numeric, size(B, 1), size(B, 2), B, Ref(klu.common)))


[JuliaFormatter] reported by reviewdog 🐶

function solve!(klu::AdjointFact{$Tv, K}, B::StridedVecOrMat{$Tv}; check=true) where {K<:AbstractKLUFactorization{$Tv, $Ti}}


[JuliaFormatter] reported by reviewdog 🐶

function solve!(klu::TransposeFact{$Tv, K}, B::StridedVecOrMat{$Tv}; check=true) where {K<: AbstractKLUFactorization{$Tv, $Ti}}


[JuliaFormatter] reported by reviewdog 🐶

function solve(klu, B; check=true)


[JuliaFormatter] reported by reviewdog 🐶

LinearAlgebra.ldiv!(klu::AbstractKLUFactorization{Tv}, B::StridedVecOrMat{Tv}) where {Tv<:KLUTypes} =


[JuliaFormatter] reported by reviewdog 🐶

LinearAlgebra.ldiv!(klu::Union{AdjointFact{Tv, K},TransposeFact{Tv, K}}, B::StridedVecOrMat{Tv}) where {Tv, Ti, K<:AbstractKLUFactorization{Tv, Ti}} =


[JuliaFormatter] reported by reviewdog 🐶

function LinearAlgebra.ldiv!(klu::AbstractKLUFactorization{<:AbstractFloat}, B::StridedVecOrMat{<:Complex})


[JuliaFormatter] reported by reviewdog 🐶

function LinearAlgebra.ldiv!(klu::Union{AdjointFact{Tv, K},TransposeFact{Tv, K}}, B::StridedVecOrMat{<:Complex}) where {Tv<:AbstractFloat, Ti, K<:AbstractKLUFactorization{Tv, Ti}}


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_malloc_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), malloc_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_calloc_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), calloc_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_realloc_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), realloc_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_free_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), free_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_printf_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), printf_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_hypot_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), hypot_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_divcomplex_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), divcomplex_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), n, s)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), arg1, s)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_hypot, libsuitesparseconfig), Cdouble, (Cdouble, Cdouble), x, y)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_divcomplex, libsuitesparseconfig), Cint, (Cdouble, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), xr, xi, yr, yi, zr, zi)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_malloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), nitems, size_of_item)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), nitems, size_of_item)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{Cint}), nitems_new, nitems_old, size_of_item, p, ok)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_divcomplex, libsuitesparseconfig), Cint, (Cdouble, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), ar, ai, br, bi, cr, ci)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_order, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}), n, Ap, Ai, P, Control, Info)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_l_order, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}), n, Ap, Ai, P, Control, Info)
end
function amd_2(n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
ccall((:amd_2, libamd), Cvoid, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}), n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
end
function amd_l2(n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
ccall((:amd_l2, libamd), Cvoid, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}), n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_valid, libamd), Cint, (Int32, Int32, Ptr{Int32}, Ptr{Int32}), n_row, n_col, Ap, Ai)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_l_valid, libamd), Cint, (Int64, Int64, Ptr{Int64}, Ptr{Int64}), n_row, n_col, Ap, Ai)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd_l_recommended, libamd), Csize_t, (Int64, Int64, Int64), nnz, n_row, n_col)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd, libamd), Cint, (Int32, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}), n_row, n_col, Alen, A, p, knobs, stats)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd_l, libamd), Cint, (Int64, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}), n_row, n_col, Alen, A, p, knobs, stats)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd_l, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_maxtrans, libbtf), Int32, (Int32, Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}), nrow, ncol, Ap, Ai, maxwork, work, Match, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_maxtrans, libbtf), Int64, (Int64, Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_strongcomp, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, Q, P, R, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_strongcomp, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_order, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, maxwork, work, P, Q, R, nmatch, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_order, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze_given, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, P, Q, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze_given, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Cint, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, conj_solve, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Cint, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_symbolic}}, Ptr{klu_common}), Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_l_symbolic}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
end
function klu_extract(Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
ccall((:klu_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
end
function klu_z_extract(Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
ccall((:klu_z_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
end
function klu_l_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
ccall((:klu_l_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
end
function klu_zl_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)
ccall((:klu_zl_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_common}), n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_common}), p, n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_common}), nnew, nold, size, p, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3, arg4)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

const SUITESPARSE_VERSION = SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION, SUITESPARSE_SUB_VERSION)


[JuliaFormatter] reported by reviewdog 🐶

const KLU_VERSION = KLU_VERSION_CODE(KLU_MAIN_VERSION, KLU_SUB_VERSION)

src/KLU/klu.jl Outdated
Comment on lines 15 to 16
function decrement!(A::AbstractArray{T}) where T<:Integer
for i in eachindex(A); A[i] -= oneunit(T) end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function decrement!(A::AbstractArray{T}) where T<:Integer
for i in eachindex(A); A[i] -= oneunit(T) end
function decrement!(A::AbstractArray{T}) where {T <: Integer}
for i in eachindex(A)
A[i] -= oneunit(T)
end

src/KLU/klu.jl Outdated
Comment on lines 22 to 23
function increment!(A::AbstractArray{T}) where T<:Integer
for i in eachindex(A); A[i] += oneunit(T) end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function increment!(A::AbstractArray{T}) where T<:Integer
for i in eachindex(A); A[i] += oneunit(T) end
function increment!(A::AbstractArray{T}) where {T <: Integer}
for i in eachindex(A)
A[i] += oneunit(T)
end

src/KLU/klu.jl Outdated
Comment on lines 30 to 31
const AdjointFact = isdefined(LinearAlgebra, :AdjointFactorization) ? LinearAlgebra.AdjointFactorization : Adjoint
const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ? LinearAlgebra.TransposeFactorization : Transpose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
const AdjointFact = isdefined(LinearAlgebra, :AdjointFactorization) ? LinearAlgebra.AdjointFactorization : Adjoint
const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ? LinearAlgebra.TransposeFactorization : Transpose
const AdjointFact = isdefined(LinearAlgebra, :AdjointFactorization) ?
LinearAlgebra.AdjointFactorization : Adjoint
const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ?
LinearAlgebra.TransposeFactorization : Transpose

src/KLU/klu.jl Outdated
Comment on lines 66 to 72
- `tol::Float64`: Partial pivoting tolerance for diagonal preference
- `btf::Int64`: If `btf != 0` use BTF pre-ordering
- `ordering::Int64`: If `ordering == 0` use AMD to permute, if `ordering == 1` use COLAMD,
if `ordering == 3` use the user provided ordering function.
- `scale::Int64`: If `scale == 1` then `A[:,i] ./= sum(abs.(A[:,i]))`, if `scale == 2` then
`A[:,i] ./= maximum(abs.(A[:,i]))`. If `scale == 0` no scaling is done, and the input is
checked for errors if `scale >= 0`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
- `tol::Float64`: Partial pivoting tolerance for diagonal preference
- `btf::Int64`: If `btf != 0` use BTF pre-ordering
- `ordering::Int64`: If `ordering == 0` use AMD to permute, if `ordering == 1` use COLAMD,
if `ordering == 3` use the user provided ordering function.
- `scale::Int64`: If `scale == 1` then `A[:,i] ./= sum(abs.(A[:,i]))`, if `scale == 2` then
`A[:,i] ./= maximum(abs.(A[:,i]))`. If `scale == 0` no scaling is done, and the input is
checked for errors if `scale >= 0`.
- `tol::Float64`: Partial pivoting tolerance for diagonal preference
- `btf::Int64`: If `btf != 0` use BTF pre-ordering
- `ordering::Int64`: If `ordering == 0` use AMD to permute, if `ordering == 1` use COLAMD,
if `ordering == 3` use the user provided ordering function.
- `scale::Int64`: If `scale == 1` then `A[:,i] ./= sum(abs.(A[:,i]))`, if `scale == 2` then
`A[:,i] ./= maximum(abs.(A[:,i]))`. If `scale == 0` no scaling is done, and the input is
checked for errors if `scale >= 0`.

src/KLU/klu.jl Outdated

function _klu_name(name, Tv, Ti)
outname = "klu_" * (Tv === :Float64 ? "" : "z") * (Ti === :Int64 ? "l_" : "_") * name
return Symbol(replace(outname, "__"=>"_"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return Symbol(replace(outname, "__"=>"_"))
return Symbol(replace(outname, "__" => "_"))

src/KLU/klu.jl Outdated
end
end

function getproperty(klu::AbstractKLUFactorization{Tv, Ti}, s::Symbol) where {Tv<:KLUTypes, Ti<:KLUITypes}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function getproperty(klu::AbstractKLUFactorization{Tv, Ti}, s::Symbol) where {Tv<:KLUTypes, Ti<:KLUITypes}
function getproperty(klu::AbstractKLUFactorization{Tv, Ti},
s::Symbol) where {Tv <: KLUTypes, Ti <: KLUITypes}

src/KLU/klu.jl Outdated
function getproperty(klu::AbstractKLUFactorization{Tv, Ti}, s::Symbol) where {Tv<:KLUTypes, Ti<:KLUITypes}
# Forwards to the numeric struct:
if s ∈ (:lnz, :unz, :nzoff)
klu._numeric == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been factored. Try `klu_factor!`."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
klu._numeric == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been factored. Try `klu_factor!`."))
klu._numeric == C_NULL &&
throw(ArgumentError("This KLUFactorization has not yet been factored. Try `klu_factor!`."))

src/KLU/klu.jl Outdated
return getproperty(klu.numeric, s)
end
if s ∈ (:nblocks, :maxblock)
klu._symbolic == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been analyzed. Try `klu_analyze!`."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
klu._symbolic == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been analyzed. Try `klu_analyze!`."))
klu._symbolic == C_NULL &&
throw(ArgumentError("This KLUFactorization has not yet been analyzed. Try `klu_analyze!`."))

src/KLU/klu.jl Outdated
return getproperty(klu.symbolic, s)
end
if s === :symbolic
klu._symbolic == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been analyzed. Try `klu_analyze!`."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
klu._symbolic == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been analyzed. Try `klu_analyze!`."))
klu._symbolic == C_NULL &&
throw(ArgumentError("This KLUFactorization has not yet been analyzed. Try `klu_analyze!`."))

src/KLU/klu.jl Outdated
end
end
if s === :numeric
klu._numeric == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been factored. Try `klu_factor!`."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
klu._numeric == C_NULL && throw(ArgumentError("This KLUFactorization has not yet been factored. Try `klu_factor!`."))
klu._numeric == C_NULL &&
throw(ArgumentError("This KLUFactorization has not yet been factored. Try `klu_factor!`."))

ChrisRackauckas added a commit to ChrisRackauckas/Krylov.jl that referenced this pull request Feb 1, 2025
While this may seem a bit weird since the most normal case for Krylov subspace methods is on sparse arrays, there are multiple reasons for this.

1. SparseArrays pulls in SuiteSparse and thus GPL dependencies
2. This is by far the biggest part of the load. Normal Krylov.jl loads in about 8ms, but the SparseArrays part is ~150ms. So if you want to just work on operators, then you'd taking a decently sized hit.
3. This is required for downstream dependency reduction SciML/LinearSolve.jl#570
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

ok = $refactor(K.colptr, K.rowval, K.nzval, K._symbolic, K._numeric, Ref(K.common))


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::AbstractKLUFactorization{ComplexF64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:Complex}


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::AbstractKLUFactorization{Float64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:AbstractFloat}


[JuliaFormatter] reported by reviewdog 🐶

function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U}; check=true, allowsingular=false) where {U}


[JuliaFormatter] reported by reviewdog 🐶

(decrement!(K.colptr); decrement!(K.rowval);


[JuliaFormatter] reported by reviewdog 🐶

- `klu::KLUFactorization`: The matrix factorization of `A` to use in the solution.


[JuliaFormatter] reported by reviewdog 🐶

If the factorization object `klu` has `klu.common.status == KLU.KLU_SINGULAR` then the `solve!` or `ldiv!` will result in a silent divide by zero error.


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

function solve!(klu::AbstractKLUFactorization{$Tv, $Ti}, B::StridedVecOrMat{$Tv}; check=true)


[JuliaFormatter] reported by reviewdog 🐶

isok = $solve(klu._symbolic, klu._numeric, size(B, 1), size(B, 2), B, Ref(klu.common))


[JuliaFormatter] reported by reviewdog 🐶

for Tv KLUValueTypes, Ti KLUIndexTypes


[JuliaFormatter] reported by reviewdog 🐶

call = :($tsolve(klu._symbolic, klu._numeric, size(B, 1), size(B, 2), B, conj, Ref(klu.common)))


[JuliaFormatter] reported by reviewdog 🐶

call = :($tsolve(klu._symbolic, klu._numeric, size(B, 1), size(B, 2), B, Ref(klu.common)))


[JuliaFormatter] reported by reviewdog 🐶

function solve!(klu::AdjointFact{$Tv, K}, B::StridedVecOrMat{$Tv}; check=true) where {K<:AbstractKLUFactorization{$Tv, $Ti}}


[JuliaFormatter] reported by reviewdog 🐶

function solve!(klu::TransposeFact{$Tv, K}, B::StridedVecOrMat{$Tv}; check=true) where {K<: AbstractKLUFactorization{$Tv, $Ti}}


[JuliaFormatter] reported by reviewdog 🐶

function solve(klu, B; check=true)


[JuliaFormatter] reported by reviewdog 🐶

LinearAlgebra.ldiv!(klu::AbstractKLUFactorization{Tv}, B::StridedVecOrMat{Tv}) where {Tv<:KLUTypes} =


[JuliaFormatter] reported by reviewdog 🐶

LinearAlgebra.ldiv!(klu::Union{AdjointFact{Tv, K},TransposeFact{Tv, K}}, B::StridedVecOrMat{Tv}) where {Tv, Ti, K<:AbstractKLUFactorization{Tv, Ti}} =


[JuliaFormatter] reported by reviewdog 🐶

function LinearAlgebra.ldiv!(klu::AbstractKLUFactorization{<:AbstractFloat}, B::StridedVecOrMat{<:Complex})


[JuliaFormatter] reported by reviewdog 🐶

function LinearAlgebra.ldiv!(klu::Union{AdjointFact{Tv, K},TransposeFact{Tv, K}}, B::StridedVecOrMat{<:Complex}) where {Tv<:AbstractFloat, Ti, K<:AbstractKLUFactorization{Tv, Ti}}


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_malloc_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), malloc_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_calloc_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), calloc_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_realloc_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), realloc_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_free_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), free_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_printf_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), printf_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_hypot_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), hypot_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_divcomplex_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), divcomplex_func)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), n, s)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), arg1, s)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_hypot, libsuitesparseconfig), Cdouble, (Cdouble, Cdouble), x, y)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_divcomplex, libsuitesparseconfig), Cint, (Cdouble, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), xr, xi, yr, yi, zr, zi)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_malloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), nitems, size_of_item)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), nitems, size_of_item)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{Cint}), nitems_new, nitems_old, size_of_item, p, ok)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_divcomplex, libsuitesparseconfig), Cint, (Cdouble, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), ar, ai, br, bi, cr, ci)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_order, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}), n, Ap, Ai, P, Control, Info)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_l_order, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}), n, Ap, Ai, P, Control, Info)
end
function amd_2(n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
ccall((:amd_2, libamd), Cvoid, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}), n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
end
function amd_l2(n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
ccall((:amd_l2, libamd), Cvoid, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}), n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_valid, libamd), Cint, (Int32, Int32, Ptr{Int32}, Ptr{Int32}), n_row, n_col, Ap, Ai)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_l_valid, libamd), Cint, (Int64, Int64, Ptr{Int64}, Ptr{Int64}), n_row, n_col, Ap, Ai)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd_l_recommended, libamd), Csize_t, (Int64, Int64, Int64), nnz, n_row, n_col)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd, libamd), Cint, (Int32, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}), n_row, n_col, Alen, A, p, knobs, stats)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd_l, libamd), Cint, (Int64, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}), n_row, n_col, Alen, A, p, knobs, stats)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd_l, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_maxtrans, libbtf), Int32, (Int32, Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}), nrow, ncol, Ap, Ai, maxwork, work, Match, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_maxtrans, libbtf), Int64, (Int64, Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_strongcomp, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, Q, P, R, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_strongcomp, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_order, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, maxwork, work, P, Q, R, nmatch, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_order, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze_given, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, P, Q, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze_given, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Cint, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, conj_solve, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Cint, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_symbolic}}, Ptr{klu_common}), Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_l_symbolic}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
end
function klu_extract(Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
ccall((:klu_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
end
function klu_z_extract(Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
ccall((:klu_z_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
end
function klu_l_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
ccall((:klu_l_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
end
function klu_zl_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)
ccall((:klu_zl_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_common}), n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_common}), p, n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_common}), nnew, nold, size, p, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3, arg4)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

const SUITESPARSE_VERSION = SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION, SUITESPARSE_SUB_VERSION)


[JuliaFormatter] reported by reviewdog 🐶

const KLU_VERSION = KLU_VERSION_CODE(KLU_MAIN_VERSION, KLU_SUB_VERSION)


[JuliaFormatter] reported by reviewdog 🐶

Base.get_extension(@__MODULE__, :LinearSolveRecursiveFactorizationExt)

src/KLU/klu.jl Outdated
Fz = Tv == Float64 ? C_NULL : Vector{Float64}(undef, fnz)
_extract!(klu; Fp, Fi, Fx, Fz)
# F is *not* sorted on output, so we'll have to do it here:
for i ∈ 1:(length(Fp) - 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
for i 1:(length(Fp) - 1)
for i in 1:(length(Fp) - 1)

src/KLU/klu.jl Outdated
for i ∈ 1:(length(Fp) - 1)
# find each segment
first = Fp[i] + 1
last = Fp[i+1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
last = Fp[i+1]
last = Fp[i + 1]

src/KLU/klu.jl Outdated
if Tv == Float64
return SparseMatrixCSC(klu.n, klu.n, increment!(p), increment!(i), x)
else
return SparseMatrixCSC(klu.n, klu.n, increment!(p), increment!(i), Complex.(x, z))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return SparseMatrixCSC(klu.n, klu.n, increment!(p), increment!(i), Complex.(x, z))
return SparseMatrixCSC(
klu.n, klu.n, increment!(p), increment!(i), Complex.(x, z))

src/KLU/klu.jl Outdated
Comment on lines 358 to 359
function LinearAlgebra.issuccess(K::AbstractKLUFactorization; allowsingular=false)
return (allowsingular ? K.common.status >= KLU_OK : K.common.status == KLU_OK) && K._numeric != C_NULL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function LinearAlgebra.issuccess(K::AbstractKLUFactorization; allowsingular=false)
return (allowsingular ? K.common.status >= KLU_OK : K.common.status == KLU_OK) && K._numeric != C_NULL
function LinearAlgebra.issuccess(K::AbstractKLUFactorization; allowsingular = false)
return (allowsingular ? K.common.status >= KLU_OK : K.common.status == KLU_OK) &&
K._numeric != C_NULL

src/KLU/klu.jl Outdated
return (allowsingular ? K.common.status >= KLU_OK : K.common.status == KLU_OK) && K._numeric != C_NULL
end
function show(io::IO, mime::MIME{Symbol("text/plain")}, K::AbstractKLUFactorization)
summary(io, K); println(io)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
summary(io, K); println(io)
summary(io, K)
println(io)

See also: [`klu`](@ref)

# Arguments
- `K::KLUFactorization`: The matrix factorization object, previously created by a call to `klu`, to be re-factored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
- `K::KLUFactorization`: The matrix factorization object, previously created by a call to `klu`, to be re-factored.
- `K::KLUFactorization`: The matrix factorization object, previously created by a call to `klu`, to be re-factored.

src/KLU/klu.jl Outdated
- `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.
- `check::Bool`: If `true` (default) check for errors after the factorization. If `false` errors must be checked by the user with `klu.common.status`.
- `allowsingular::Bool`: If `true` (default `false`) allow the factorization to proceed even if the matrix is singular. 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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
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`
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`

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`

!!! note
`klu(A::SparseMatrixCSC)` uses the KLU[^ACM907] library that is part of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
`klu(A::SparseMatrixCSC)` uses the KLU[^ACM907] library that is part of
`klu(A::SparseMatrixCSC)` uses the KLU[^ACM907] library that is part of

src/KLU/klu.jl Outdated
"""
klu!

for Tv ∈ KLUValueTypes, Ti ∈ KLUIndexTypes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
for Tv KLUValueTypes, Ti KLUIndexTypes
for Tv in KLUValueTypes, Ti in KLUIndexTypes

src/KLU/klu.jl Outdated
Comment on lines 607 to 608
function klu!(K::KLUFactorization{$Tv, $Ti}, nzval::Vector{$Tv}; check=true, allowsingular=false)
length(nzval) != length(K.nzval) && throw(DimensionMismatch())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function klu!(K::KLUFactorization{$Tv, $Ti}, nzval::Vector{$Tv}; check=true, allowsingular=false)
length(nzval) != length(K.nzval) && throw(DimensionMismatch())
function klu!(K::KLUFactorization{$Tv, $Ti}, nzval::Vector{$Tv};
check = true, allowsingular = false)
length(nzval) != length(K.nzval) && throw(DimensionMismatch())

ChrisRackauckas and others added 24 commits February 5, 2025 08:15
RecrusiveFactorization.jl brings in the LoopVectorization.jl stack, and so it's not a small dependency. It is a good thing to default to often, but we can make it a bit more optional in order to greatly decrease load times.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ChrisRackauckas and others added 5 commits February 5, 2025 08:15
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
RecrusiveFactorization.jl brings in the LoopVectorization.jl stack, and so it's not a small dependency. It is a good thing to default to often, but we can make it a bit more optional in order to greatly decrease load times.
We shouldn't need to load all of the sparse arrays infrastructure unless the user is using sparse arrays. There are a few things that need to be done here:

1. KLU.jl code needs to be copied so we can default to KLU calls without requiring a user-level `using KLU`
2. Some functions are made which only get a useful dispatch after using SparseArrays is loaded, but that should be sufficiently safe

But one big issue is that Krylov.jl has a dependency on SparseArrays, so we'd either need to drop it as a dependency and a new Krylov library, or fix Krylov.jl to make it an extension.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_hypot, libsuitesparseconfig), Cdouble, (Cdouble, Cdouble), x, y)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_config_divcomplex, libsuitesparseconfig), Cint, (Cdouble, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), xr, xi, yr, yi, zr, zi)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_malloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), nitems, size_of_item)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), nitems, size_of_item)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{Cint}), nitems_new, nitems_old, size_of_item, p, ok)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:SuiteSparse_divcomplex, libsuitesparseconfig), Cint, (Cdouble, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), ar, ai, br, bi, cr, ci)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_order, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}), n, Ap, Ai, P, Control, Info)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_l_order, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}), n, Ap, Ai, P, Control, Info)
end
function amd_2(n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
ccall((:amd_2, libamd), Cvoid, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}), n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
end
function amd_l2(n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)
ccall((:amd_l2, libamd), Cvoid, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}), n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, Control, Info)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_valid, libamd), Cint, (Int32, Int32, Ptr{Int32}, Ptr{Int32}), n_row, n_col, Ap, Ai)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:amd_l_valid, libamd), Cint, (Int64, Int64, Ptr{Int64}, Ptr{Int64}), n_row, n_col, Ap, Ai)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd_l_recommended, libamd), Csize_t, (Int64, Int64, Int64), nnz, n_row, n_col)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd, libamd), Cint, (Int32, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}), n_row, n_col, Alen, A, p, knobs, stats)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:colamd_l, libamd), Cint, (Int64, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}), n_row, n_col, Alen, A, p, knobs, stats)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd_l, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_maxtrans, libbtf), Int32, (Int32, Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}), nrow, ncol, Ap, Ai, maxwork, work, Match, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_maxtrans, libbtf), Int64, (Int64, Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_strongcomp, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, Q, P, R, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_strongcomp, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_order, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, maxwork, work, P, Q, R, nmatch, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_order, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze_given, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, P, Q, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze_given, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Cint, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, conj_solve, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Cint, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_symbolic}}, Ptr{klu_common}), Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_l_symbolic}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
end
function klu_extract(Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
ccall((:klu_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
end
function klu_z_extract(Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
ccall((:klu_z_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
end
function klu_l_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
ccall((:klu_l_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
end
function klu_zl_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)
ccall((:klu_zl_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_common}), n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_common}), p, n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_common}), nnew, nold, size, p, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3, arg4)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

const SUITESPARSE_VERSION = SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION, SUITESPARSE_SUB_VERSION)


[JuliaFormatter] reported by reviewdog 🐶

const KLU_VERSION = KLU_VERSION_CODE(KLU_MAIN_VERSION, KLU_SUB_VERSION)

src/KLU/klu.jl Outdated
length(nzval) != length(K.nzval) && throw(DimensionMismatch())
K.nzval = nzval
K.common.halt_if_singular = !allowsingular && check
ok = $refactor(K.colptr, K.rowval, K.nzval, K._symbolic, K._numeric, Ref(K.common))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ok = $refactor(K.colptr, K.rowval, K.nzval, K._symbolic, K._numeric, Ref(K.common))
ok = $refactor(
K.colptr, K.rowval, K.nzval, K._symbolic, K._numeric, Ref(K.common))

src/KLU/klu.jl Outdated
end
end

function klu!(K::AbstractKLUFactorization{ComplexF64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:Complex}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function klu!(K::AbstractKLUFactorization{ComplexF64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:Complex}
function klu!(K::AbstractKLUFactorization{ComplexF64}, nzval::Vector{U};
check = true, allowsingular = false) where {U <: Complex}

src/KLU/klu.jl Outdated
return klu!(K, convert(Vector{ComplexF64}, nzval); check, allowsingular)
end

function klu!(K::AbstractKLUFactorization{Float64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:AbstractFloat}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function klu!(K::AbstractKLUFactorization{Float64}, nzval::Vector{U}; check=true, allowsingular=false) where {U<:AbstractFloat}
function klu!(K::AbstractKLUFactorization{Float64}, nzval::Vector{U};
check = true, allowsingular = false) where {U <: AbstractFloat}

src/KLU/klu.jl Outdated
return klu!(K, convert(Vector{Float64}, nzval); check, allowsingular)
end

function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U}; check=true, allowsingular=false) where {U}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U}; check=true, allowsingular=false) where {U}
function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U};
check = true, allowsingular = false) where {U}

src/KLU/klu.jl Outdated
increment!(K.rowval)
# what should happen here when check = false? This is not really a KLU error code.
K.colptr == S.colptr && K.rowval == S.rowval ||
(decrement!(K.colptr); decrement!(K.rowval);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
(decrement!(K.colptr); decrement!(K.rowval);
(decrement!(K.colptr);
decrement!(K.rowval);

end

function SuiteSparse_config_printf_func_set(printf_func)
ccall((:SuiteSparse_config_printf_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), printf_func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:SuiteSparse_config_printf_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), printf_func)
ccall((:SuiteSparse_config_printf_func_set, libsuitesparseconfig),
Cvoid, (Ptr{Cvoid},), printf_func)

end

function SuiteSparse_config_hypot_func_set(hypot_func)
ccall((:SuiteSparse_config_hypot_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), hypot_func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:SuiteSparse_config_hypot_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), hypot_func)
ccall((:SuiteSparse_config_hypot_func_set, libsuitesparseconfig),
Cvoid, (Ptr{Cvoid},), hypot_func)

end

function SuiteSparse_config_divcomplex_func_set(divcomplex_func)
ccall((:SuiteSparse_config_divcomplex_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), divcomplex_func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:SuiteSparse_config_divcomplex_func_set, libsuitesparseconfig), Cvoid, (Ptr{Cvoid},), divcomplex_func)
ccall((:SuiteSparse_config_divcomplex_func_set, libsuitesparseconfig),
Cvoid, (Ptr{Cvoid},), divcomplex_func)

end

function SuiteSparse_config_calloc(n, s)
ccall((:SuiteSparse_config_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), n, s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:SuiteSparse_config_calloc, libsuitesparseconfig), Ptr{Cvoid}, (Csize_t, Csize_t), n, s)
ccall((:SuiteSparse_config_calloc, libsuitesparseconfig),
Ptr{Cvoid}, (Csize_t, Csize_t), n, s)

end

function SuiteSparse_config_realloc(arg1, s)
ccall((:SuiteSparse_config_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), arg1, s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:SuiteSparse_config_realloc, libsuitesparseconfig), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), arg1, s)
ccall((:SuiteSparse_config_realloc, libsuitesparseconfig),
Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t), arg1, s)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

ccall((:symamd_l, libamd), Cint, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_maxtrans, libbtf), Int32, (Int32, Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}), nrow, ncol, Ap, Ai, maxwork, work, Match, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_maxtrans, libbtf), Int64, (Int64, Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_strongcomp, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, Q, P, R, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_strongcomp, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_order, libbtf), Int32, (Int32, Ptr{Int32}, Ptr{Int32}, Cdouble, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}), n, Ap, Ai, maxwork, work, P, Q, R, nmatch, Work)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:btf_l_order, libbtf), Int64, (Int64, Ptr{Int64}, Ptr{Int64}, Cdouble, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_analyze_given, libklu), Ptr{klu_symbolic}, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{klu_common}), n, Ap, Ai, P, Q, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_analyze_given, libklu), Ptr{klu_l_symbolic}, (Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_factor, libklu), Ptr{klu_numeric}, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_factor, libklu), Ptr{klu_l_numeric}, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_solve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_solve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_tsolve, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Int32, Int32, Ptr{Cdouble}, Cint, Ptr{klu_common}), Symbolic, Numeric, ldim, nrhs, B, conj_solve, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_tsolve, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Int64, Int64, Ptr{Cdouble}, Cint, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_refactor, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_refactor, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_symbolic}}, Ptr{klu_common}), Symbolic, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_symbolic, libklu), Cint, (Ptr{Ptr{klu_l_symbolic}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_free_numeric, libklu), Cint, (Ptr{Ptr{klu_numeric}}, Ptr{klu_common}), Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_free_numeric, libklu), Cint, (Ptr{Ptr{klu_l_numeric}}, Ptr{klu_l_common}), arg1, arg2)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_sort, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_sort, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_flops, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_flops, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rgrowth, libklu), Cint, (Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ai, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rgrowth, libklu), Cint, (Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_condest, libklu), Cint, (Ptr{Int32}, Ptr{Cdouble}, Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Ap, Ax, Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_condest, libklu), Cint, (Ptr{Int64}, Ptr{Cdouble}, Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_rcond, libklu), Cint, (Ptr{klu_symbolic}, Ptr{klu_numeric}, Ptr{klu_common}), Symbolic, Numeric, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_rcond, libklu), Cint, (Ptr{klu_l_symbolic}, Ptr{klu_l_numeric}, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_z_scale, libklu), Cint, (Cint, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), scale, n, Ap, Ai, Ax, Rs, W, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_zl_scale, libklu), Cint, (Cint, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
end
function klu_extract(Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
ccall((:klu_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Up, Ui, Ux, Fp, Fi, Fx, P, Q, Rs, R, Common)
end
function klu_z_extract(Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
ccall((:klu_z_extract, libklu), Cint, (Ptr{klu_numeric}, Ptr{klu_symbolic}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{klu_common}), Numeric, Symbolic, Lp, Li, Lx, Lz, Up, Ui, Ux, Uz, Fp, Fi, Fx, Fz, P, Q, Rs, R, Common)
end
function klu_l_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
ccall((:klu_l_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
end
function klu_zl_extract(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)
ccall((:klu_zl_extract, libklu), Cint, (Ptr{klu_l_numeric}, Ptr{klu_l_symbolic}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_common}), n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_common}), p, n, size, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_common}), nnew, nold, size, p, Common)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_malloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_free, libklu), Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{klu_l_common}), arg1, arg2, arg3, arg4)


[JuliaFormatter] reported by reviewdog 🐶

ccall((:klu_l_realloc, libklu), Ptr{Cvoid}, (Csize_t, Csize_t, Csize_t, Ptr{Cvoid}, Ptr{klu_l_common}), arg1, arg2, arg3, arg4, arg5)


[JuliaFormatter] reported by reviewdog 🐶

const SUITESPARSE_VERSION = SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION, SUITESPARSE_SUB_VERSION)


[JuliaFormatter] reported by reviewdog 🐶

const KLU_VERSION = KLU_VERSION_CODE(KLU_MAIN_VERSION, KLU_SUB_VERSION)


[JuliaFormatter] reported by reviewdog 🐶

issparsematrix(A) = false

Comment on lines 15 to 16
LinearSolve.make_SparseMatrixCSC(A::AbstractSparseArray) = SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A))
LinearSolve.makeempty_SparaseMatrixCSC(A::AbstractSparseArray) = SparseMatrixCSC(0, 0, [1], Int[], eltype(A)[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
LinearSolve.make_SparseMatrixCSC(A::AbstractSparseArray) = SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A))
LinearSolve.makeempty_SparaseMatrixCSC(A::AbstractSparseArray) = SparseMatrixCSC(0, 0, [1], Int[], eltype(A)[])
function LinearSolve.make_SparseMatrixCSC(A::AbstractSparseArray)
SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A))
end
function LinearSolve.makeempty_SparaseMatrixCSC(A::AbstractSparseArray)
SparseMatrixCSC(0, 0, [1], Int[], eltype(A)[])
end

nothing, nothing
end


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change


function LinearSolve.handle_sparsematrixcsc_lu(A::AbstractSparseMatrixCSC)
lu(SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A)),
check = false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
check = false)
check = false)


function LinearSolve.defaultalg(
A::Symmetric{<:Number, <:SparseMatrixCSC}, b, ::OperatorAssumptions{Bool})
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.CHOLMODFactorization)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.CHOLMODFactorization)
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.CHOLMODFactorization)

const PREALLOCATED_UMFPACK = SparseArrays.UMFPACK.UmfpackLU(SparseMatrixCSC(0, 0, [1],
Int[], Float64[]))

function LinearSolve.init_cacheval(alg::UMFPACKFactorization, A::SparseMatrixCSC{Float64, Int}, b, u,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function LinearSolve.init_cacheval(alg::UMFPACKFactorization, A::SparseMatrixCSC{Float64, Int}, b, u,
function LinearSolve.init_cacheval(
alg::UMFPACKFactorization, A::SparseMatrixCSC{Float64, Int}, b, u,

end

function amd_l_valid(n_row, n_col, Ap, Ai)
ccall((:amd_l_valid, libamd), Cint, (Int64, Int64, Ptr{Int64}, Ptr{Int64}), n_row, n_col, Ap, Ai)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:amd_l_valid, libamd), Cint, (Int64, Int64, Ptr{Int64}, Ptr{Int64}), n_row, n_col, Ap, Ai)
ccall((:amd_l_valid, libamd), Cint,
(Int64, Int64, Ptr{Int64}, Ptr{Int64}), n_row, n_col, Ap, Ai)

end

function colamd_l_recommended(nnz, n_row, n_col)
ccall((:colamd_l_recommended, libamd), Csize_t, (Int64, Int64, Int64), nnz, n_row, n_col)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:colamd_l_recommended, libamd), Csize_t, (Int64, Int64, Int64), nnz, n_row, n_col)
ccall(
(:colamd_l_recommended, libamd), Csize_t, (Int64, Int64, Int64), nnz, n_row, n_col)

end

function colamd(n_row, n_col, Alen, A, p, knobs, stats)
ccall((:colamd, libamd), Cint, (Int32, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}), n_row, n_col, Alen, A, p, knobs, stats)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:colamd, libamd), Cint, (Int32, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}), n_row, n_col, Alen, A, p, knobs, stats)
ccall((:colamd, libamd), Cint,
(Int32, Int32, Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}),
n_row, n_col, Alen, A, p, knobs, stats)

end

function colamd_l(n_row, n_col, Alen, A, p, knobs, stats)
ccall((:colamd_l, libamd), Cint, (Int64, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}), n_row, n_col, Alen, A, p, knobs, stats)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:colamd_l, libamd), Cint, (Int64, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}), n_row, n_col, Alen, A, p, knobs, stats)
ccall((:colamd_l, libamd), Cint,
(Int64, Int64, Int64, Ptr{Int64}, Ptr{Int64}, Ptr{Cdouble}, Ptr{Int64}),
n_row, n_col, Alen, A, p, knobs, stats)

end

function symamd(n, A, p, perm, knobs, stats, allocate, release)
ccall((:symamd, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ccall((:symamd, libamd), Cint, (Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32}, Ptr{Cdouble}, Ptr{Int32}, Ptr{Cvoid}, Ptr{Cvoid}), n, A, p, perm, knobs, stats, allocate, release)
ccall((:symamd, libamd),
Cint,
(Int32, Ptr{Int32}, Ptr{Int32}, Ptr{Int32},
Ptr{Cdouble}, Ptr{Int32}, Ptr{Cvoid}, Ptr{Cvoid}),
n,
A,
p,
perm,
knobs,
stats,
allocate,
release)

@ChrisRackauckas ChrisRackauckas changed the title WIP: Make SparseArrays an extension Make SparseArrays an extension Feb 5, 2025
@ChrisRackauckas ChrisRackauckas merged commit 88dc1f6 into main Feb 5, 2025
18 of 27 checks passed
@ChrisRackauckas ChrisRackauckas deleted the sparsearraysext branch February 5, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant