Skip to content
Merged
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions src/quasi-newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mutable struct LBFGSModel{
meta::Meta
model::M
op::Op
v::S # extra vector to compute and store yₖ = ∇fₖ₊₁ - ∇fₖ
end

mutable struct LSR1Model{
Expand All @@ -31,6 +32,7 @@ mutable struct LSR1Model{
meta::Meta
model::M
op::Op
v::S # extra vector to compute and store yₖ = ∇fₖ₊₁ - ∇fₖ
end

mutable struct DiagonalQNModel{
Expand All @@ -48,13 +50,15 @@ end
"Construct a `LBFGSModel` from another type of model."
function LBFGSModel(nlp::AbstractNLPModel{T, S}; kwargs...) where {T, S}
op = LBFGSOperator(T, nlp.meta.nvar; kwargs...)
return LBFGSModel{T, S, typeof(nlp), typeof(nlp.meta), typeof(op)}(nlp.meta, nlp, op)
v = similar(nlp.meta.x0)
return LBFGSModel{T, S, typeof(nlp), typeof(nlp.meta), typeof(op)}(nlp.meta, nlp, op, v)
end

"Construct a `LSR1Model` from another type of nlp."
function LSR1Model(nlp::AbstractNLPModel{T, S}; kwargs...) where {T, S}
op = LSR1Operator(T, nlp.meta.nvar; kwargs...)
return LSR1Model{T, S, typeof(nlp), typeof(nlp.meta), typeof(op)}(nlp.meta, nlp, op)
v = similar(nlp.meta.x0)
return LSR1Model{T, S, typeof(nlp), typeof(nlp.meta), typeof(op)}(nlp.meta, nlp, op, v)
end

"""
Expand Down
Loading