在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jump-dev/KNITRO.jl开源软件地址:https://github.com/jump-dev/KNITRO.jl开源编程语言:Julia 100.0%开源软件介绍:KNITRO.jlKNITRO.jl underwent a major rewrite between versions 0.12.0 and 0.13.0, with the low-level wrapper now being generated automatically with Clang.jl. Users of JuMP should see no breaking changes, but if you used the lower-level C API you will need to update your code accordingly. The KNITRO.jl package provides an interface for using the Artelys Knitro solver from Julia. You cannot use KNITRO.jl without having purchased and installed a copy of Knitro from Artelys. This package is available free of charge and in no way replaces or alters any functionality of Artelys Knitro solver. Refer to Knitro documentation for a full specification of the Knitro's API. The Artelys Knitro wrapper for Julia is supported by the JuMP community (which originates the development of this package) and Artelys. Feel free to contact Artelys support if you encounter any problem with this interface or the solver. MathOptInterface (MOI)KNITRO.jl supports MathOptInterface and JuMP. Here's an example showcasing various features. using JuMP, KNITRO
m = Model(optimizer_with_attributes(KNITRO.Optimizer,
"honorbnds" => 1, "outlev" => 1, "algorithm" => 4)) # (1)
@variable(m, x, start = 1.2) # (2)
@variable(m, y)
@variable(m, z)
@variable(m, 4.0 <= u <= 4.0) # (3)
mysquare(x) = x^2
register(m, :mysquare, 1, mysquare, autodiff = true) # (4)
@NLobjective(m, Min, mysquare(1 - x) + 100 * (y - x^2)^2 + u)
@constraint(m, z == x + y)
optimize!(m)
(value(x), value(y), value(z), value(u), objective_value(m), termination_status(m)) # (5)
Low-level wrapperKNITRO.jl implements most of Knitro's functionalities.
If you aim at using part of Knitro's API that are not implemented
in the MathOptInterface/JuMP ecosystem, you can refer to the low
level API which wraps directly Knitro's C API (whose templates
are specified in the file Extensive examples using the C wrapper can be found in Ampl wrapperThe package AmplNLWriter.jl
allows to to call The usage is as follow: using JuMP, KNITRO, AmplNLWriter
model = Model(() -> AmplNLWriter.Optimizer(KNITRO.amplexe, ["outlev=3"]))
Installation TroubleshootingIf you are having issues installing, here are several things to try:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论