Skip to content

Commit bb62b08

Browse files
committed
fix: move JSOSolvers import before subsolver list call
The code was trying to access JSOSolvers.trunkls_allowed_subsolvers before importing the JSOSolvers package, causing an UndefVarError. This moves the 'using JSOSolvers' statement before the subsolver list display.
1 parent 277cf88 commit bb62b08

File tree

1 file changed

+4
-1
lines changed
  • tutorials/introduction-to-jsosolvers

1 file changed

+4
-1
lines changed

tutorials/introduction-to-jsosolvers/index.jmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ The solvers `tron` and `trunk` both have a specialized implementation for input
4444

4545
The following examples illustrate this specialization.
4646

47+
```julia
48+
using JSOSolvers, ADNLPModels
49+
```
50+
4751
To list the allowed least-squares subsolvers for these specializations:
4852

4953
```julia
@@ -52,7 +56,6 @@ JSOSolvers.tronls_allowed_subsolvers
5256
```
5357

5458
```julia
55-
using JSOSolvers, ADNLPModels
5659
f(x) = (x[1] - 1)^2 + 4 * (x[2] - x[1]^2)^2
5760
nlp = ADNLPModel(f, [-1.2; 1.0])
5861
trunk(nlp, atol = 1e-6, rtol = 1e-6)

0 commit comments

Comments
 (0)