-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update an NLPModelMeta #469
Comments
Unfortunately, I don't think there is a very clean solution here. We could add a new constructor for NLPModelMeta that simplifies this task though. Something like
|
That's what I was thinking but I wondered, if |
What do you mean by it would be "wrong"? |
Hello, I am trying to work on Quasi-Newton approximations of NLPModels.$\mathcal{H}_f \approx \sigma I$ . For this, I want to update the NLPModelMeta so that
Given some
nlp::NLPModel
, I would like to construct aSpectralGradientModel(nlp)
i.e an NLPModel where I approximate the hessiannlp.meta.nnzh = nlp.meta.nvar
, so I want to create a copy of nlp.meta but with just one field modified. Since NLPModelMeta is an immutable struct, I can't just setnlp.meta.nnzh = nlp.meta.nvar
. Since there are quite a lot of keyword arguments and since only one field is modified, I don't want to write each timeAlso, I tried using Setfields.jl but this does not seem to work.
I am quite new to Julia so I was wondering if you had an idea on how to do this.
The text was updated successfully, but these errors were encountered: