Skip to content

Commit eb3df11

Browse files
authored
fix: remove the common files (#486)
1 parent e2914bb commit eb3df11

File tree

6 files changed

+100
-49
lines changed

6 files changed

+100
-49
lines changed

common/nlls_problem_workloads.jl

Lines changed: 0 additions & 26 deletions
This file was deleted.

common/nonlinear_problem_workloads.jl

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/NonlinearSolveFirstOrder/src/NonlinearSolveFirstOrder.jl

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
2222
update_trace!, L2_NORM,
2323
NewtonDescent, DampedNewtonDescent, GeodesicAcceleration,
2424
Dogleg
25-
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode, NonlinearFunction
25+
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode,
26+
NonlinearFunction,
27+
NonlinearLeastSquaresProblem, NonlinearProblem, NoSpecialize
2628
using SciMLJacobianOperators: VecJacOperator, JacVecOperator, StatefulJacobianOperator
2729

2830
using FiniteDiff: FiniteDiff # Default Finite Difference Method
@@ -37,8 +39,41 @@ include("pseudo_transient.jl")
3739
include("solve.jl")
3840

3941
@setup_workload begin
40-
include("../../../common/nonlinear_problem_workloads.jl")
41-
include("../../../common/nlls_problem_workloads.jl")
42+
nonlinear_functions = (
43+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), 0.1),
44+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), [0.1]),
45+
(NonlinearFunction{true, NoSpecialize}((du, u, p) -> du .= u .* u .- p), [0.1])
46+
)
47+
48+
nonlinear_problems = NonlinearProblem[]
49+
for (fn, u0) in nonlinear_functions
50+
push!(nonlinear_problems, NonlinearProblem(fn, u0, 2.0))
51+
end
52+
53+
nonlinear_functions = (
54+
(NonlinearFunction{false, NoSpecialize}((u, p) -> (u .^ 2 .- p)[1:1]), [0.1, 0.0]),
55+
(
56+
NonlinearFunction{false, NoSpecialize}((u, p) -> vcat(u .* u .- p, u .* u .- p)),
57+
[0.1, 0.1]
58+
),
59+
(
60+
NonlinearFunction{true, NoSpecialize}(
61+
(du, u, p) -> du[1] = u[1] * u[1] - p, resid_prototype = zeros(1)
62+
),
63+
[0.1, 0.0]
64+
),
65+
(
66+
NonlinearFunction{true, NoSpecialize}(
67+
(du, u, p) -> du .= vcat(u .* u .- p, u .* u .- p), resid_prototype = zeros(4)
68+
),
69+
[0.1, 0.1]
70+
)
71+
)
72+
73+
nlls_problems = NonlinearLeastSquaresProblem[]
74+
for (fn, u0) in nonlinear_functions
75+
push!(nlls_problems, NonlinearLeastSquaresProblem(fn, u0, 2.0))
76+
end
4277

4378
nlp_algs = [NewtonRaphson(), TrustRegion(), LevenbergMarquardt()]
4479
nlls_algs = [GaussNewton(), TrustRegion(), LevenbergMarquardt()]

lib/NonlinearSolveQuasiNewton/src/NonlinearSolveQuasiNewton.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
2020
AbstractApproximateJacobianUpdateRuleCache,
2121
Utils, InternalAPI, get_timer_output, @static_timeit,
2222
update_trace!, L2_NORM, NewtonDescent
23-
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode
23+
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode,
24+
NonlinearProblem, NonlinearFunction, NoSpecialize
2425
using SciMLOperators: AbstractSciMLOperator
2526

2627
include("reset_conditions.jl")
@@ -34,7 +35,16 @@ include("klement.jl")
3435
include("solve.jl")
3536

3637
@setup_workload begin
37-
include("../../../common/nonlinear_problem_workloads.jl")
38+
nonlinear_functions = (
39+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), 0.1),
40+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), [0.1]),
41+
(NonlinearFunction{true, NoSpecialize}((du, u, p) -> du .= u .* u .- p), [0.1])
42+
)
43+
44+
nonlinear_problems = NonlinearProblem[]
45+
for (fn, u0) in nonlinear_functions
46+
push!(nonlinear_problems, NonlinearProblem(fn, u0, 2.0))
47+
end
3848

3949
algs = [Broyden(), Klement()]
4050

lib/NonlinearSolveSpectralMethods/src/NonlinearSolveSpectralMethods.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,24 @@ using MaybeInplace: @bb
1111
using NonlinearSolveBase: NonlinearSolveBase, AbstractNonlinearSolveAlgorithm,
1212
AbstractNonlinearSolveCache, Utils, InternalAPI, get_timer_output,
1313
@static_timeit, update_trace!
14-
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode
14+
using SciMLBase: SciMLBase, AbstractNonlinearProblem, NLStats, ReturnCode,
15+
NonlinearProblem, NonlinearFunction, NoSpecialize
1516

1617
include("dfsane.jl")
1718

1819
include("solve.jl")
1920

2021
@setup_workload begin
21-
include("../../../common/nonlinear_problem_workloads.jl")
22+
nonlinear_functions = (
23+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), 0.1),
24+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), [0.1]),
25+
(NonlinearFunction{true, NoSpecialize}((du, u, p) -> du .= u .* u .- p), [0.1])
26+
)
27+
28+
nonlinear_problems = NonlinearProblem[]
29+
for (fn, u0) in nonlinear_functions
30+
push!(nonlinear_problems, NonlinearProblem(fn, u0, 2.0))
31+
end
2232

2333
algs = [DFSane()]
2434

src/NonlinearSolve.jl

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ using NonlinearSolveBase: NonlinearSolveBase, InternalAPI, AbstractNonlinearSolv
1616
enable_timer_outputs, disable_timer_outputs
1717

1818
using Preferences: set_preferences!
19-
using SciMLBase: SciMLBase, NLStats, ReturnCode, AbstractNonlinearProblem, NonlinearProblem,
20-
NonlinearLeastSquaresProblem
19+
using SciMLBase: SciMLBase, NLStats, ReturnCode, AbstractNonlinearProblem,
20+
NonlinearFunction,
21+
NonlinearProblem, NonlinearLeastSquaresProblem, NoSpecialize
2122
using SymbolicIndexingInterface: SymbolicIndexingInterface
2223
using StaticArraysCore: StaticArray
2324

@@ -63,8 +64,41 @@ const ALL_SOLVER_TYPES = [
6364
include("forward_diff.jl")
6465

6566
@setup_workload begin
66-
include("../common/nonlinear_problem_workloads.jl")
67-
include("../common/nlls_problem_workloads.jl")
67+
nonlinear_functions = (
68+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), 0.1),
69+
(NonlinearFunction{false, NoSpecialize}((u, p) -> u .* u .- p), [0.1]),
70+
(NonlinearFunction{true, NoSpecialize}((du, u, p) -> du .= u .* u .- p), [0.1])
71+
)
72+
73+
nonlinear_problems = NonlinearProblem[]
74+
for (fn, u0) in nonlinear_functions
75+
push!(nonlinear_problems, NonlinearProblem(fn, u0, 2.0))
76+
end
77+
78+
nonlinear_functions = (
79+
(NonlinearFunction{false, NoSpecialize}((u, p) -> (u .^ 2 .- p)[1:1]), [0.1, 0.0]),
80+
(
81+
NonlinearFunction{false, NoSpecialize}((u, p) -> vcat(u .* u .- p, u .* u .- p)),
82+
[0.1, 0.1]
83+
),
84+
(
85+
NonlinearFunction{true, NoSpecialize}(
86+
(du, u, p) -> du[1] = u[1] * u[1] - p, resid_prototype = zeros(1)
87+
),
88+
[0.1, 0.0]
89+
),
90+
(
91+
NonlinearFunction{true, NoSpecialize}(
92+
(du, u, p) -> du .= vcat(u .* u .- p, u .* u .- p), resid_prototype = zeros(4)
93+
),
94+
[0.1, 0.1]
95+
)
96+
)
97+
98+
nlls_problems = NonlinearLeastSquaresProblem[]
99+
for (fn, u0) in nonlinear_functions
100+
push!(nlls_problems, NonlinearLeastSquaresProblem(fn, u0, 2.0))
101+
end
68102

69103
@compile_workload begin
70104
@sync begin

0 commit comments

Comments
 (0)