From 1b26f6959d360850a4ec9aefd2f09b936a71a949 Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Mon, 7 Nov 2022 09:52:44 -0500 Subject: [PATCH] format --- src/NonlinearSolve.jl | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/NonlinearSolve.jl b/src/NonlinearSolve.jl index 0520826c6..cc8f57184 100644 --- a/src/NonlinearSolve.jl +++ b/src/NonlinearSolve.jl @@ -30,26 +30,24 @@ include("scalar.jl") import SnoopPrecompile -SnoopPrecompile.@precompile_all_calls begin - for T in (Float32, Float64) - prob_no_brack = NonlinearProblem{false}((u,p) -> u .* u .- p, T(.1), T(2)) - for alg in (NewtonRaphson,) - solve(prob_no_brack, alg(), tol = T(1e-2)) - end - # TODO this is broken? - #=for alg in (NewtonRaphson,) - for u0 in ([1., 1.], @SVector[1.0, 1.0]) - u0 = T.(.1) - probN = NonlinearProblem{false}((u,p) -> u .* u .- p, u0, T(2)) - solve(probN, alg(), tol = T(1e-2)) - end - end=# - prob_brack = NonlinearProblem{false}((u,p) -> u * u - p, T.((0., 2.)), T(2)) - for alg in (Bisection, Falsi) - solve(prob_brack, alg(), tol = T(1e-2)) - end +SnoopPrecompile.@precompile_all_calls begin for T in (Float32, Float64) + prob_no_brack = NonlinearProblem{false}((u, p) -> u .* u .- p, T(0.1), T(2)) + for alg in (NewtonRaphson,) + solve(prob_no_brack, alg(), tol = T(1e-2)) end -end + #TODO this is broken? + #for alg in (NewtonRaphson,) + # for u0 in ([1., 1.], @SVector[1.0, 1.0]) + # u0 = T.(.1) + # probN = NonlinearProblem{false}((u,p) -> u .* u .- p, u0, T(2)) + # solve(probN, alg(), tol = T(1e-2)) + # end + #end + prob_brack = NonlinearProblem{false}((u, p) -> u * u - p, T.((0.0, 2.0)), T(2)) + for alg in (Bisection, Falsi) + solve(prob_brack, alg(), tol = T(1e-2)) + end +end end # DiffEq styled algorithms export Bisection, Falsi, NewtonRaphson