You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/contributing.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
# Contributing to OptimizationProblems.jl
2
-
3
2
First off, thanks for taking the time to contribute!
4
3
5
4
## Bug reports and discussions
@@ -19,12 +18,12 @@ Here is a to-do list, to help you add new problems:
19
18
-`src/ADNLPProblems/problem_name.jl`
20
19
-`src/PureJuMP/problem_name.jl`
21
20
-`src/Meta/problem_name.jl`
22
-
In both cases, the function must have the same name `problem_name` as the file.
21
+
In both cases, the function must have the same name `problem_name` as the file and the objective must be callable at the starting point and should not return NaN unless expected.
23
22
* When submitting a problem, please pay particular attention to the documentation. We would like to gather as much information as possible on the provenance of problems, other problem sets where the problems are present, and general information on the problem.
24
23
The documentation should be added to the file in the `PureJuMP` folder.
25
24
* New problems can be scalable, see [ADNLPProblems/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/ADNLPProblems/arglina.jl) and [PureJuMP/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/PureJuMP/arglina.jl) for examples. In that case, the first keyword parameter should be the number of variables `n::Int` and have the default value `default_nvar` (constant predefined in the module). If your problem has restrictions on the number of variables, e.g., `n` should be odd, or `n` should have the form `4k + 3`, then, instead of throwing errors when the restrictions are not satisfied, you should instead use the number of variables to be as close to `n` as possible. For example, if you want `n` odd and `n = 100` is passed, you can internally convert to `n = 99`. If you want `n = 4k + 3`, and `n = 100` is passed, then compute `k = round(Int, (n - 3) / 4)` and update `n`.
26
-
* A first version of the `meta` can be generated using `generate_meta`. A `String` is returned that can be copy-pasted into the `Meta` folder, and then edited.
27
-
25
+
* A first version of the `meta` can be generated using `generate_meta`. A `String` is returned that can be copy-pasted into the `Meta` folder, and then edited. Ensure all meta fields are accurate and complete including `nvar`, `ncon`, linear/nonlinear counts, feasibility, origin, objtype, contype and best-known bounds.
26
+
* For problem implementation in both ADNLP and PureJuMP, use the same initial point, variable bounds, constraint bounds and ensure objective and constraint values match within a relative tolerance.
28
27
```julia
29
28
using ADNLPModels, Distributed, NLPModels, NLPModelsJuMP, OptimizationProblems, Test
30
29
include("test/utils.jl")
@@ -33,7 +32,10 @@ The documentation should be added to the file in the `PureJuMP` folder.
* Problems modeled with `ADNLPModels` should be type-stable, i.e. they should all have keyword argument `type::Type{T} = Float64` where `T` is the type of the initial guess and the type used by the `NLPModel` API.
35
+
* Problems modeled with `ADNLPModels` should be type-stable, i.e. they should all have keyword argument `type::Type{T} = Float64` where `T` is the type of the initial guess and the type used by the `NLPModel` API
36
+
and should support the `nls=true/false` keyword to allow both `ADNLPModel` and `ADNLSModel` instantiation from the same problem.
37
+
* For least-squares problems, instantiate both `ADNLPModel` and `ADNLSModel` and ensure `residual!(nls, x, Fx)` is allocation-free with the objectives agree (or differ by a factor of 2 for LS).
38
+
* For variable-size problems, verify that different values of `n` produce correct `nvar`, meta formulas predict actual values and instantiation works at various sizes.
0 commit comments