Skip to content

Commit 8f8febc

Browse files
author
SciML Bot
committed
Apply JuliaFormatter to fix code formatting
- Applied JuliaFormatter with SciML style guide - Formatted 3 files 🤖 Generated by OrgMaintenanceScripts.jl
1 parent 25567cf commit 8f8febc

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

src/KLU/klu.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import Base: (\), size, getproperty, setproperty!, propertynames, show,
1414
copy, eachindex, view, sortperm, unsafe_load, zeros, convert, eltype,
1515
length, parent, stride, finalizer, Complex, complex, imag, real, map!,
1616
summary, println, oneunit, sizeof, isdefined, setfield!, getfield,
17-
OutOfMemoryError, ArgumentError, OverflowError, ErrorException, DimensionMismatch
17+
OutOfMemoryError, ArgumentError, OverflowError, ErrorException,
18+
DimensionMismatch
1819

1920
# Convert from 1-based to 0-based indices
2021
function decrement!(A::AbstractArray{T}) where {T <: Integer}
@@ -166,6 +167,7 @@ function _free_symbolic(K::AbstractKLUFactorization{Tv, Ti}) where {Ti <: KLUITy
166167
end
167168

168169
for Ti in KLUIndexTypes, Tv in KLUValueTypes
170+
169171
klufree = _klu_name("free_numeric", Tv, Ti)
170172
ptr = _klu_name("numeric", :Float64, Ti)
171173
@eval begin
@@ -218,6 +220,7 @@ end
218220
# Certain sets of inputs must be non-null *together*:
219221
# [Lp, Li, Lx], [Up, Ui, Ux], [Fp, Fi, Fx]
220222
for Tv in KLUValueTypes, Ti in KLUIndexTypes
223+
221224
extract = _klu_name("extract", Tv, Ti)
222225
sort = _klu_name("sort", Tv, Ti)
223226
if Tv === :ComplexF64
@@ -436,6 +439,7 @@ function klu_analyze!(K::KLUFactorization{Tv, Ti}, P::Vector{Ti},
436439
end
437440

438441
for Tv in KLUValueTypes, Ti in KLUIndexTypes
442+
439443
factor = _klu_name("factor", Tv, Ti)
440444
@eval begin
441445
function klu_factor!(
@@ -464,6 +468,7 @@ for Tv in KLUValueTypes, Ti in KLUIndexTypes
464468
end
465469

466470
for Tv in KLUValueTypes, Ti in KLUIndexTypes
471+
467472
rgrowth = _klu_name("rgrowth", Tv, Ti)
468473
rcond = _klu_name("rcond", Tv, Ti)
469474
condest = _klu_name("condest", Tv, Ti)
@@ -639,6 +644,7 @@ See also: [`klu`](@ref)
639644
klu!
640645

641646
for Tv in KLUValueTypes, Ti in KLUIndexTypes
647+
642648
refactor = _klu_name("refactor", Tv, Ti)
643649
@eval begin
644650
function klu!(K::KLUFactorization{$Tv, $Ti}, nzval::Vector{$Tv};
@@ -676,8 +682,8 @@ function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U};
676682
# what should happen here when check = false? This is not really a KLU error code.
677683
K.colptr == S.colptr && K.rowval == S.rowval ||
678684
(decrement!(K.colptr);
679-
decrement!(K.rowval);
680-
throw(ArgumentError("The pattern of the original matrix must match the pattern of the refactor."))
685+
decrement!(K.rowval);
686+
throw(ArgumentError("The pattern of the original matrix must match the pattern of the refactor."))
681687
)
682688
decrement!(K.colptr)
683689
decrement!(K.rowval)
@@ -710,6 +716,7 @@ This function overwrites `B` with the solution `X`, for a new solution vector `X
710716
"""
711717
solve!
712718
for Tv in KLUValueTypes, Ti in KLUIndexTypes
719+
713720
solve = _klu_name("solve", Tv, Ti)
714721
@eval begin
715722
function solve!(klu::AbstractKLUFactorization{$Tv, $Ti},
@@ -726,6 +733,7 @@ for Tv in KLUValueTypes, Ti in KLUIndexTypes
726733
end
727734

728735
for Tv in KLUValueTypes, Ti in KLUIndexTypes
736+
729737
tsolve = _klu_name("tsolve", Tv, Ti)
730738
if Tv === :ComplexF64
731739
call = :($tsolve(

src/LinearSolve.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,10 @@ include("adjoint.jl")
176176
end
177177
end
178178

179-
@inline function _notsuccessful(F::LinearAlgebra.QRCompactWY{T, A}) where {T,A<:GPUArraysCore.AnyGPUArray}
179+
@inline function _notsuccessful(F::LinearAlgebra.QRCompactWY{
180+
T, A}) where {T, A <: GPUArraysCore.AnyGPUArray}
180181
hasmethod(LinearAlgebra.issuccess, (typeof(F),)) ?
181-
!LinearAlgebra.issuccess(F) : false
182+
!LinearAlgebra.issuccess(F) : false
182183
end
183184

184185
@inline function _notsuccessful(F::LinearAlgebra.QRCompactWY)

src/factorization.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,8 @@ patterns with “more structure”.
861861
!!! note
862862
863863
By default, the SparseArrays.jl are implemented for efficiency by caching the
864-
symbolic factorization. If the sparsity pattern of `A` may change between solves, set `reuse_symbolic=false`.
865-
If the pattern is assumed or known to be constant, set `reuse_symbolic=true` to avoid
864+
symbolic factorization. If the sparsity pattern of `A` may change between solves, set `reuse_symbolic=false`.
865+
If the pattern is assumed or known to be constant, set `reuse_symbolic=true` to avoid
866866
unnecessary recomputation. To further reduce computational overhead, you can disable
867867
pattern checks entirely by setting `check_pattern = false`. Note that this may error
868868
if the sparsity pattern does change unexpectedly.
@@ -887,8 +887,8 @@ A fast sparse LU-factorization which specializes on sparsity patterns with “le
887887
!!! note
888888
889889
By default, the SparseArrays.jl are implemented for efficiency by caching the
890-
symbolic factorization. If the sparsity pattern of `A` may change between solves, set `reuse_symbolic=false`.
891-
If the pattern is assumed or known to be constant, set `reuse_symbolic=true` to avoid
890+
symbolic factorization. If the sparsity pattern of `A` may change between solves, set `reuse_symbolic=false`.
891+
If the pattern is assumed or known to be constant, set `reuse_symbolic=true` to avoid
892892
unnecessary recomputation. To further reduce computational overhead, you can disable
893893
pattern checks entirely by setting `check_pattern = false`. Note that this may error
894894
if the sparsity pattern does change unexpectedly.

0 commit comments

Comments
 (0)