You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(advanced-jsosolvers): clarify JSOSolvers 0.11 compatibility and improve documentation
- Add note that tutorial works with JSOSolvers 0.11 using subsolver_type parameter
- Keep correct API: subsolver_type = CglsSolver (not subsolver = :cgls)
- Add explicit TRUNK and TRON examples showing subsolver_type usage
- Link to Krylov.jl documentation for subsolver details
- Fix grammar: "solver TRUNK" (singular), "subsolvers are", "was...instances"
- Fix heading: "in JSOSolvers" instead of "JSOSolvers solvers"
The tutorial now correctly documents the API that actually works with JSOSolvers 0.11.
# Comparing subsolvers for nonlinear least squares JSOSolvers solvers
7
+
# Comparing subsolvers for nonlinear least squares in JSOSolvers
8
8
9
9
This tutorial showcases some advanced features of solvers in JSOSolvers.
10
10
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
+
11
13
```julia
12
14
using JSOSolvers
13
15
```
14
16
15
-
We benchmark different subsolvers used in the solvers TRUNK for unconstrained nonlinear least squares problems.
17
+
We benchmark different subsolvers used in the solver TRUNK for unconstrained nonlinear least squares problems.
16
18
The first step is to select a set of problems that are nonlinear least squares.
17
19
18
20
```julia
@@ -38,13 +40,14 @@ For this task, several solvers are available.
38
40
JSOSolvers.trunkls_allowed_subsolvers
39
41
```
40
42
41
-
This benchmark could also be followed for the solver TRON where the following subsolver are available.
43
+
This benchmark could also be followed for the solver TRON where the following subsolvers are available.
42
44
43
45
```julia
44
46
JSOSolvers.tronls_allowed_subsolvers
45
47
```
46
48
47
49
These linear least squares solvers are implemented in the package [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl).
50
+
For detailed descriptions of each subsolver's algorithm and when to use it, see the [Krylov.jl documentation](https://jso.dev/Krylov.jl/stable/).
48
51
49
52
```julia
50
53
using Krylov
@@ -53,6 +56,20 @@ using Krylov
53
56
We define a dictionary of the different solvers that will be benchmarked.
54
57
We consider here four variants of TRUNK using the different subsolvers.
55
58
59
+
For example, to call TRUNK with an explicit subsolver:
60
+
61
+
```julia
62
+
stats = trunk(nls, subsolver_type = CglsSolver)
63
+
```
64
+
65
+
The same subsolver selection pattern applies to TRON's least-squares specialization:
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.
94
-
The size of the problems were rather small here, so this should be confirmed on larger instance.
111
+
The size of the problems was rather small here, so this should be confirmed on larger instances.
95
112
Moreover, the results may vary depending on the origin of the test problems.
0 commit comments