Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored and oscardssmith committed Jun 7, 2023
1 parent 88d92cb commit d9ea020
Show file tree
Hide file tree
Showing 7 changed files with 221 additions and 190 deletions.
6 changes: 3 additions & 3 deletions docs/src/solvers/NonlinearSystemSolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ is small, or the eigenvalues of the Jacobian are within a few orders of magnitud
then `NLSolveJL`'s `:anderson` can be a good choice.

!!! note

`TrustRegion` and `SimpleTrustRegion` are still in development.

## Full List of Methods

!!! note

For the full details on the capabilities and constructors of the different solvers,
see the Detailed Solver APIs section!

Expand Down Expand Up @@ -60,7 +60,7 @@ methods excel at small problems and problems defined with static arrays.
large-scale nonlinear systems of equations.

!!! note

When used with certain types for the states `u` such as a `Number` or `StaticArray`,
these solvers are very efficient and non-allocating. These implementations are thus
well-suited for small systems of equations.
Expand Down
31 changes: 17 additions & 14 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,27 @@ include("ad.jl")

import PrecompileTools

PrecompileTools.@compile_workload begin for T in (Float32, Float64)
prob = NonlinearProblem{false}((u, p) -> u .* u .- p, T(0.1), T(2))
PrecompileTools.@compile_workload begin
for T in (Float32, Float64)
prob = NonlinearProblem{false}((u, p) -> u .* u .- p, T(0.1), T(2))

precompile_algs = if VERSION >= v"1.7"
(NewtonRaphson(), TrustRegion(), LevenbergMarquardt())
else
(NewtonRaphson(),)
end
precompile_algs = if VERSION >= v"1.7"
(NewtonRaphson(), TrustRegion(), LevenbergMarquardt())
else
(NewtonRaphson(),)
end

for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
end
for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
end

prob = NonlinearProblem{true}((du, u, p) -> du[1] = u[1] * u[1] - p[1], T[0.1], T[2])
for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
prob = NonlinearProblem{true}((du, u, p) -> du[1] = u[1] * u[1] - p[1], T[0.1],
T[2])
for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
end
end
end end
end

export RadiusUpdateSchemes

Expand Down
2 changes: 0 additions & 2 deletions src/jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,3 @@ function jacobian_autodiff(f, x::AbstractArray, nonlinfun, alg)
jac_prototype = jac_prototype, chunksize = chunk_size),
num_of_chunks)
end


Loading

0 comments on commit d9ea020

Please sign in to comment.