# Nonconvex.jl

Nonconvex is a is a Julia package implementing and wrapping nonconvex constrained optimization algorithms.

## Installation: OptimizationNonconvex.jl

To use this package, install the OptimizationNonconvex package:

import Pkg; Pkg.add("OptimizationNonconvex")

## Global Optimizer

### Without Constraint Equations

A Nonconvex algorithm is called using one of the following:

When performing optimizing a combination of integer and floating-point parameters the integer keyword has to be set. It takes a boolean vector indicating which parameter is an integer.

Some optimizer may require further options to be defined in order to work.

The currently available algorithms are listed here

The algorithms in Nonconvex are performing global optimization on problems without constraint equations. However, lower and upper constraints set by lb and ub in the OptimizationProblem are required.

## Examples

The Rosenbrock function can optimized using the Method of moving asymptotes algorithm MMA02() as follows:

rosenbrock(x, p) =  (p - x)^2 + p * (x - x^2)^2
x0 = zeros(2)
p  = [1.0, 100.0]
f = OptimizationFunction(rosenbrock)
prob = Optimization.OptimizationProblem(f, x0, p, lb = [-1.0,-1.0], ub = [1.0,1.0])
sol = solve(prob, MMA02(), maxiters=100000, maxtime=1000.0)

The options of for a sub-algorithm are passed simply as a NamedTuple and GalactcOptim infers the correct Nonconvex options struct:

rosenbrock(x, p) =  (p - x)^2 + p * (x - x^2)^2
x0 = zeros(2)
p  = [1.0, 100.0]
f = OptimizationFunction(rosenbrock)
prob = Optimization.OptimizationProblem(f, x0, p, lb = [-1.0,-1.0], ub = [1.0,1.0])
sol = solve(prob, HyperoptAlg(IpoptAlg()), sub_options=(;max_iter=100))

### With Constraint Equations

While Nonconvex.jl supports such constraints, Optimization.jl currently does not relay these constraints.