@@ -10,27 +10,25 @@ function test_on_library(
10
10
x = dict[" start" ]
11
11
res = similar (x)
12
12
nlprob = NonlinearProblem (problem, copy (x))
13
- @testset " $idx : $(dict[" title" ]) " begin
14
- for alg in alg_ops
15
- try
16
- sol = solve (nlprob, alg; maxiters = 10000 )
17
- problem (res, sol. u, nothing )
18
-
19
- skip = skip_tests != = nothing && idx in skip_tests[alg]
20
- if skip
21
- @test_skip norm (res, Inf ) ≤ ϵ
22
- continue
23
- end
24
- broken = idx in broken_tests[alg] ? true : false
25
- @test norm (res, Inf )≤ ϵ broken= broken
26
- catch err
27
- @error err
28
- broken = idx in broken_tests[alg] ? true : false
29
- if broken
30
- @test false broken= true
31
- else
32
- @test 1 == 2
33
- end
13
+ @testset " $idx : $(dict[" title" ]) | alg #$(alg_id) " for (alg_id, alg) in enumerate (alg_ops)
14
+ try
15
+ sol = solve (nlprob, alg; maxiters = 10000 )
16
+ problem (res, sol. u, nothing )
17
+
18
+ skip = skip_tests != = nothing && idx in skip_tests[alg]
19
+ if skip
20
+ @test_skip norm (res, Inf ) ≤ ϵ
21
+ continue
22
+ end
23
+ broken = idx in broken_tests[alg] ? true : false
24
+ @test norm (res, Inf )≤ ϵ broken= broken
25
+ catch err
26
+ @error err
27
+ broken = idx in broken_tests[alg] ? true : false
28
+ if broken
29
+ @test false broken= true
30
+ else
31
+ @test 1 == 2
34
32
end
35
33
end
36
34
end
40
38
export test_on_library, problems, dicts
41
39
end
42
40
43
- @testitem " PolyAlgorithms" setup= [RobustnessTesting] tags= [:core ] begin
41
+ @testitem " 23 Test Problems: PolyAlgorithms" setup= [RobustnessTesting] tags= [:core ] begin
44
42
alg_ops = (RobustMultiNewton (), FastShortcutNonlinearPolyalg ())
45
43
46
44
broken_tests = Dict (alg => Int[] for alg in alg_ops)
50
48
test_on_library (problems, dicts, alg_ops, broken_tests)
51
49
end
52
50
53
- @testitem " NewtonRaphson" setup= [RobustnessTesting] tags= [:core ] begin
54
- alg_ops = (NewtonRaphson (),)
51
+ @testitem " 23 Test Problems: NewtonRaphson" setup= [RobustnessTesting] tags= [:core ] begin
52
+ alg_ops = (
53
+ NewtonRaphson (),
54
+ SimpleNewtonRaphson ()
55
+ )
55
56
56
57
broken_tests = Dict (alg => Int[] for alg in alg_ops)
57
58
broken_tests[alg_ops[1 ]] = [1 ]
58
59
59
60
test_on_library (problems, dicts, alg_ops, broken_tests)
60
61
end
61
62
62
- @testitem " TrustRegion" setup= [RobustnessTesting] tags= [:core ] begin
63
+ @testitem " 23 Test Problems: Halley" setup= [RobustnessTesting] tags= [:core ] begin
64
+ alg_ops = (SimpleHalley (; autodiff = AutoForwardDiff ()),)
65
+
66
+ broken_tests = Dict (alg => Int[] for alg in alg_ops)
67
+ if Sys. isapple ()
68
+ broken_tests[alg_ops[1 ]] = [1 , 5 , 11 , 15 , 16 , 18 ]
69
+ else
70
+ broken_tests[alg_ops[1 ]] = [1 , 5 , 15 , 16 , 18 ]
71
+ end
72
+
73
+ test_on_library (problems, dicts, alg_ops, broken_tests)
74
+ end
75
+
76
+ @testitem " 23 Test Problems: TrustRegion" setup= [RobustnessTesting] tags= [:core ] begin
63
77
alg_ops = (
64
78
TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. Simple),
65
79
TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. Fan),
66
80
TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. Hei),
67
81
TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. Yuan),
68
82
TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. Bastin),
69
- TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. NLsolve)
83
+ TrustRegion (; radius_update_scheme = RadiusUpdateSchemes. NLsolve),
84
+ SimpleTrustRegion (),
85
+ SimpleTrustRegion (; nlsolve_update_rule = Val (true ))
70
86
)
71
87
72
88
broken_tests = Dict (alg => Int[] for alg in alg_ops)
76
92
broken_tests[alg_ops[4 ]] = [8 , 11 , 21 ]
77
93
broken_tests[alg_ops[5 ]] = [21 ]
78
94
broken_tests[alg_ops[6 ]] = [11 , 21 ]
95
+ broken_tests[alg_ops[7 ]] = [3 , 15 , 16 , 21 ]
96
+ broken_tests[alg_ops[8 ]] = [15 , 16 ]
79
97
80
98
test_on_library (problems, dicts, alg_ops, broken_tests)
81
99
end
82
100
83
- @testitem " LevenbergMarquardt" setup= [RobustnessTesting] tags= [:core ] begin
101
+ @testitem " 23 Test Problems: LevenbergMarquardt" setup= [RobustnessTesting] tags= [:core ] begin
84
102
using LinearSolve
85
103
86
104
alg_ops = (
97
115
test_on_library (problems, dicts, alg_ops, broken_tests)
98
116
end
99
117
100
- @testitem " DFSane" setup= [RobustnessTesting] tags= [:core ] begin
101
- alg_ops = (DFSane (),)
118
+ @testitem " 23 Test Problems: DFSane" setup= [RobustnessTesting] tags= [:core ] begin
119
+ alg_ops = (
120
+ DFSane (),
121
+ SimpleDFSane ()
122
+ )
102
123
103
124
broken_tests = Dict (alg => Int[] for alg in alg_ops)
104
125
broken_tests[alg_ops[1 ]] = [1 , 2 , 3 , 5 , 21 ]
126
+ if Sys. isapple ()
127
+ broken_tests[alg_ops[2 ]] = [1 , 2 , 3 , 5 , 6 , 21 ]
128
+ else
129
+ broken_tests[alg_ops[2 ]] = [1 , 2 , 3 , 5 , 6 , 11 , 21 ]
130
+ end
105
131
106
132
test_on_library (problems, dicts, alg_ops, broken_tests)
107
133
end
108
134
109
- @testitem " Broyden" setup= [RobustnessTesting] tags= [:core ] retries= 3 begin
135
+ @testitem " 23 Test Problems: Broyden" setup= [RobustnessTesting] tags= [:core ] retries= 3 begin
110
136
alg_ops = (
111
137
Broyden (),
112
138
Broyden (; init_jacobian = Val (:true_jacobian )),
113
139
Broyden (; update_rule = Val (:bad_broyden )),
114
- Broyden (; init_jacobian = Val (:true_jacobian ), update_rule = Val (:bad_broyden ))
140
+ Broyden (; init_jacobian = Val (:true_jacobian ), update_rule = Val (:bad_broyden )),
141
+ SimpleBroyden ()
115
142
)
116
143
117
144
broken_tests = Dict (alg => Int[] for alg in alg_ops)
145
+ broken_tests[alg_ops[2 ]] = [1 , 5 , 8 , 11 , 18 ]
146
+ broken_tests[alg_ops[4 ]] = [5 , 6 , 8 , 11 ]
118
147
if Sys. isapple ()
119
148
broken_tests[alg_ops[1 ]] = [1 , 5 , 11 ]
120
- broken_tests[alg_ops[2 ]] = [1 , 5 , 8 , 11 , 18 ]
121
149
broken_tests[alg_ops[3 ]] = [1 , 5 , 6 , 9 , 11 ]
122
- broken_tests[alg_ops[4 ]] = [5 , 6 , 8 , 11 , 16 ]
123
150
else
124
151
broken_tests[alg_ops[1 ]] = [1 , 5 , 11 , 15 ]
125
- broken_tests[alg_ops[2 ]] = [1 , 5 , 8 , 11 , 18 ]
126
- broken_tests[alg_ops[3 ]] = [1 , 5 , 9 , 11 ]
127
- broken_tests[alg_ops[4 ]] = [5 , 6 , 8 , 11 ]
152
+ broken_tests[alg_ops[3 ]] = [1 , 5 , 9 , 11 , 16 ]
128
153
end
154
+ broken_tests[alg_ops[5 ]] = [1 , 5 , 11 ]
129
155
130
156
test_on_library (problems, dicts, alg_ops, broken_tests, Sys. isapple () ? 1e-3 : 1e-4 )
131
157
end
132
158
133
- @testitem " Klement" setup= [RobustnessTesting] tags= [:core ] begin
134
- alg_ops = (Klement (), Klement (; init_jacobian = Val (:true_jacobian_diagonal )))
159
+ @testitem " 23 Test Problems: Klement" setup= [RobustnessTesting] tags= [:core ] begin
160
+ alg_ops = (
161
+ Klement (),
162
+ Klement (; init_jacobian = Val (:true_jacobian_diagonal )),
163
+ SimpleKlement ()
164
+ )
135
165
136
166
broken_tests = Dict (alg => Int[] for alg in alg_ops)
137
167
broken_tests[alg_ops[1 ]] = [1 , 2 , 4 , 5 , 11 , 18 , 22 ]
138
168
broken_tests[alg_ops[2 ]] = [2 , 4 , 5 , 7 , 18 , 22 ]
169
+ broken_tests[alg_ops[3 ]] = [1 , 2 , 4 , 5 , 11 , 22 ]
139
170
140
171
test_on_library (problems, dicts, alg_ops, broken_tests)
141
172
end
142
173
143
- @testitem " PseudoTransient" setup= [RobustnessTesting] tags= [:core ] begin
174
+ @testitem " 23 Test Problems: PseudoTransient" setup= [RobustnessTesting] tags= [:core ] begin
144
175
# PT relies on the root being a stable equilibrium for convergence, so it won't work on
145
176
# most problems
146
177
alg_ops = (PseudoTransient (),)
0 commit comments