Skip to content

Commit 8248e78

Browse files
committed
Revert "Bump JSOSolvers to 0.14 and in JSOSolvers tutorials (#148)"
This reverts commit 431abfd.
1 parent 431abfd commit 8248e78

File tree

4 files changed

+19
-26
lines changed

4 files changed

+19
-26
lines changed

tutorials/advanced-jsosolvers/Project.toml

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

99
[compat]
1010
ADNLPModels = "0.7"
11-
JSOSolvers = "0.14"
11+
JSOSolvers = "0.11"
12+
Krylov = "0.9"
1213
OptimizationProblems = "0.7"
1314
Plots = "1"
1415
SolverBenchmark = "0.6"

tutorials/advanced-jsosolvers/index.jmd

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ tags: ["solvers", "krylov", "benchmark", "least squares"]
44
author: "Tangi Migot"
55
---
66

7-
# Comparing subsolvers for nonlinear least squares in JSOSolvers
7+
# Comparing subsolvers for nonlinear least squares JSOSolvers solvers
88

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

11-
We benchmark different subsolvers used in the solver TRUNK for unconstrained nonlinear least squares problems.
11+
```julia
12+
using JSOSolvers
13+
```
14+
15+
We benchmark different subsolvers used in the solvers TRUNK for unconstrained nonlinear least squares problems.
1216
The first step is to select a set of problems that are nonlinear least squares.
1317

1418
```julia
15-
using JSOSolvers, ADNLPModels
19+
using ADNLPModels
1620
using OptimizationProblems
1721
using OptimizationProblems.ADNLPProblems
1822
df = OptimizationProblems.meta
@@ -34,38 +38,27 @@ For this task, several solvers are available.
3438
JSOSolvers.trunkls_allowed_subsolvers
3539
```
3640

37-
This benchmark could also be followed for the solver TRON where the following subsolvers are available.
41+
This benchmark could also be followed for the solver TRON where the following subsolver are available.
3842

3943
```julia
4044
JSOSolvers.tronls_allowed_subsolvers
4145
```
4246

4347
These linear least squares solvers are implemented in the package [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl).
44-
For detailed descriptions of each subsolver's algorithm and when to use it, see the [Krylov.jl documentation](https://jso.dev/Krylov.jl/stable/).
45-
46-
We define a dictionary of the different solvers that will be benchmarked.
47-
We consider here four variants of TRUNK using the different subsolvers.
48-
49-
For example, to call TRUNK with an explicit subsolver:
5048

5149
```julia
52-
stats = trunk(nls, subsolver = :cgls)
50+
using Krylov
5351
```
5452

55-
The same subsolver selection pattern applies to TRON's least-squares specialization:
56-
57-
```julia
58-
stats_tron = tron(nls, subsolver = :lsmr)
59-
```
60-
61-
Now we define the solver dictionary for benchmarking:
53+
We define a dictionary of the different solvers that will be benchmarked.
54+
We consider here four variants of TRUNK using the different subsolvers.
6255

6356
```julia
6457
solvers = Dict(
65-
:trunk_cgls => model -> trunk(model, subsolver = :cgls),
66-
:trunk_crls => model -> trunk(model, subsolver = :crls),
67-
:trunk_lsqr => model -> trunk(model, subsolver = :lsqr),
68-
:trunk_lsmr => model -> trunk(model, subsolver = :lsmr)
58+
:trunk_cgls => model -> trunk(model, subsolver_type = CglsSolver),
59+
:trunk_crls => model -> trunk(model, subsolver_type = CrlsSolver),
60+
:trunk_lsqr => model -> trunk(model, subsolver_type = LsqrSolver),
61+
:trunk_lsmr => model -> trunk(model, subsolver_type = LsmrSolver)
6962
)
7063
```
7164

@@ -98,5 +91,5 @@ profile_solvers(stats, costs, costnames)
9891
```
9992

10093
The CRLS and CGLS variants are the ones solving more problems, and even though the difference is rather small the CGLS variant is consistently faster which seems to indicate that it is the most appropriate subsolver for TRUNK.
101-
The size of the problems was rather small here, so this should be confirmed on larger instances.
94+
The size of the problems were rather small here, so this should be confirmed on larger instance.
10295
Moreover, the results may vary depending on the origin of the test problems.

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.14"
15+
JSOSolvers = "0.11"
1616
Plots = "1.38"
1717
SolverCore = "0.3"

tutorials/introduction-to-jsosolvers/index.jmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ The following examples illustrate this specialization.
4747
To list the allowed least-squares subsolvers for these specializations:
4848

4949
```julia
50-
using JSOSolvers
5150
JSOSolvers.trunkls_allowed_subsolvers
5251
JSOSolvers.tronls_allowed_subsolvers
5352
```

0 commit comments

Comments
 (0)