@@ -6,7 +6,7 @@ using NonlinearSolveBase: NonlinearSolveBase, TraceMinimal
6
6
using NonlinearSolve: NonlinearSolve, LeastSquaresOptimJL
7
7
using SciMLBase: SciMLBase, AbstractNonlinearProblem, ReturnCode
8
8
9
- const LSO = LeastSquaresOptim
9
+ const ALSO = LeastSquaresOptim
10
10
11
11
function SciMLBase. __solve (
12
12
prob:: AbstractNonlinearProblem , alg:: LeastSquaresOptimJL , args... ;
@@ -23,32 +23,32 @@ function SciMLBase.__solve(
23
23
reltol = NonlinearSolveBase. get_tolerance (reltol, eltype (u))
24
24
25
25
if prob. f. jac === nothing && alg. autodiff isa Symbol
26
- lsoprob = LSO . LeastSquaresProblem (;
26
+ lsoprob = ALSO . LeastSquaresProblem (;
27
27
x = u, f!, y = resid, alg. autodiff, J = prob. f. jac_prototype,
28
28
output_length = length (resid)
29
29
)
30
30
else
31
31
g! = NonlinearSolveBase. construct_extension_jac (prob, alg, u, resid; alg. autodiff)
32
- lsoprob = LSO . LeastSquaresProblem (;
32
+ lsoprob = ALSO . LeastSquaresProblem (;
33
33
x = u, f!, y = resid, g!, J = prob. f. jac_prototype,
34
34
output_length = length (resid)
35
35
)
36
36
end
37
37
38
- linsolve = alg. linsolve === :qr ? LSO . QR () :
39
- (alg. linsolve === :cholesky ? LSO . Cholesky () :
40
- (alg. linsolve === :lsmr ? LSO . LSMR () : nothing ))
38
+ linsolve = alg. linsolve === :qr ? ALSO . QR () :
39
+ (alg. linsolve === :cholesky ? ALSO . Cholesky () :
40
+ (alg. linsolve === :lsmr ? ALSO . LSMR () : nothing ))
41
41
42
42
lso_solver = if alg. alg === :lm
43
- LSO . LevenbergMarquardt (linsolve)
43
+ ALSO . LevenbergMarquardt (linsolve)
44
44
elseif alg. alg === :dogleg
45
- LSO . Dogleg (linsolve)
45
+ ALSO . Dogleg (linsolve)
46
46
else
47
47
throw (ArgumentError (" Unknown LeastSquaresOptim Algorithm: $(Meta. quot (alg. alg)) " ))
48
48
end
49
49
50
- allocated_prob = LSO . LeastSquaresProblemAllocated (lsoprob, lso_solver)
51
- res = LSO . optimize! (
50
+ allocated_prob = ALSO . LeastSquaresProblemAllocated (lsoprob, lso_solver)
51
+ res = ALSO . optimize! (
52
52
allocated_prob;
53
53
x_tol = reltol, f_tol = abstol, g_tol = abstol, iterations = maxiters,
54
54
show_trace = show_trace isa Val{true }, store_trace = store_trace isa Val{true },
0 commit comments