Skip to content

Commit

Permalink
Document parameters passed to sifdecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed Aug 3, 2023
1 parent 9003ad5 commit 26c0ccd
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ finalize(nlp)
Check the [NLPModels
API](https://JuliaSmoothOptimizers.github.io/NLPModels.jl/stable/api/) for details.

You can pass parameters to sifdecoder by giving additional arguments to `CUTEstModel`.
For instance, to change `NH` from model `CHAIN`, use

```@example
using CUTEst
for nh = 50:50:200
nlp = CUTEstModel("CHAIN", "-param", "NH=$nh")
println("nh = $nh, nnzh = $(nlp.meta.nnzh)")
finalize(nlp)
end
```

## Working with CUTEst directly

We also have implemented function to allow access to the CUTEst functions directly:
Expand Down
36 changes: 35 additions & 1 deletion src/CUTEst.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,41 @@ function sifdecoder(
nothing
end

# Initialize problem.
"""
nlp = CUTEstModel(name, args...; kwargs...)
Creates a CUTEst model following the NLPModels API.
This model needs to be finalized before a new one is created (e.g., calling `finalize(nlp)`).
## Optional arguments
Any extra arguments will be passed to `sifdecoder`.
You can, for instance, change parameters of the model:
```jldoctest
using CUTEst
nlp = CUTEstModel("CHAIN", "-param", "NH=50")
println(nlp.meta.nnzh)
finalize(nlp)
nlp = CUTEstModel("CHAIN", "-param", "NH=100")
println(nlp.meta.nnzh)
finalize(nlp)
# output
153
303
```
## Keyword arguments
- `decode::Bool = true`: Whether to call sifdecoder.
- `verbose::Bool = false`: Passed to sifdecoder.
- `efirst`::Bool = true`: Equalities first?
- `lfirst`::Bool = true`: Linear (or affine) constraints first?
- `lvfirst::Bool = true`: Nonlinear variables should appear first?
"""
function CUTEstModel(
name::AbstractString,
args...;
Expand Down

0 comments on commit 26c0ccd

Please sign in to comment.