Skip to content

Apply JuliaFormatter to fix code formatting #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/tutorials/linear.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Let's check these are the same:

```@example linsys1
v = rand(5)
mfopA*v - A*v
mfopA * v - A * v
```

Notice `mfopA` does this without having to have `A` because it just uses the equivalent `Afunc!` instead. Now, even though
Expand Down
2 changes: 1 addition & 1 deletion ext/LinearSolveEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function EnzymeRules.reverse(config, func::Const{typeof(LinearSolve.solve!)},
end
else
dlinsolves = linsolve.dval
if any(x->(iszero(x.A) || iszero(x.b)) && !iszero(x.u), linsolve.dval)
if any(x -> (iszero(x.A) || iszero(x.b)) && !iszero(x.u), linsolve.dval)
error("Adjoint case currently not handled. Instead of using `solve!(cache); s1 = copy(cache.u) ...`, use `sol = solve!(cache); s1 = copy(sol.u)`.")
end
end
Expand Down
3 changes: 2 additions & 1 deletion src/KLU/klu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import Base: (\), size, getproperty, setproperty!, propertynames, show,
copy, eachindex, view, sortperm, unsafe_load, zeros, convert, eltype,
length, parent, stride, finalizer, Complex, complex, imag, real, map!,
summary, println, oneunit, sizeof, isdefined, setfield!, getfield,
OutOfMemoryError, ArgumentError, OverflowError, ErrorException, DimensionMismatch
OutOfMemoryError, ArgumentError, OverflowError, ErrorException,
DimensionMismatch

# Convert from 1-based to 0-based indices
function decrement!(A::AbstractArray{T}) where {T <: Integer}
Expand Down
4 changes: 2 additions & 2 deletions src/generic_lufact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Update the rest
for j in (k + 1):n
for i in (k + 1):m
A[i, j] -= A[i, k]*A[k, j]
A[i, j] -= A[i, k] * A[k, j]
end
end
end
Expand Down Expand Up @@ -119,7 +119,7 @@ elseif VERSION < v"1.13"
# Update the rest
for j in (k + 1):n
for i in (k + 1):m
A[i, j] -= A[i, k]*A[k, j]
A[i, j] -= A[i, k] * A[k, j]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/simplegmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ function SciMLBase.solve!(cache::SimpleGMRESCache{false}, lincache::LinearCache)
# [cₖ sₖ] [ r̄ₖ.ₖ ] = [rₖ.ₖ]
# [s̄ₖ -cₖ] [hₖ₊₁.ₖ] [ 0 ]
(c[inner_iter], s[inner_iter],
R[nr + inner_iter]) = _sym_givens(
R[nr + inner_iter]) = _sym_givens(
R[nr + inner_iter],
Hbis)

Expand Down
2 changes: 1 addition & 1 deletion test/adjoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A = rand(n, n);
b1 = rand(n);

_ff = (x,
y) -> f(x,
y) -> f(x,
y;
alg = LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization))
_ff(copy(A), copy(b1))
Expand Down
2 changes: 1 addition & 1 deletion test/default_algs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ sol = solve(prob,
@test sol.u == zeros(4)

sol = solve(prob)
@test sol.u ≈ svd(A)\b
@test sol.u ≈ svd(A) \ b
8 changes: 4 additions & 4 deletions test/hypretests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function test_interface(alg; kw...)

# Solve prob directly (without cache)
y = solve(prob, alg; cache_kwargs..., Pl = HYPRE.BoomerAMG)
@test A*to_array(y.u)≈b atol=atol rtol=rtol
@test A * to_array(y.u)≈b atol=atol rtol=rtol
@test y.iters > 0
@test y.resid < rtol

Expand All @@ -99,7 +99,7 @@ function test_interface(alg; kw...)
cache = y.cache
@test cache.isfresh == cache.cacheval.isfresh_A ==
cache.cacheval.isfresh_b == cache.cacheval.isfresh_u == false
@test A*to_array(y.u)≈b atol=atol rtol=rtol
@test A * to_array(y.u)≈b atol=atol rtol=rtol

# Update A
cache.A = A
Expand All @@ -109,7 +109,7 @@ function test_interface(alg; kw...)
cache = y.cache
@test cache.isfresh == cache.cacheval.isfresh_A ==
cache.cacheval.isfresh_b == cache.cacheval.isfresh_u == false
@test A*to_array(y.u)≈b atol=atol rtol=rtol
@test A * to_array(y.u)≈b atol=atol rtol=rtol

# Update b
b2 = 2 * to_array(b)
Expand All @@ -123,7 +123,7 @@ function test_interface(alg; kw...)
cache = y.cache
@test cache.isfresh == cache.cacheval.isfresh_A ==
cache.cacheval.isfresh_b == cache.cacheval.isfresh_u == false
@test A*to_array(y.u)≈to_array(b2) atol=atol rtol=rtol
@test A * to_array(y.u)≈to_array(b2) atol=atol rtol=rtol
end
return
end
Expand Down
6 changes: 3 additions & 3 deletions test/nopre/enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ b1 = rand(n);
db1 = zeros(n);

_ff = (x,
y) -> f(x,
y) -> f(x,
y;
alg = LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization))
_ff(copy(A), copy(b1))

Enzyme.autodiff(Reverse,
(x,
y) -> f(x,
y) -> f(x,
y;
alg = LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization)),
Duplicated(copy(A), dA),
Expand Down Expand Up @@ -174,7 +174,7 @@ db2 = zeros(n);
Enzyme.autodiff(set_runtime_activity(Reverse), f3, Duplicated(copy(A), dA),
Duplicated(copy(b1), db1), Duplicated(copy(b2), db2))

@test dAdA2 atol=5e-5
@test dAdA2 atol=5e-5
@test db1 ≈ db12
@test db2 ≈ db22

Expand Down
2 changes: 1 addition & 1 deletion test/retcodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ staticarrayalgs = (
)
@testset "StaticArray Success" begin
A = Float64[1 2 3; 4 3.5 1.7; 5.2 1.8 9.7]
A = A*A'
A = A * A'
b = Float64[2, 5, 8]
prob1 = LinearProblem(SMatrix{3, 3}(A), SVector{3}(b))
sol = solve(prob1)
Expand Down
Loading