Skip to content

Commit 35d4fae

Browse files
committed
Allow to use Pardiso with AbstractSparseMatrixCSC
1 parent c20ca2d commit 35d4fae

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ext/LinearSolvePardisoExt.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,11 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::PardisoJL; kwargs
134134
if cache.isfresh
135135
phase = alg.cache_analysis ? Pardiso.NUM_FACT : Pardiso.ANALYSIS_NUM_FACT
136136
Pardiso.set_phase!(cache.cacheval, phase)
137-
Pardiso.pardiso(cache.cacheval, A, eltype(A)[])
137+
Pardiso.pardiso(cache.cacheval, SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A)), eltype(A)[])
138138
cache.isfresh = false
139139
end
140140
Pardiso.set_phase!(cache.cacheval, Pardiso.SOLVE_ITERATIVE_REFINE)
141-
Pardiso.pardiso(cache.cacheval, u, A, b)
142-
141+
Pardiso.pardiso(cache.cacheval, u, SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A)), b)
143142
return SciMLBase.build_linear_solution(alg, cache.u, nothing, cache)
144143
end
145144

src/extension_algs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ All values default to `nothing` and the solver internally determines the values
217217
given the input types, and these keyword arguments are only for overriding the
218218
default handling process. This should not be required by most users.
219219
"""
220-
struct PardisoJL{T1, T2} <: LinearSolve.SciMLLinearSolveAlgorithm
220+
struct PardisoJL{T1, T2} <: AbstractSparseFactorization
221221
nprocs::Union{Int, Nothing}
222222
solver_type::T1
223223
matrix_type::T2

0 commit comments

Comments
 (0)