Skip to content

Commit 5b8e73d

Browse files
fix pardiso complex
1 parent 71142f7 commit 5b8e73d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/pardiso.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,17 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
4040

4141
Pardiso.pardisoinit(solver) # default initialization
4242

43-
matrix_type !== nothing && Pardiso.set_matrixtype!(solver, matrix_type)
43+
if matrix_type !== nothing
44+
Pardiso.set_matrixtype!(solver, matrix_type)
45+
else
46+
if eltype(A) <: Real
47+
Pardiso.set_matrixtype!(solver, Pardiso.REAL_NONSYM)
48+
elseif eltype(A) <: Complex
49+
Pardiso.set_matrixtype!(solver, Pardiso.COMPLEX_NONSYM)
50+
else
51+
error("Number type not supported by Pardiso")
52+
end
53+
end
4454
cache.verbose && Pardiso.set_msglvl!(solver, Pardiso.MESSAGE_LEVEL_ON)
4555

4656
# pass in vector of tuples like [(iparm::Int, key::Int) ...]

0 commit comments

Comments
 (0)