@@ -4,35 +4,35 @@ using Pardiso, LinearSolve, SciMLBase
4
4
using UnPack
5
5
6
6
Base. @kwdef struct PardisoJL <: LinearSolve.SciMLLinearSolveAlgorithm
7
- nprocs:: Union{Int,Nothing} = nothing
8
- solver_type:: Union{Int,Pardiso.Solver,Nothing} = nothing
9
- matrix_type:: Union{Int,Pardiso.MatrixType,Nothing} = nothing
10
- iparm:: Union{Vector{Tuple{Int,Int}},Nothing} = nothing
11
- dparm:: Union{Vector{Tuple{Int,Int}},Nothing} = nothing
7
+ nprocs:: Union{Int, Nothing} = nothing
8
+ solver_type:: Union{Int, Pardiso.Solver, Nothing} = nothing
9
+ matrix_type:: Union{Int, Pardiso.MatrixType, Nothing} = nothing
10
+ iparm:: Union{Vector{Tuple{Int, Int}}, Nothing} = nothing
11
+ dparm:: Union{Vector{Tuple{Int, Int}}, Nothing} = nothing
12
12
end
13
13
14
- MKLPardisoFactorize (; kwargs... ) = PardisoJL (; solver_type= 0 , kwargs... )
15
- MKLPardisoIterate (; kwargs... ) = PardisoJL (; solver_type= 1 , kwargs... )
14
+ MKLPardisoFactorize (; kwargs... ) = PardisoJL (; solver_type = 0 , kwargs... )
15
+ MKLPardisoIterate (; kwargs... ) = PardisoJL (; solver_type = 1 , kwargs... )
16
16
LinearSolve. needs_concrete_A (alg:: PardisoJL ) = true
17
17
18
18
# TODO schur complement functionality
19
19
20
- function LinearSolve. init_cacheval (alg:: PardisoJL , A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
20
+ function LinearSolve. init_cacheval (alg:: PardisoJL , A, b, u, Pl, Pr, maxiters, abstol,
21
+ reltol, verbose)
21
22
@unpack nprocs, solver_type, matrix_type, iparm, dparm = alg
22
23
A = convert (AbstractMatrix, A)
23
24
24
- solver =
25
- if Pardiso. PARDISO_LOADED[]
26
- solver = Pardiso. PardisoSolver ()
27
- solver_type != = nothing && Pardiso. set_solver! (solver, solver_type)
25
+ solver = if Pardiso. PARDISO_LOADED[]
26
+ solver = Pardiso. PardisoSolver ()
27
+ solver_type != = nothing && Pardiso. set_solver! (solver, solver_type)
28
28
29
- solver
30
- else
31
- solver = Pardiso. MKLPardisoSolver ()
32
- nprocs != = nothing && Pardiso. set_nprocs! (solver, nprocs)
29
+ solver
30
+ else
31
+ solver = Pardiso. MKLPardisoSolver ()
32
+ nprocs != = nothing && Pardiso. set_nprocs! (solver, nprocs)
33
33
34
- solver
35
- end
34
+ solver
35
+ end
36
36
37
37
Pardiso. pardisoinit (solver) # default initialization
38
38
113
113
114
114
export PardisoJL, MKLPardisoFactorize, MKLPardisoIterate
115
115
116
- end
116
+ end
0 commit comments