@@ -12,38 +12,37 @@ if Pardiso.PARDISO_LOADED[]
1212 A:: Union{ExtendableSparseMatrix, Nothing}
1313 ps:: Pardiso.PardisoSolver
1414 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}
1818 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)
2222 end
2323
2424end
25-
25+
2626# ############################################################################################
2727mutable struct MKLPardisoLU <: AbstractPardisoLU
2828 A:: Union{ExtendableSparseMatrix, Nothing}
2929 ps:: Pardiso.MKLPardisoSolver
3030 phash:: UInt64
31- iparm:: Union{Vector{Int},Nothing}
31+ iparm:: Union{Vector{Int}, Nothing}
3232 dparm:: Nothing
33- mtype:: Union{Int,Nothing}
33+ mtype:: Union{Int, Nothing}
3434end
3535
3636function 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)
3838end
3939
4040
41-
4241# #########################################################################################
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
4746 # if !isnothing(mtype)
4847 # my_mtype=mtype fix this!
4948 # else
@@ -57,26 +56,26 @@ function default_initialize!(Tv,fact::AbstractPardisoLU)
5756 Pardiso. set_matrixtype! (fact. ps, my_mtype)
5857
5958 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))
6160 Pardiso. set_iparm! (fact. ps, i, iparm[i])
6261 end
6362 end
6463
6564 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))
6766 Pardiso. set_dparm! (fact. ps, i, dparm[i])
6867 end
6968 end
70- fact
69+ return fact
7170end
7271
7372function update! (lufact:: AbstractPardisoLU )
7473 ps = lufact. ps
7574 flush! (lufact. A)
7675 Acsc = lufact. A. cscmatrix
77- Tv= eltype (Acsc)
76+ Tv = eltype (Acsc)
7877 if lufact. phash != lufact. A. phash
79- default_initialize! (Tv,lufact)
78+ default_initialize! (Tv, lufact)
8079 Pardiso. set_phase! (ps, Pardiso. RELEASE_ALL)
8180 Pardiso. pardiso (ps, Tv[], Acsc, Tv[])
8281 Pardiso. set_phase! (ps, Pardiso. ANALYSIS_NUM_FACT)
@@ -86,21 +85,23 @@ function update!(lufact::AbstractPardisoLU)
8685 end
8786 Pardiso. fix_iparm! (ps, :N )
8887 Pardiso. pardiso (ps, Tv[], Acsc, Tv[])
89- lufact
88+ return lufact
9089end
9190
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+ )
9596 ps = lufact. ps
9697 Acsc = lufact. A. cscmatrix
9798 Pardiso. set_phase! (ps, Pardiso. SOLVE_ITERATIVE_REFINE)
9899 Pardiso. pardiso (ps, u, Acsc, v)
99- u
100+ return u
100101end
101102
102103function LinearAlgebra. ldiv! (fact:: AbstractPardisoLU , v:: AbstractVector )
103- ldiv! (v, fact, copy (v))
104+ return ldiv! (v, fact, copy (v))
104105end
105106
106107@eval begin
0 commit comments