Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 4c5b430

Browse files
format
1 parent df0f2f6 commit 4c5b430

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

src/trustRegion.jl

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,24 @@ struct SimpleTrustRegion{T, CS, AD, FDT} <: AbstractNewtonAlgorithm{CS, AD, FDT}
5959
expand_factor::T
6060
max_shrink_times::Int
6161
function SimpleTrustRegion(max_trust_radius::Number; chunk_size = Val{0}(),
62-
autodiff = Val{true}(),
63-
diff_type = Val{:forward},
64-
initial_trust_radius::Number = max_trust_radius / 11,
65-
step_threshold::Number = 0.1,
66-
shrink_threshold::Number = 0.25,
67-
expand_threshold::Number = 0.75,
68-
shrink_factor::Number = 0.25,
69-
expand_factor::Number = 2.0,
70-
max_shrink_times::Int = 32)
71-
new{typeof(initial_trust_radius), SciMLBase._unwrap_val(chunk_size),
72-
SciMLBase._unwrap_val(autodiff), SciMLBase._unwrap_val(diff_type)}(
73-
max_trust_radius, initial_trust_radius,
74-
step_threshold,
75-
shrink_threshold, expand_threshold,
76-
shrink_factor,
77-
expand_factor, max_shrink_times)
62+
autodiff = Val{true}(),
63+
diff_type = Val{:forward},
64+
initial_trust_radius::Number = max_trust_radius / 11,
65+
step_threshold::Number = 0.1,
66+
shrink_threshold::Number = 0.25,
67+
expand_threshold::Number = 0.75,
68+
shrink_factor::Number = 0.25,
69+
expand_factor::Number = 2.0,
70+
max_shrink_times::Int = 32)
71+
new{typeof(initial_trust_radius), SciMLBase._unwrap_val(chunk_size),
72+
SciMLBase._unwrap_val(autodiff), SciMLBase._unwrap_val(diff_type)}(max_trust_radius,
73+
initial_trust_radius,
74+
step_threshold,
75+
shrink_threshold,
76+
expand_threshold,
77+
shrink_factor,
78+
expand_factor,
79+
max_shrink_times)
7880
end
7981
end
8082

test/basictests.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ list_of_options = zip(max_trust_radius, initial_trust_radius, step_threshold,
243243
for options in list_of_options
244244
local probN, sol, alg
245245
alg = SimpleTrustRegion(options[1];
246-
initial_trust_radius = options[2],
247-
step_threshold = options[3],
248-
shrink_threshold = options[4],
249-
expand_threshold = options[5],
250-
shrink_factor = options[6],
251-
expand_factor = options[7],
252-
max_shrink_times = options[8])
246+
initial_trust_radius = options[2],
247+
step_threshold = options[3],
248+
shrink_threshold = options[4],
249+
expand_threshold = options[5],
250+
shrink_factor = options[6],
251+
expand_factor = options[7],
252+
max_shrink_times = options[8])
253253

254254
probN = NonlinearProblem(f, u0, p)
255255
sol = solve(probN, alg)

0 commit comments

Comments
 (0)