Skip to content

Commit 25559fe

Browse files
committed
fix format
1 parent bb3c690 commit 25559fe

File tree

2 files changed

+24
-30
lines changed

2 files changed

+24
-30
lines changed

lib/LinearSolvePardiso/src/LinearSolvePardiso.jl

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ using SparseArrays: nonzeros, rowvals, getcolptr
77
using UnPack
88

99
Base.@kwdef struct PardisoJL <: LinearSolve.SciMLLinearSolveAlgorithm
10-
nprocs::Union{Int,Nothing} = nothing
11-
solver_type::Union{Int,Pardiso.Solver,Nothing} = nothing
12-
matrix_type::Union{Int,Pardiso.MatrixType,Nothing} = nothing
13-
iparm::Union{Vector{Tuple{Int,Int}},Nothing} = nothing
14-
dparm::Union{Vector{Tuple{Int,Int}},Nothing} = nothing
10+
nprocs::Union{Int, Nothing} = nothing
11+
solver_type::Union{Int, Pardiso.Solver, Nothing} = nothing
12+
matrix_type::Union{Int, Pardiso.MatrixType, Nothing} = nothing
13+
iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing
14+
dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing
1515
end
1616

1717
MKLPardisoFactorize(; kwargs...) = PardisoJL(; solver_type = 0, kwargs...)
@@ -20,19 +20,17 @@ LinearSolve.needs_concrete_A(alg::PardisoJL) = true
2020

2121
# TODO schur complement functionality
2222

23-
function LinearSolve.init_cacheval(
24-
alg::PardisoJL,
25-
A,
26-
b,
27-
u,
28-
Pl,
29-
Pr,
30-
maxiters::Int,
31-
abstol,
32-
reltol,
33-
verbose::Bool,
34-
assumptions::LinearSolve.OperatorAssumptions,
35-
)
23+
function LinearSolve.init_cacheval(alg::PardisoJL,
24+
A,
25+
b,
26+
u,
27+
Pl,
28+
Pr,
29+
maxiters::Int,
30+
abstol,
31+
reltol,
32+
verbose::Bool,
33+
assumptions::LinearSolve.OperatorAssumptions)
3634
@unpack nprocs, solver_type, matrix_type, iparm, dparm = alg
3735
A = convert(AbstractMatrix, A)
3836

@@ -103,12 +101,10 @@ function LinearSolve.init_cacheval(
103101
Pardiso.set_iparm!(solver, 3, round(Int, abs(log10(reltol)), RoundDown) * 10 + 1)
104102
end
105103

106-
Pardiso.pardiso(
107-
solver,
108-
u,
109-
SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A)),
110-
b,
111-
)
104+
Pardiso.pardiso(solver,
105+
u,
106+
SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A)),
107+
b)
112108

113109
return solver
114110
end

lib/LinearSolvePardiso/test/runtests.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using LinearSolve, LinearSolvePardiso, SparseArrays, Random
22

3-
A1 = sparse([
4-
1.0 0 -2 3
5-
0 5 1 2
6-
-2 1 4 -7
7-
3 2 -7 5
8-
])
3+
A1 = sparse([1.0 0 -2 3
4+
0 5 1 2
5+
-2 1 4 -7
6+
3 2 -7 5])
97
b1 = rand(4)
108
prob1 = LinearProblem(A1, b1)
119

0 commit comments

Comments
 (0)