Opt.addInequalityMConstraint

Add multiple inequality constraints

Equivalent in C API: nlopt_add_inequality_mconstraint

Params:

m = number of constraints

fc = function pointer representing constraints, must be extern(C)

fc_data = additional data to pass to function (optional)

tol = tolerance for constraints (default set to value of
      defaultTol.inequality)
  1. void addInequalityMConstraint(uint m, T fc, U fc_data, V tol)
  2. void addInequalityMConstraint(uint m, T fc, U fc_data)
  3. void addInequalityMConstraint(uint m, T fc)
    struct Opt
    void
    addInequalityMConstraint
    (
    T
    )
    (
    uint m
    ,
    T fc
    )

Examples

auto opt = Opt(Algorithm.lnCOBYLA, 2);

uint m = 2;
my_constraint_data[2] data = [ {2,0}, {-1,1} ];
double[] ctol = [1e-6, 1e-6];

opt.addInequalityMConstraint(m, &myConstraintMC, data, ctol);

assert(opt.getResult() > 0);

Meta