Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
cad3ac3
Add R2N and R2NLS solvers with HSL and QRMumps support
farhadrclass Jan 13, 2026
9fe8a9b
Update src/R2NLS.jl
farhadrclass Jan 29, 2026
39a045d
Apply suggestion from @dpo
farhadrclass Jan 29, 2026
6ed59d4
Apply suggestion from @dpo
farhadrclass Jan 29, 2026
0cac782
Apply suggestions from code review
farhadrclass Jan 29, 2026
8514a5e
first round
farhadrclass Jan 29, 2026
2700844
Update R2NLS.jl
farhadrclass Jan 29, 2026
0fcb997
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
3c24f47
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
3435fc2
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
d633e65
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
cb2732f
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
03d486b
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
ded7604
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
5db3477
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
f62efe8
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
3b3eeec
Update src/R2NLS.jl
farhadrclass Feb 6, 2026
f61c487
Refactor nlp->nls and QRMumps/Krylov fixes
farhadrclass Feb 8, 2026
85443c9
Refactor R2N: use LineModel and simplify line search
farhadrclass Feb 8, 2026
8a4d1e4
Update R2N.jl
farhadrclass Feb 8, 2026
3dbb0bd
Update src/R2NLS.jl
farhadrclass Feb 10, 2026
00293be
Introduce abstract subsolver API and refactor R2NLS
farhadrclass Feb 11, 2026
46c46b5
Refactor subsolver API and QRMumps init
farhadrclass Feb 16, 2026
8bbe76c
Refactor subsolver interface and implementations
farhadrclass Feb 16, 2026
7d8df56
Update R2N.jl
farhadrclass Feb 16, 2026
fdd0bcc
Update src/R2NLS.jl
farhadrclass Feb 16, 2026
c6ec0d8
Update src/R2NLS.jl
farhadrclass Feb 17, 2026
e16c38f
Refactor QRMumpsSubsolver init and return API
farhadrclass Feb 17, 2026
047df5d
Update R2NLS.jl
farhadrclass Feb 17, 2026
78c2958
Update R2NLS.jl
farhadrclass Feb 17, 2026
dc64c21
Update R2NLS.jl
farhadrclass Feb 17, 2026
7948333
Update R2NLS.jl
farhadrclass Feb 17, 2026
7711eac
Add subsolver interface; refactor QRMumps
farhadrclass Feb 18, 2026
b816081
Update R2NLS.jl
farhadrclass Feb 18, 2026
dc8d6c1
created small test env
farhadrclass Feb 18, 2026
f4b89cc
Update R2NLS.jl
farhadrclass Feb 21, 2026
a735673
Update R2N.jl
farhadrclass Feb 24, 2026
5ca14da
Add Arpack/TSVD deps and R2N updates
farhadrclass Feb 24, 2026
11daba3
Update R2N.jl
farhadrclass Feb 24, 2026
cd08e84
Update R2N.jl
farhadrclass Feb 24, 2026
d15c3ac
Refactor subsolvers into separate modules
farhadrclass Mar 27, 2026
fd42133
Use HSL subsolver direction in NPC step
farhadrclass Mar 27, 2026
40f092c
Support Armijo-Goldstein NPC and fast σ update
farhadrclass Mar 27, 2026
4340d5f
Update JSOSolvers.jl
farhadrclass Mar 30, 2026
cda10d1
Update R2N.jl
farhadrclass Mar 30, 2026
13f0e7a
Update R2N_subsolvers.jl
farhadrclass Mar 30, 2026
0adfe0e
1
farhadrclass Mar 30, 2026
4f14d70
Update R2N.jl
farhadrclass Mar 31, 2026
7b986dd
Rename update! API to update_subsolver!
farhadrclass Mar 31, 2026
f35ec5e
Update R2N.jl
farhadrclass Apr 2, 2026
58b508e
Multiple_Arm Bandit
farhadrclass Apr 5, 2026
d251f44
Update R2N_MAB.jl
farhadrclass Apr 5, 2026
2a43479
Update R2N_MAB.jl
farhadrclass Apr 6, 2026
556409a
remove MAB
farhadrclass Apr 6, 2026
a7a935c
Fix subsolver σ/atol and update subtol bound
farhadrclass Apr 7, 2026
d92f210
testing R2N
farhadrclass Apr 7, 2026
d25ba2e
Support Function/Type subsolver and add tests
farhadrclass Apr 8, 2026
495f19a
Update R2N_subsolvers.jl
farhadrclass Apr 16, 2026
7fce801
fix the Hessian issue
farhadrclass Apr 16, 2026
ca79c15
fix the LBFGS
farhadrclass Apr 16, 2026
8f0bd22
Update R2N_op.jl
farhadrclass Apr 16, 2026
086988b
Refactor quasi-Newton updates into callbacks
farhadrclass Apr 17, 2026
0e5d927
Update JSOSolvers.jl
farhadrclass Apr 20, 2026
d75c8d6
test
farhadrclass May 8, 2026
1f8fd30
fix the issue of R2NLS
farhadrclass May 15, 2026
177e987
updated R2N for atol
farhadrclass May 16, 2026
272c74f
Update R2N_test.jl
farhadrclass May 16, 2026
f3aac95
1
farhadrclass May 26, 2026
c108e53
Refactor subsolver identifiers and update tests
farhadrclass May 26, 2026
8490b2f
docs: add unconstrained benchmark & update index
farhadrclass May 26, 2026
4362c44
Update Project.toml
farhadrclass Jun 2, 2026
621e326
Update R2N.jl
farhadrclass Jun 4, 2026
eaf12b9
cleaning up
farhadrclass Jun 17, 2026
bec3d23
Update R2N.jl
farhadrclass Jun 17, 2026
c095e16
Potential fix for pull request finding
farhadrclass Jun 17, 2026
c065433
updated beased on auto-Review
farhadrclass Jun 17, 2026
db80217
updated the restart test
farhadrclass Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,40 @@ uuid = "10dff2fc-5484-5881-a0e0-c90441020f8a"
version = "0.14.8"

[deps]
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
HSL = "34c5aeac-e683-54a6-a0e9-6e0fdc586c50"
HSL_jll = "017b0a0e-03f4-516a-9b91-836bbd1904dd"
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
NLPModelsModifiers = "e01155f1-5c6f-4375-a9d8-616dd036575f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
QRMumps = "422b30a1-cc69-4d85-abe7-cc07b540c444"
SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843"
SolverParameters = "d076d87d-d1f9-4ea3-a44b-64b4cdd1e470"
SolverTools = "b5612192-2639-5dc1-abfe-fbedd65fab29"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseMatricesCOO = "fa32481b-f100-4b48-8dc8-c62f61b13870"
TSVD = "9449cd9e-2762-5aa3-a617-5413e99d722e"

[compat]
Krylov = "0.10.0"
LinearOperators = "2.0"
Arpack = "0.5.4"
GenericLinearAlgebra = "0.3.19"
HSL = "0.5.2"
Krylov = "0.10.1"
LinearOperators = "2.14.1"
NLPModels = "0.21"
NLPModelsModifiers = "0.7, 0.8"
QRMumps = "0.3.2"
SolverCore = "0.3"
SolverParameters = "0.1"
SolverTools = "0.10"
SparseArrays = "1.11.0"
SparseMatricesCOO = "0.2.6"
TSVD = "0.4.4"
julia = "1.10"

[extras]
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ This package provides an implementation of four classic algorithms for unconstra
> DOI: [10.1007/BF01589116](https://doi.org/10.1007/BF01589116)


- `R2N`: An inexact second-order quadratic regularization method for unconstrained optimization (with shifted L-BFGS or shifted Hessian operator);

- `R2`: a first-order quadratic regularization method for unconstrained optimization;

> E. G. Birgin, J. L. Gardenghi, J. M. Martínez, S. A. Santos, Ph. L. Toint. (2017).
> Worst-case evaluation complexity for unconstrained nonlinear optimization using
> high-order regularized models. *Mathematical Programming*, 163(1), 359-368.
> DOI: [10.1007/s10107-016-1065-8](https://doi.org/10.1007/s10107-016-1065-8)

- `R2NLS`: an inexact second-order quadratic regularization method for nonlinear least-squares problems;

- `fomo`: a first-order method with momentum for unconstrained optimization;

- `tron`: a pure Julia implementation of TRON, a trust-region solver for bound-constrained optimization described in
Expand Down Expand Up @@ -68,7 +72,7 @@ using JSOSolvers, ADNLPModels

# Rosenbrock
nlp = ADNLPModel(x -> 100 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2, [-1.2; 1.0])
stats = lbfgs(nlp) # or trunk, tron, R2
stats = lbfgs(nlp) # or trunk, tron, R2, R2N
```

## Documentation
Expand Down
44 changes: 44 additions & 0 deletions docs/src/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,47 @@ print_pp_column(:neval_obj, stats) # with respect to number of objective evaluat
``` @example ex1
print_pp_column(:neval_grad, stats) # with respect to number of gradient evaluations
```

## Unconstrained Benchmark

We can also benchmark unconstrained solvers, such as `R2N`, on the `pnames_unconstrained` subset we identified earlier. For instance, comparing `R2N` against `trunk`:

```@example ex1
cutest_unc_problems = (CUTEstModel(p) for p in pnames_unconstrained)

solvers_unc = Dict(
:trunk => nlp -> trunk(
nlp,
max_time = max_time,
max_iter = typemax(Int64),
max_eval = typemax(Int64),
atol = tol,
rtol = tol,
),
:R2N => nlp -> R2N(
nlp,
max_time = max_time,
max_iter = typemax(Int64),
max_eval = typemax(Int64),
atol = tol,
rtol = tol,
),
)

stats_unc = bmark_solvers(solvers_unc, cutest_unc_problems)

```

We can explore the results and generate performance profiles for these unconstrained solvers just as we did before:

```@example ex1
pretty_stats(stats_unc[:R2N])

```

```@example ex1
print_pp_column(:elapsed_time, stats_unc)

```

**Note on `R2NLS`:** To benchmark the `R2NLS` solver on nonlinear least-squares (NLS) problems, you can follow this exact same pattern by providing a collection of `AbstractNLSModel` instances instead of general `CUTEstModel`s.
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The main dependencies required to use the solvers are:

- `SolverTools.jl` – provides common optimization components such as line searches, stopping conditions, and trace utilities;

- `Krylov.jl` – used by second-order methods such as TRON and TRUNK for solving Newton or trust-region subproblems;
- `Krylov.jl` – used by second-order methods such as TRON, TRUNK, R2N, and R2NLS for solving Newton, regularized, or trust-region subproblems;

- `LinearOperators.jl` – provides abstractions for matrix-free linear operators used by iterative methods;

Expand Down Expand Up @@ -116,7 +116,7 @@ where `nlp` is an AbstractNLPModel or some specialization, such as an `AbstractN
- `max_eval` is the maximum number of objective and constraints function evaluations (default: `-1`, which means no limit);
- `max_time` is the maximum allowed elapsed time (default: `30.0`);
- `callback` is a function that is called at each iteration;
- `callback_quasi_newton` is a function that is called at each iteration to perform quasi-Newton updates, if appropriate (currently only supported by TRON and TRUNK);
- `callback_quasi_newton` is a function that is called at each iteration to perform quasi-Newton updates, if appropriate (currently only supported by TRON , TRUNK, and R2N);
- `stats` is a `SolverTools.GenericExecutionStats` with the output of the solver.

### Callbacks
Expand Down
8 changes: 6 additions & 2 deletions docs/src/solvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
- [`trunk`](@ref)
- [`R2`](@ref)
- [`fomo`](@ref)
- [`R2N`](@ref)
- [`R2NLS`](@ref)

| Problem type | Solvers |
| --------------------- | -------- |
| Unconstrained Nonlinear Optimization Problem | [`lbfgs`](@ref), [`tron`](@ref), [`trunk`](@ref), [`R2`](@ref), [`fomo`](@ref)|
| Unconstrained Nonlinear Least Squares | [`trunk`](@ref), [`tron`](@ref) |
| Unconstrained Nonlinear Optimization Problem | [`lbfgs`](@ref), [`tron`](@ref), [`trunk`](@ref), [`R2`](@ref), [`fomo`](@ref), [`R2N`](@ref)|
| Unconstrained Nonlinear Least Squares | [`trunk`](@ref), [`tron`](@ref), [`R2NLS`](@ref)|
| Bound-constrained Nonlinear Optimization Problem | [`tron`](@ref) |
| Bound-constrained Nonlinear Least Squares | [`tron`](@ref) |

Expand All @@ -23,4 +25,6 @@ tron
trunk
R2
fomo
R2N
R2NLS
```
10 changes: 9 additions & 1 deletion src/JSOSolvers.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module JSOSolvers

# stdlib
using LinearAlgebra, Logging, Printf
using LinearAlgebra, Logging, Printf, SparseArrays

# JSO packages
using Arpack, TSVD, GenericLinearAlgebra
using Krylov,
LinearOperators, NLPModels, NLPModelsModifiers, SolverCore, SolverParameters, SolverTools


import SolverTools.reset!
import SolverCore.solve!
export default_callback_quasi_newton, solve!
Expand Down Expand Up @@ -58,14 +60,20 @@ function default_callback_quasi_newton(
end
end
end
# subsolver interface
include("r2n_subsolver_common.jl")
include("R2N_subsolvers.jl")
include("R2NLS_subsolvers.jl")

# Unconstrained solvers
include("lbfgs.jl")
include("trunk.jl")
include("fomo.jl")
include("R2N.jl")

# Unconstrained solvers for NLS
include("trunkls.jl")
include("R2NLS.jl")

# List of keywords accepted by TRONTrustRegion
const tron_keys = (
Expand Down
Loading
Loading