Compat for KNITRO.jl v0.14. Painless!
Tweak source and README to reflect at least temporary removal of custom
Remove closures and clean up code, bump version.
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.
knitro_optimize
. See the tests and example files for a demonstration.knitro_nlsolve
. See the test file for a demonstration.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.