Skip to content

Commit 58b059e

Browse files
authored
Bump to Krylov 0.10 (#148)
* Bump to Krylov 0.10 * up docs
1 parent 591963e commit 58b059e

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ StoppingInterface = "53949629-e8ff-437b-b6e7-14da1a85bf25"
2222

2323
[compat]
2424
FastClosures = "0.2, 0.3"
25-
JSOSolvers = "0.9, 0.10, 0.11, 0.12, 0.13"
26-
Krylov = "0.8, 0.9"
25+
JSOSolvers = "0.14"
26+
Krylov = "0.10"
2727
LDLFactorizations = "0.8, 0.9, 0.10"
2828
LinearOperators = "^2.7"
29-
NLPModels = "0.18, 0.19, 0.20, 0.21"
29+
NLPModels = "0.21"
3030
NLPModelsIpopt = "0.10"
3131
NLPModelsKnitro = "0.9"
32-
NLPModelsModifiers = "0.5, 0.6, 0.7"
32+
NLPModelsModifiers = "0.7"
3333
SolverCore = "0.3"
3434
Stopping = "0.6"
3535
StoppingInterface = "0.5"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Stopping = "c4fe5a9e-e7fb-5c3d-89d5-7f405ab2214f"
1313
[compat]
1414
ADNLPModels = "0.8"
1515
Documenter = "0.27"
16-
JSOSolvers = "0.13"
16+
JSOSolvers = "0.14"
1717
NLPModels = "0.21"
1818
NLPModelsIpopt = "0.10"
1919
OptimizationProblems = "0.9"

docs/src/fine-tuneFPS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ The metadata for the feasibility procedure is defined in a `GNSolver` structure
108108
| `Δ₀` | `Real` | `1.0` | Feasibility step: initial radius. |
109109
| `feas_expected_decrease` | `Real` | `0.95` | Feasibility step: bad steps are when ‖c(z)‖ / ‖c(x)‖ >feas_expected_decrease. |
110110
| `bad_steps_lim` | `Integer` | `3` | Feasibility step: consecutive bad steps before using a second order step. |
111-
| `TR_compute_step` | `KrylovSolver` | `LsmrSolver` | Compute the direction in feasibility step. |
112-
| `aggressive_step` | `KrylovSolver` | `CgSolver` | Compute the (aggressive) direction in feasibility step. |
111+
| `TR_compute_step` | `KrylovWorkspace` | `LsmrWorkspace` | Compute the direction in feasibility step. |
112+
| `aggressive_step` | `KrylovWorkspace` | `CgWorkspace` | Compute the (aggressive) direction in feasibility step. |

src/feasibility.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function feasibility_step(
117117
# Safeguard: aggressive normal step
118118
if normcz > ρ && (consecutive_bad_steps bad_steps_lim || failed_step_comp)
119119
Hz = hess_op(nlp, z, cz, obj_weight = zero(T))
120-
Krylov.solve!(feasibility_solver.aggressive_step, Hz + Jz' * Jz, Jz' * cz)
120+
krylov_solve!(feasibility_solver.aggressive_step, Hz + Jz' * Jz, Jz' * cz)
121121
d = feasibility_solver.aggressive_step.x
122122
stats = feasibility_solver.aggressive_step.stats
123123
if !stats.solved
@@ -206,7 +206,7 @@ using `lsmr` method from `Krylov.jl`.
206206
- `solved`: `true` if the problem has been successfully solved.
207207
"""
208208
function TR_lsmr(solver, cz, Jz, ctol::AbstractFloat, Δ::T, normcz::AbstractFloat, Jd) where {T}
209-
Krylov.solve!(
209+
krylov_solve!(
210210
solver,
211211
Jz,
212212
-cz,

src/parameters.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ The keyword arguments may include:
137137
- `Δ₀::T=one(T)`: Feasibility step: initial radius.
138138
- `bad_steps_lim::Integer=3`: Feasibility step: consecutive bad steps before using a second order step.
139139
- `feas_expected_decrease::T=T(0.95)`: Feasibility step: bad steps are when `‖c(z)‖ / ‖c(x)‖ >feas_expected_decrease`.
140-
- `TR_compute_step = LsmrSolver(length(y0), length(x0), S)`: Compute the direction in feasibility step.
141-
- `aggressive_step = CgSolver(length(x0), length(x0), S)`: Compute the direction in feasibility step in agressive mode.
140+
- `TR_compute_step = LsmrWorkspace(length(y0), length(x0), S)`: Compute the direction in feasibility step.
141+
- `aggressive_step = CgWorkspace(length(x0), length(x0), S)`: Compute the direction in feasibility step in agressive mode.
142142
"""
143143
mutable struct GNSolver
144144
# Parameters
@@ -158,8 +158,8 @@ mutable struct GNSolver
158158
workspace_Jtv
159159

160160
# Compute TR-step
161-
TR_compute_step # ::KrylovSolver{eltype(S), S}
162-
aggressive_step # ::KrylovSolver{eltype(S), S}
161+
TR_compute_step # ::KrylovWorkspace{eltype(S), S}
162+
aggressive_step # ::KrylovWorkspace{eltype(S), S}
163163
end
164164

165165
function GNSolver(
@@ -172,8 +172,8 @@ function GNSolver(
172172
Δ₀::AbstractFloat = one(eltype(S)),
173173
bad_steps_lim::Integer = 3,
174174
feas_expected_decrease::AbstractFloat = eltype(S)(0.95),
175-
TR_compute_step = LsmrSolver(length(y0), length(x0), S),
176-
aggressive_step = CgSolver(length(x0), length(x0), S),
175+
TR_compute_step = LsmrWorkspace(length(y0), length(x0), S),
176+
aggressive_step = CgWorkspace(length(x0), length(x0), S),
177177
) where {S}
178178
n, m = length(x0), length(y0)
179179
return GNSolver(

src/solve_linear_system.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function solve_two_extras(
5757

5858
JtJ = nlp.Aop * nlp.Aop' # this allocates
5959
# (invJtJSsv, stats) = minres(JtJ, rhs2, λ = τ)
60-
Krylov.solve!(
60+
krylov_solve!(
6161
nlp.qdsolver.solver_struct_pinv,
6262
JtJ,
6363
rhs2,
@@ -151,10 +151,10 @@ function solve_two_extras(
151151
else
152152
nlp.Aop = jac_op(nlp.nlp, x)
153153
end
154-
(invJtJJv, invJtJJvstats) = cgls(nlp.Aop', rhs1, λ = τ) # use Krylov.solve!
154+
(invJtJJv, invJtJJvstats) = cgls(nlp.Aop', rhs1, λ = τ) # use krylov_solve!
155155

156156
JtJ = nlp.Aop * nlp.Aop'
157-
(invJtJSsv, stats) = minres(JtJ, rhs2, λ = τ) # use Krylov.solve!
157+
(invJtJSsv, stats) = minres(JtJ, rhs2, λ = τ) # use krylov_solve!
158158
return invJtJJv, invJtJSsv
159159
end
160160

@@ -163,7 +163,7 @@ function solve_two_least_squares(
163163
x::AbstractVector,
164164
rhs1,
165165
rhs2,
166-
) where {T, S, Tt, A, P, S2, Si, Str}
166+
) where {T, S, A, P, S2, Si, Str}
167167
#set the memory for the matrix in the FletcherPenaltyNLP
168168
nvar = nlp.nlp.meta.nvar
169169
ncon = nlp.explicit_linear_constraints ? nlp.nlp.meta.nnln : nlp.nlp.meta.ncon

src/solve_two_systems_struct.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ It uses `Krylov.jl` methods to solve least-squares and least-norm problems.
2323
struct IterativeSolver{
2424
T <: AbstractFloat,
2525
S,
26-
SS1 <: KrylovSolver{T, T, S},
27-
SS2 <: KrylovSolver{T, T, S},
28-
SS3 <: KrylovSolver{T, T, S},
26+
SS1 <: KrylovWorkspace{T, T, S},
27+
SS2 <: KrylovWorkspace{T, T, S},
28+
SS3 <: KrylovWorkspace{T, T, S},
2929
It <: Integer,
3030
} <: QDSolver
3131
# parameters for least-square solve
@@ -72,15 +72,15 @@ struct IterativeSolver{
7272
q2::S # part 2: solution of 2nd LS
7373
end
7474

75-
# import Krylov.LsqrSolver
75+
# import Krylov.LsqrWorkspace
7676
#=
77-
mutable struct LsqrSolver2{T,S} <: KrylovSolver{T,S}
77+
mutable struct LsqrWorkspace2{T,S} <: KrylovWorkspace{T,S}
7878
x :: S
7979
Nv :: S
8080
w :: S
8181
Mu :: S
8282
83-
function LsqrSolver2(n, m, S, T)
83+
function LsqrWorkspace2(n, m, S, T)
8484
x = S(undef, m)
8585
Nv = S(undef, m)
8686
w = S(undef, m)
@@ -113,17 +113,17 @@ function IterativeSolver(
113113
ne_etol::T = eps(T),
114114
ne_itmax::Int = 0,
115115
ne_conlim::T = 1 / eps(T),
116-
solver_struct_least_square::KrylovSolver{T, T, S} = LsqrSolver(
116+
solver_struct_least_square::KrylovWorkspace{T, T, S} = LsqrWorkspace(
117117
nlp.meta.nvar,
118118
explicit_linear_constraints ? nlp.meta.nnln : nlp.meta.ncon,
119119
S,
120120
),
121-
solver_struct_least_norm::KrylovSolver{T, T, S} = CraigSolver( # LnlqSolver(
121+
solver_struct_least_norm::KrylovWorkspace{T, T, S} = CraigWorkspace( # LnlqSolver(
122122
explicit_linear_constraints ? nlp.meta.nnln : nlp.meta.ncon,
123123
nlp.meta.nvar,
124124
S,
125125
),
126-
solver_struct_pinv::KrylovSolver{T, T, S} = MinresSolver(
126+
solver_struct_pinv::KrylovWorkspace{T, T, S} = MinresWorkspace(
127127
explicit_linear_constraints ? nlp.meta.nnln : nlp.meta.ncon,
128128
explicit_linear_constraints ? nlp.meta.nnln : nlp.meta.ncon,
129129
S,
@@ -170,7 +170,7 @@ function solve_least_square(
170170
b,
171171
λ,
172172
) where {T, S, SS1, SS2, SS3, It}
173-
Krylov.solve!(
173+
krylov_solve!(
174174
qdsolver.solver_struct_least_square,
175175
A,
176176
b,
@@ -212,7 +212,7 @@ function solve_least_norm(
212212
A,
213213
b,
214214
δ,
215-
) where {T, S, SS1, SS2 <: CraigSolver, SS3, It}
215+
) where {T, S, SS1, SS2 <: CraigWorkspace, SS3, It}
216216
if δ != 0
217217
craig!(
218218
qdsolver.solver_struct_least_norm,
@@ -256,7 +256,7 @@ function solve_least_norm(
256256
) where {T, S, SS1, SS2, SS3, It}
257257
ncon = length(b)
258258
if δ != 0
259-
Krylov.solve!(
259+
krylov_solve!(
260260
qdsolver.solver_struct_least_norm,
261261
A,
262262
b,
@@ -266,7 +266,7 @@ function solve_least_norm(
266266
itmax = qdsolver.ln_itmax,
267267
)
268268
else
269-
Krylov.solve!(
269+
krylov_solve!(
270270
qdsolver.solver_struct_least_norm,
271271
A,
272272
b,

0 commit comments

Comments
 (0)