-
Notifications
You must be signed in to change notification settings - Fork 5
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
SolverCore Revamp #6
base: main
Are you sure you want to change the base?
Conversation
test/dummy_solver.jl
Outdated
ct :: Vector | ||
end | ||
|
||
function DummySolver(nvar :: Integer, ncon :: Integer = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should take an NLPModelMeta
as input?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be too specific. This is the simplest one to allow creating a reusable solver with various problems of the same size, for instance. If you already have the meta
, you probably have the nlp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know but what I’m saying is that all the information in the meta
may be necessary to construct a solver, e.g., for constrained problems, taking into account the number of equality/inequality constraints, types of bounds, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed now to use meta
. Now both
DummySolver(nlp.meta)
and DummySolver(Val(:nosolve), nlp)
create the solver without solving.
test/dummy_solver.jl
Outdated
@@ -76,3 +123,16 @@ function dummy_solver( | |||
iter=iter | |||
) | |||
end | |||
|
|||
parameters(::DummySolver) = NamedTuple(α = 1e-2, δ = 1e-8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, the parameters structure also encapsulates the domain and type of each parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about that. The issue that remains is the interaction between parameters. Like 0 <= eta_1 <= eta_2 <= 1
. So I was thinking of returning the problem, but that constricts the non-scalar parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated with a lot more information on the parameters. It could possibly be made clearer with struct
s but I haven't found a need to change yet. The interaction issue above was not solved. I also implemented a grid search.
test/dummy_solver.jl
Outdated
end | ||
end | ||
end | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should return a real number, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's unfinished because I don't know what to do yet.
Codecov Report
@@ Coverage Diff @@
## master #6 +/- ##
==========================================
+ Coverage 91.20% 94.44% +3.23%
==========================================
Files 3 6 +3
Lines 91 72 -19
==========================================
- Hits 83 68 -15
+ Misses 8 4 -4
Continue to review full report at Codecov.
|
No description provided.