Loading algorithm packages with @load

Nonconvex provides the @load macro to install and load the algorithm packages of the ecosystem on demand. The macro takes no keyword arguments; it accepts one or more algorithm name symbols:

using Nonconvex
Nonconvex.@load Ipopt

f(x) = (x[1] - 1.0)^2 + 100.0 * (x[2] - x[1]^2)^2
model = Model(f)
result = optimize(model, IpoptAlg(), [-1.0, 1.0])

Several packages can be loaded at once:

Nonconvex.@load Ipopt NLopt Metaheuristics

For each name, the package that implements the corresponding algorithm is loaded with using if it is already installed, and installed with Pkg.add automatically if it is not. The macro must be called with the Nonconvex. qualifier (or imported first with using Nonconvex: @load).

Accepted names

NamesPackage
MMA, GCMMA, MMA87, MMA02NonconvexMMA.jl
Ipopt, IpoptAlgNonconvexIpopt.jl
NLopt, NLoptAlgNonconvexNLopt.jl
Juniper, JuniperIpopt, JuniperIpoptAlgNonconvexJuniper.jl
Pavito, PavitoIpoptCbc, PavitoIpoptCbcAlgNonconvexPavito.jl
Percival, AugLag, PercivalAlgNonconvexPercival.jl
AugLag2NonconvexAugLagLab.jl
Bayesian, BayesOpt, BayesOptAlgNonconvexBayesian.jl
SDP, Semidefinite, SDPBarrier, SDPBarrierAlgNonconvexSemidefinite.jl
Search, MTS, LS1, RCD, MTSAlg, LS1Alg, RCDAlgNonconvexSearch.jl
Hyperopt, Deflated, Multistart, HyperoptAlg, DeflatedAlgNonconvexMultistart.jl
TOBSNonconvexTOBS.jl
MetaheuristicsNonconvexMetaheuristics.jl
NOMADNonconvexNOMAD.jl

Any other name raises an error listing the unsupported algorithm. Each of the loaded packages exports its algorithm type (for example IpoptAlg, NLoptAlg, MMA87 and MetaheuristicsECA); see the Algorithms section for the documentation of each algorithm package.