From a8fe8a08befb02d86b55d0ea9f11c6db7cc3876a Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Sun, 22 Oct 2023 15:16:17 -0400 Subject: [PATCH] evaluate inplace constraint --- docs/src/examples/rosenbrock.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/examples/rosenbrock.md b/docs/src/examples/rosenbrock.md index 887a2cb94..cce11090c 100644 --- a/docs/src/examples/rosenbrock.md +++ b/docs/src/examples/rosenbrock.md @@ -5,7 +5,7 @@ flexibility of Optimization.jl. This is a gauntlet of many solvers to get a feel for common workflows of the package and give copy-pastable starting points. !!! note - + This example uses many different solvers of Optimization.jl. Each solver subpackage needs to be installed separate. For example, for the details on the installation and usage of OptimizationOptimJL.jl package, see the @@ -80,7 +80,9 @@ prob = OptimizationProblem(optf, x0, _p, lcons = [0.5], ucons = [0.5], sol = solve(prob, IPNewton()) # Notice now that x[1]^2 + x[2]^2 ≈ 0.5: -cons(sol.u, _p) +res = zeros(1) +cons(res, sol.u, _p) +println(res) ``` ```@example rosenbrock