@@ -12,38 +12,37 @@ if Pardiso.PARDISO_LOADED[]
12
12
A:: Union{ExtendableSparseMatrix, Nothing}
13
13
ps:: Pardiso.PardisoSolver
14
14
phash:: UInt64
15
- iparm:: Union{Vector{Int},Nothing}
16
- dparm:: Union{Vector{Float64},Nothing}
17
- mtype:: Union{Int,Nothing}
15
+ iparm:: Union{Vector{Int}, Nothing}
16
+ dparm:: Union{Vector{Float64}, Nothing}
17
+ mtype:: Union{Int, Nothing}
18
18
end
19
-
20
- function ExtendableSparse. PardisoLU (; iparm = nothing , dparm = nothing ,mtype = nothing )
21
- fact = PardisoLU (nothing , Pardiso. PardisoSolver (), 0 ,iparm,dparm,mtype)
19
+
20
+ function ExtendableSparse. PardisoLU (; iparm = nothing , dparm = nothing , mtype = nothing )
21
+ return fact = PardisoLU (nothing , Pardiso. PardisoSolver (), 0 , iparm, dparm, mtype)
22
22
end
23
23
24
24
end
25
-
25
+
26
26
# ############################################################################################
27
27
mutable struct MKLPardisoLU <: AbstractPardisoLU
28
28
A:: Union{ExtendableSparseMatrix, Nothing}
29
29
ps:: Pardiso.MKLPardisoSolver
30
30
phash:: UInt64
31
- iparm:: Union{Vector{Int},Nothing}
31
+ iparm:: Union{Vector{Int}, Nothing}
32
32
dparm:: Nothing
33
- mtype:: Union{Int,Nothing}
33
+ mtype:: Union{Int, Nothing}
34
34
end
35
35
36
36
function ExtendableSparse. MKLPardisoLU (; iparm = nothing , mtype = nothing )
37
- fact = MKLPardisoLU (nothing , Pardiso. MKLPardisoSolver (), 0 ,iparm,nothing ,mtype)
37
+ return fact = MKLPardisoLU (nothing , Pardiso. MKLPardisoSolver (), 0 , iparm, nothing , mtype)
38
38
end
39
39
40
40
41
-
42
41
# #########################################################################################
43
- function default_initialize! (Tv,fact:: AbstractPardisoLU )
44
- iparm= fact. iparm
45
- dparm= fact. dparm
46
- mtype= fact. mtype
42
+ function default_initialize! (Tv, fact:: AbstractPardisoLU )
43
+ iparm = fact. iparm
44
+ dparm = fact. dparm
45
+ mtype = fact. mtype
47
46
# if !isnothing(mtype)
48
47
# my_mtype=mtype fix this!
49
48
# else
@@ -57,26 +56,26 @@ function default_initialize!(Tv,fact::AbstractPardisoLU)
57
56
Pardiso. set_matrixtype! (fact. ps, my_mtype)
58
57
59
58
if ! isnothing (iparm)
60
- for i = 1 : min (length (iparm), length (fact. ps. iparm))
59
+ for i in 1 : min (length (iparm), length (fact. ps. iparm))
61
60
Pardiso. set_iparm! (fact. ps, i, iparm[i])
62
61
end
63
62
end
64
63
65
64
if ! isnothing (dparm)
66
- for i = 1 : min (length (dparm), length (fact. ps. dparm))
65
+ for i in 1 : min (length (dparm), length (fact. ps. dparm))
67
66
Pardiso. set_dparm! (fact. ps, i, dparm[i])
68
67
end
69
68
end
70
- fact
69
+ return fact
71
70
end
72
71
73
72
function update! (lufact:: AbstractPardisoLU )
74
73
ps = lufact. ps
75
74
flush! (lufact. A)
76
75
Acsc = lufact. A. cscmatrix
77
- Tv= eltype (Acsc)
76
+ Tv = eltype (Acsc)
78
77
if lufact. phash != lufact. A. phash
79
- default_initialize! (Tv,lufact)
78
+ default_initialize! (Tv, lufact)
80
79
Pardiso. set_phase! (ps, Pardiso. RELEASE_ALL)
81
80
Pardiso. pardiso (ps, Tv[], Acsc, Tv[])
82
81
Pardiso. set_phase! (ps, Pardiso. ANALYSIS_NUM_FACT)
@@ -86,21 +85,23 @@ function update!(lufact::AbstractPardisoLU)
86
85
end
87
86
Pardiso. fix_iparm! (ps, :N )
88
87
Pardiso. pardiso (ps, Tv[], Acsc, Tv[])
89
- lufact
88
+ return lufact
90
89
end
91
90
92
- function LinearAlgebra. ldiv! (u:: AbstractVector ,
93
- lufact:: AbstractPardisoLU ,
94
- v:: AbstractVector )
91
+ function LinearAlgebra. ldiv! (
92
+ u:: AbstractVector ,
93
+ lufact:: AbstractPardisoLU ,
94
+ v:: AbstractVector
95
+ )
95
96
ps = lufact. ps
96
97
Acsc = lufact. A. cscmatrix
97
98
Pardiso. set_phase! (ps, Pardiso. SOLVE_ITERATIVE_REFINE)
98
99
Pardiso. pardiso (ps, u, Acsc, v)
99
- u
100
+ return u
100
101
end
101
102
102
103
function LinearAlgebra. ldiv! (fact:: AbstractPardisoLU , v:: AbstractVector )
103
- ldiv! (v, fact, copy (v))
104
+ return ldiv! (v, fact, copy (v))
104
105
end
105
106
106
107
@eval begin
0 commit comments