Skip to content

Commit e8cb911

Browse files
committed
Update tutorials to use JSOSolvers 0.14 with Symbol-based subsolver API
- Update JSOSolvers from 0.11 to 0.14 in Project.toml files - Update Krylov from 0.9 to 0.10 (required by JSOSolvers 0.14) - Replace Type-based subsolver API with Symbol-based API: * subsolver_type = CglsSolver → subsolver = :cgls * subsolver_type = LsmrSolver → subsolver = :lsmr * etc. - Remove Krylov.jl import (no longer needed for subsolver types) - Remove compatibility note about JSOSolvers 0.11 This addresses issue #145 by updating to the new subsolver API introduced in JSOSolvers 0.14.0. Affected tutorials: - tutorials/advanced-jsosolvers/ - tutorials/introduction-to-jsosolvers/ Tests: All package tests pass ✓
1 parent e3bc894 commit e8cb911

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

tutorials/advanced-jsosolvers/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ SolverBenchmark = "581a75fa-a23a-52d0-a590-d6201de2218a"
88

99
[compat]
1010
ADNLPModels = "0.7"
11-
JSOSolvers = "0.11"
12-
Krylov = "0.9"
11+
JSOSolvers = "0.14"
12+
Krylov = "0.10"
1313
OptimizationProblems = "0.7"
1414
Plots = "1"
1515
SolverBenchmark = "0.6"

tutorials/advanced-jsosolvers/index.jmd

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ author: "Tangi Migot"
88

99
This tutorial showcases some advanced features of solvers in JSOSolvers.
1010

11-
**Note**: This tutorial is compatible with JSOSolvers 0.11. The subsolver is selected using the `subsolver_type` parameter with Krylov solver types (e.g., `CglsSolver`, `LsmrSolver`).
12-
1311
```julia
1412
using JSOSolvers
1513
```
@@ -49,33 +47,29 @@ JSOSolvers.tronls_allowed_subsolvers
4947
These linear least squares solvers are implemented in the package [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl).
5048
For detailed descriptions of each subsolver's algorithm and when to use it, see the [Krylov.jl documentation](https://jso.dev/Krylov.jl/stable/).
5149

52-
```julia
53-
using Krylov
54-
```
55-
5650
We define a dictionary of the different solvers that will be benchmarked.
5751
We consider here four variants of TRUNK using the different subsolvers.
5852

5953
For example, to call TRUNK with an explicit subsolver:
6054

6155
```julia
62-
stats = trunk(nls, subsolver_type = CglsSolver)
56+
stats = trunk(nls, subsolver = :cgls)
6357
```
6458

6559
The same subsolver selection pattern applies to TRON's least-squares specialization:
6660

6761
```julia
68-
stats_tron = tron(nls, subsolver_type = LsmrSolver)
62+
stats_tron = tron(nls, subsolver = :lsmr)
6963
```
7064

7165
Now we define the solver dictionary for benchmarking:
7266

7367
```julia
7468
solvers = Dict(
75-
:trunk_cgls => model -> trunk(model, subsolver_type = CglsSolver),
76-
:trunk_crls => model -> trunk(model, subsolver_type = CrlsSolver),
77-
:trunk_lsqr => model -> trunk(model, subsolver_type = LsqrSolver),
78-
:trunk_lsmr => model -> trunk(model, subsolver_type = LsmrSolver)
69+
:trunk_cgls => model -> trunk(model, subsolver = :cgls),
70+
:trunk_crls => model -> trunk(model, subsolver = :crls),
71+
:trunk_lsqr => model -> trunk(model, subsolver = :lsqr),
72+
:trunk_lsmr => model -> trunk(model, subsolver = :lsmr)
7973
)
8074
```
8175

tutorials/introduction-to-jsosolvers/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843"
1212
ADNLPModels = "0.7"
1313
CSV = "0.10"
1414
DataFrames = "1.4"
15-
JSOSolvers = "0.11"
15+
JSOSolvers = "0.14"
1616
Plots = "1.38"
1717
SolverCore = "0.3"

0 commit comments

Comments
 (0)