Skip to content

Commit 9733034

Browse files
authored
Simplify precompilation
Remove Float32 method and the Vector out of place methods since these are less likely to be useful to users. This brings down precompilation time by ~2x. I think this is good to do before #418 since I'm more sure that it's a good idea.
1 parent 71b3f87 commit 9733034

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/NonlinearSolve.jl

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,10 @@ include("default.jl")
9090

9191
@setup_workload begin
9292
nlfuncs = ((NonlinearFunction{false}((u, p) -> u .* u .- p), 0.1),
93-
(NonlinearFunction{false}((u, p) -> u .* u .- p), [0.1]),
9493
(NonlinearFunction{true}((du, u, p) -> du .= u .* u .- p), [0.1]))
9594
probs_nls = NonlinearProblem[]
96-
for T in (Float32, Float64), (fn, u0) in nlfuncs
97-
push!(probs_nls, NonlinearProblem(fn, T.(u0), T(2)))
95+
for (fn, u0) in nlfuncs
96+
push!(probs_nls, NonlinearProblem(fn, u0, 2.0))
9897
end
9998

10099
nls_algs = (NewtonRaphson(), TrustRegion(), LevenbergMarquardt(),
@@ -114,20 +113,6 @@ include("default.jl")
114113
for (fn, u0) in nlfuncs
115114
push!(probs_nlls, NonlinearLeastSquaresProblem(fn, u0, 2.0))
116115
end
117-
nlfuncs = ((NonlinearFunction{false}((u, p) -> (u .^ 2 .- p)[1:1]), Float32[0.1, 0.0]),
118-
(NonlinearFunction{false}((u, p) -> vcat(u .* u .- p, u .* u .- p)),
119-
Float32[0.1, 0.1]),
120-
(
121-
NonlinearFunction{true}(
122-
(du, u, p) -> du[1] = u[1] * u[1] - p, resid_prototype = zeros(Float32, 1)),
123-
Float32[0.1, 0.0]),
124-
(
125-
NonlinearFunction{true}((du, u, p) -> du .= vcat(u .* u .- p, u .* u .- p),
126-
resid_prototype = zeros(Float32, 4)),
127-
Float32[0.1, 0.1]))
128-
for (fn, u0) in nlfuncs
129-
push!(probs_nlls, NonlinearLeastSquaresProblem(fn, u0, 2.0f0))
130-
end
131116

132117
nlls_algs = (LevenbergMarquardt(), GaussNewton(), TrustRegion(),
133118
LevenbergMarquardt(; linsolve = LUFactorization()),

0 commit comments

Comments
 (0)