~cgeoga/StandaloneKNITRO.jl

Simple convenience bindings for using KNITRO
954584dd — Chris Geoga 5 months ago
Small tweaks with hvp options.
4cb05b77 — Chris Geoga 7 months ago
Add hvp options (when `hessopt 5` is in the param_file) with the two
794d5e61 — Chris Geoga 7 months ago
Oops, forgot to switch the AD backend choice to be configurable.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~cgeoga/StandaloneKNITRO.jl
read/write
git@git.sr.ht:~cgeoga/StandaloneKNITRO.jl

You can also use your local clone with git send-email.

#StandaloneKNITRO.jl

Docs to come. This is more or less a clone of StandaloneIpopt.jl that instead provides a knitro_optimize. Considering that KNITRO is very much not gratis or libre software and is much less commonly used than Ipopt, I don't see much of a reason to register this package. But I will add docs and work to feature parity with StandaloneIpopt.jl in the near future.

#What's available now

  • knitro_optimize. See the tests and example files for a demonstration.
  • knitro_nlsolve. See the test file for a demonstration.

#Very quick information

The main function here is knitro_optimize. This function has a signature that looks like this:

knitro_optimize(obj,
                ini,
                constraints=noconstraints();
                # starting kwargs:
                box_lower=-floatmax(),
                box_upper=floatmax(),
                param_file=nothing)

Where:

  • obj(x) is your objective function.
  • ini is your vector giving the initialization.
  • constraints is an objective of type Constraints. See the demo or test files for how to pass in your constraints, or the file ./src/constraints.jl for information on the actual struct information. For now, there is no option to provide your own constraint Jacobians. It's always just going to use ForwardDiff. At some point I'll put this option in though.
  • box_lower, if one number, is expanded to fill(box_lower, length(ini)), and is the lower bounds for each component of the argument. If it is a vector, that is just used directly.
  • box_upper is the same, but for the upper bounds.
  • param_file is a parameter file that KNITRO reads. Instead of trying to offer every option through kwargs in this package, I think it's easier to just make you write your own little text file and pass it in. Annoying, maybe, but not as annoying as emailing me because I didn't expose your favorite option as a kwarg.

The knitro_nlsolve function is much more bare-bones: you give your function fn(buf, x) and an initial guess, optionally the box_lower and box_upper args, and that's it. At some point I'll offer user-provided Jacobians.

#To-do items to port over

  • User-provided constraint Jacobians.