Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Nov 7, 2022
1 parent 0222103 commit 1b26f69
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b26f69

Please sign in to comment.