Skip to content

Commit

Permalink
chore: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 31, 2024
1 parent de3e8a2 commit f37da0a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
21 changes: 12 additions & 9 deletions lib/NonlinearSolveBase/src/NonlinearSolveBase.jl
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
module NonlinearSolveBase

using Compat: @compat
using ConcreteStructs: @concrete
using FastClosures: @closure
using Preferences: @load_preference

using ADTypes: ADTypes, AbstractADType, AutoSparse, NoSparsityDetector,
KnownJacobianSparsityDetector
using Adapt: WrappedArray
using ArrayInterface: ArrayInterface
using CommonSolve: CommonSolve, init
using Compat: @compat
using ConcreteStructs: @concrete
using DifferentiationInterface: DifferentiationInterface, Constant
using StaticArraysCore: StaticArray, SMatrix, SArray, MArray

using CommonSolve: CommonSolve, init
using EnzymeCore: EnzymeCore
using FastClosures: @closure
using FunctionProperties: hasbranching
using LinearAlgebra: LinearAlgebra, Diagonal, norm, ldiv!, diagind
using Markdown: @doc_str
using MaybeInplace: @bb
using Preferences: @load_preference
using Printf: @printf
using RecursiveArrayTools: AbstractVectorOfArray, ArrayPartition
using SciMLBase: SciMLBase, ReturnCode, AbstractODEIntegrator, AbstractNonlinearProblem,
AbstractNonlinearAlgorithm, AbstractNonlinearFunction,
NonlinearProblem, NonlinearLeastSquaresProblem, StandardNonlinearProblem,
NonlinearFunction, NullParameters, NLStats, LinearProblem
using SciMLJacobianOperators: JacobianOperator, StatefulJacobianOperator
using SciMLOperators: AbstractSciMLOperator, IdentityOperator
using StaticArraysCore: StaticArray, SMatrix, SArray, MArray
using SymbolicIndexingInterface: SymbolicIndexingInterface

using LinearAlgebra: LinearAlgebra, Diagonal, norm, ldiv!, diagind
using Markdown: @doc_str
using Printf: @printf

const DI = DifferentiationInterface
const SII = SymbolicIndexingInterface

Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ restructure(::Number, x::Number) = x
function restructure(
y::T1, x::T2
) where {T1 <: AbstractSciMLOperator, T2 <: AbstractSciMLOperator}
@assert size(y) == size(x) "cannot restructure operators. ensure their sizes match."
@assert size(y)==size(x) "cannot restructure operators. ensure their sizes match."
return x
end
restructure(y, x) = ArrayInterface.restructure(y, x)
Expand Down
16 changes: 9 additions & 7 deletions lib/NonlinearSolveFirstOrder/src/NonlinearSolveFirstOrder.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
module NonlinearSolveFirstOrder

using Reexport: @reexport
using ConcreteStructs: @concrete
using PrecompileTools: @compile_workload, @setup_workload
using Reexport: @reexport
using Setfield: @set!

using ADTypes: ADTypes
using ArrayInterface: ArrayInterface
using LinearAlgebra: LinearAlgebra, Diagonal, dot
using StaticArraysCore: SArray

using CommonSolve: CommonSolve
using ConcreteStructs: @concrete
using DiffEqBase: DiffEqBase # Needed for `init` / `solve` dispatches
using FiniteDiff: FiniteDiff # Default Finite Difference Method
using ForwardDiff: ForwardDiff # Default Forward Mode AD
using LinearAlgebra: LinearAlgebra, Diagonal, dot
using LinearSolve: LinearSolve # Trigger Linear Solve extension in NonlinearSolveBase
using MaybeInplace: @bb
using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
Expand All @@ -23,8 +24,9 @@ using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
Dogleg
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode, NonlinearFunction
using SciMLJacobianOperators: VecJacOperator, JacVecOperator, StatefulJacobianOperator
using Setfield: @set!
using StaticArraysCore: SArray

using FiniteDiff: FiniteDiff # Default Finite Difference Method
using ForwardDiff: ForwardDiff # Default Forward Mode AD

include("raphson.jl")
include("gauss_newton.jl")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module NonlinearSolveQuasiNewton

using Reexport: @reexport
using ConcreteStructs: @concrete
using PrecompileTools: @compile_workload, @setup_workload
using Reexport: @reexport

using ArrayInterface: ArrayInterface
using StaticArraysCore: StaticArray, Size, MArray

using CommonSolve: CommonSolve
using ConcreteStructs: @concrete
using DiffEqBase: DiffEqBase # Needed for `init` / `solve` dispatches
using LinearAlgebra: LinearAlgebra, Diagonal, dot, diag
using LinearSolve: LinearSolve # Trigger Linear Solve extension in NonlinearSolveBase
Expand All @@ -20,7 +22,6 @@ using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
update_trace!, L2_NORM, NewtonDescent
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode
using SciMLOperators: AbstractSciMLOperator
using StaticArraysCore: StaticArray, Size, MArray

include("reset_conditions.jl")
include("structure.jl")
Expand Down
2 changes: 1 addition & 1 deletion lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ArrayInterface.can_setindex(::AbstractJacobianOperator) = false
function ArrayInterface.restructure(
y::AbstractJacobianOperator, x::AbstractJacobianOperator
)
@assert size(y) == size(x) "cannot restructure operators. ensure their sizes match."
@assert size(y)==size(x) "cannot restructure operators. ensure their sizes match."
return x
end

Expand Down
18 changes: 14 additions & 4 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module NonlinearSolve

using ConcreteStructs: @concrete
using Reexport: @reexport
using PrecompileTools: @compile_workload, @setup_workload
using FastClosures: @closure

using ADTypes: ADTypes
using ArrayInterface: ArrayInterface
using CommonSolve: CommonSolve, solve, solve!
using ConcreteStructs: @concrete
using DiffEqBase: DiffEqBase # Needed for `init` / `solve` dispatches
using FastClosures: @closure
using LinearAlgebra: LinearAlgebra, norm
using LineSearch: BackTracking
using NonlinearSolveBase: NonlinearSolveBase, InternalAPI, AbstractNonlinearSolveAlgorithm,
Expand All @@ -33,6 +34,15 @@ using ForwardDiff: ForwardDiff # Default Forward Mode AD
using SparseArrays: SparseArrays
using SparseMatrixColorings: SparseMatrixColorings

# Sub-Packages that are re-exported by NonlinearSolve
using BracketingNonlinearSolve: BracketingNonlinearSolve
using LineSearch: LineSearch
using LinearSolve: LinearSolve
using NonlinearSolveFirstOrder: NonlinearSolveFirstOrder
using NonlinearSolveQuasiNewton: NonlinearSolveQuasiNewton
using NonlinearSolveSpectralMethods: NonlinearSolveSpectralMethods
using SimpleNonlinearSolve: SimpleNonlinearSolve

const SII = SymbolicIndexingInterface

include("helpers.jl")
Expand All @@ -54,8 +64,8 @@ include("default.jl")
# include("internal/forward_diff.jl") # we need to define after the algorithms

@setup_workload begin
include(joinpath(@__DIR__, "..", "common", "nonlinear_problem_workloads.jl"))
include(joinpath(@__DIR__, "..", "common", "nlls_problem_workloads.jl"))
include("../common/nonlinear_problem_workloads.jl")
include("../common/nlls_problem_workloads.jl")

@compile_workload begin
@sync begin
Expand Down

0 comments on commit f37da0a

Please sign in to comment.