1
1
using Optimization, OptimizationBase, ForwardDiff, SymbolicAnalysis, LinearAlgebra,
2
- Manifolds, OptimizationManopt
2
+ Manifolds, OptimizationManopt, OptimizationLBFGSB
3
3
4
4
function f (x, p = nothing )
5
5
return exp (x[1 ]) + x[1 ]^ 2
8
8
optf = OptimizationFunction (f, Optimization. AutoForwardDiff ())
9
9
prob = OptimizationProblem (optf, [0.4 ], structural_analysis = true )
10
10
11
- @time sol = solve (prob, Optimization . LBFGS (), maxiters = 1000 )
11
+ @time sol = solve (prob, OptimizationLBFGSB . LBFGSB (), maxiters = 1000 )
12
12
@test sol. cache. analysis_results. objective. curvature == SymbolicAnalysis. Convex
13
13
@test sol. cache. analysis_results. constraints === nothing
14
14
@@ -18,7 +18,7 @@ l1 = rosenbrock(x0)
18
18
19
19
optf = OptimizationFunction (rosenbrock, AutoEnzyme ())
20
20
prob = OptimizationProblem (optf, x0, structural_analysis = true )
21
- @time res = solve (prob, Optimization . LBFGS (), maxiters = 100 )
21
+ @time res = solve (prob, OptimizationLBFGSB . LBFGSB (), maxiters = 100 )
22
22
@test res. cache. analysis_results. objective. curvature == SymbolicAnalysis. UnknownCurvature
23
23
24
24
function con2_c (res, x, p)
28
28
optf = OptimizationFunction (rosenbrock, AutoZygote (), cons = con2_c)
29
29
prob = OptimizationProblem (optf, x0, lcons = [1.0 , - Inf ], ucons = [1.0 , 0.0 ],
30
30
lb = [- 1.0 , - 1.0 ], ub = [1.0 , 1.0 ], structural_analysis = true )
31
- @time res = solve (prob, Optimization . LBFGS (), maxiters = 100 )
31
+ @time res = solve (prob, OptimizationLBFGSB . LBFGSB (), maxiters = 100 )
32
32
@test res. cache. analysis_results. objective. curvature == SymbolicAnalysis. UnknownCurvature
33
33
@test res. cache. analysis_results. constraints[1 ]. curvature == SymbolicAnalysis. Convex
34
34
@test res. cache. analysis_results. constraints[2 ]. curvature ==
0 commit comments