Skip to content

Commit adb2f08

Browse files
committed
format
1 parent 7828889 commit adb2f08

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

src/default.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
# For SciML algorithms already using `defaultalg`, all assume square matrix.
33
defaultalg(A, b) = defaultalg(A, b, OperatorAssumptions(Val(true)))
44

5-
function defaultalg(A::Union{DiffEqArrayOperator,MatrixOperator}, b, assumptions::OperatorAssumptions)
5+
function defaultalg(A::Union{DiffEqArrayOperator, MatrixOperator}, b,
6+
assumptions::OperatorAssumptions)
67
defaultalg(A.A, b, assumptions)
78
end
89

910
# Ambiguity handling
10-
function defaultalg(A::Union{DiffEqArrayOperator,MatrixOperator}, b, assumptions::OperatorAssumptions{nothing})
11+
function defaultalg(A::Union{DiffEqArrayOperator, MatrixOperator}, b,
12+
assumptions::OperatorAssumptions{nothing})
1113
defaultalg(A.A, b, assumptions)
1214
end
1315

14-
function defaultalg(A::Union{DiffEqArrayOperator,MatrixOperator}, b, assumptions::OperatorAssumptions{false})
16+
function defaultalg(A::Union{DiffEqArrayOperator, MatrixOperator}, b,
17+
assumptions::OperatorAssumptions{false})
1518
defaultalg(A.A, b, assumptions)
1619
end
1720

18-
function defaultalg(A::Union{DiffEqArrayOperator,MatrixOperator}, b, assumptions::OperatorAssumptions{true})
21+
function defaultalg(A::Union{DiffEqArrayOperator, MatrixOperator}, b,
22+
assumptions::OperatorAssumptions{true})
1923
defaultalg(A.A, b, assumptions)
2024
end
2125

src/iterative_wrappers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ function init_cacheval(alg::IterativeSolversJL, A, b, u, Pl, Pr, maxiters::Int,
235235
alg.kwargs...)
236236

237237
iterable = if alg.generate_iterator === IterativeSolvers.cg_iterator!
238-
! _isidentity_struct(Pr) &&
238+
!_isidentity_struct(Pr) &&
239239
@warn "$(alg.generate_iterator) doesn't support right preconditioning"
240240
alg.generate_iterator(u, A, b, Pl;
241241
kwargs...)
242242
elseif alg.generate_iterator === IterativeSolvers.gmres_iterable!
243243
alg.generate_iterator(u, A, b; Pl = Pl, Pr = Pr, restart = restart,
244244
kwargs...)
245245
elseif alg.generate_iterator === IterativeSolvers.bicgstabl_iterator!
246-
! _isidentity_struct(Pr) &&
246+
!_isidentity_struct(Pr) &&
247247
@warn "$(alg.generate_iterator) doesn't support right preconditioning"
248248
alg.generate_iterator(u, A, b, alg.args...; Pl = Pl,
249249
abstol = abstol, reltol = reltol,

test/basictests.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ end
272272

273273
@testset "Preconditioners" begin
274274
@testset "Vector Diagonal Preconditioner" begin
275-
276275
x = rand(n, n)
277276
y = rand(n, n)
278277

@@ -358,14 +357,16 @@ end
358357
x2 = zero(b1)
359358

360359
@testset "LinearSolveFunction" begin
361-
function sol_func(A, b, u, p, newA, Pl, Pr, solverdata; verbose = true, kwargs...)
360+
function sol_func(A, b, u, p, newA, Pl, Pr, solverdata; verbose = true,
361+
kwargs...)
362362
if verbose == true
363363
println("out-of-place solve")
364364
end
365365
u = A \ b
366366
end
367367

368-
function sol_func!(A, b, u, p, newA, Pl, Pr, solverdata; verbose = true, kwargs...)
368+
function sol_func!(A, b, u, p, newA, Pl, Pr, solverdata; verbose = true,
369+
kwargs...)
369370
if verbose == true
370371
println("in-place solve")
371372
end
@@ -395,11 +396,11 @@ end
395396
ldiv!(du, F, u)
396397
end
397398

398-
FunctionOperator(f, u, u; isinplace=true, op_inverse=fi)
399+
FunctionOperator(f, u, u; isinplace = true, op_inverse = fi)
399400
end
400401

401-
op1 = get_operator(A1, x1*0)
402-
op2 = get_operator(A2, x2*0)
402+
op1 = get_operator(A1, x1 * 0)
403+
op2 = get_operator(A2, x2 * 0)
403404

404405
prob1 = LinearProblem(op1, b1; u0 = x1)
405406
prob2 = LinearProblem(op2, b2; u0 = x2)

test/traits.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ using LinearSolve: _isidentity_struct
55
N = 4
66

77
@testset "Traits" begin
8-
98
@test _isidentity_struct(I)
109
@test _isidentity_struct(1.0 * I)
1110
@test _isidentity_struct(SciMLBase.IdentityOperator{N}())
1211
@test _isidentity_struct(SciMLBase.DiffEqIdentity(rand(4)))
13-
@test ! _isidentity_struct(2.0 * I)
14-
@test ! _isidentity_struct(rand(N, N))
15-
@test ! _isidentity_struct(Matrix(I, N, N))
12+
@test !_isidentity_struct(2.0 * I)
13+
@test !_isidentity_struct(rand(N, N))
14+
@test !_isidentity_struct(Matrix(I, N, N))
1615
end

0 commit comments

Comments
 (0)