Skip to content

Commit bf8859b

Browse files
authored
Change NLopt to OptimizationNLopt
With `using NLopt`, you get ```julia using Optimization using NLopt rosenbrock(x, p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2 x0 = zeros(2) p = [1.0, 100.0] f = OptimizationFunction(rosenbrock) prob = Optimization.OptimizationProblem(f, x0, p, lb = [-1.0,-1.0], ub = [1.0,1.0]) sol = solve(prob, NLopt.LN_NELDERMEAD()) ERROR: MethodError: objects of type Algorithm are not callable Stacktrace: [1] top-level scope @ Untitled-1:8 ``` this is fixed when doing `using OptimizationNLopt` (and matches the rest fo the tutorial).
1 parent 0939fdf commit bf8859b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/src/optimization_packages/nlopt.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The Rosenbrock function can be optimized using the `NLopt.LN_NELDERMEAD()` as fo
9393

9494
```@example NLopt1
9595
using Optimization
96-
using NLopt
96+
using OptimizationNLopt
9797
rosenbrock(x, p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2
9898
x0 = zeros(2)
9999
p = [1.0, 100.0]

0 commit comments

Comments
 (0)