Hello,
I have some difficulties to use the function nlopt_add_equality_mconstraint.
I create a solver + some initialization (I use the COBYLA algorithm):
Method = nlopt_create((nlopt_algorithm)tmp_int, (unsigned int)size_x);
res_nlopt = nlopt_set_min_objective(Method, func_obj, NULL);
nlopt_set_lower_bounds(Method, pdbl_lower);
nlopt_set_upper_bounds(Method, pdbl_upper);
nlopt_set_maxeval(Method, maxiter);
and now, I add a function which evaluates all the constraints
(equality). My pointer func_ceq has the following prototype:
void sci_constr_eq(unsigned int size_constr, double * result, unsigned
int size_x, const double * x, double * gradient, void * param);
ceq_tol is a double * with the rigt size:
res_nlopt = nlopt_add_equality_mconstraint(Method, nb_eq, func_ceq,
NULL, ceq_tol);
res_nlopt == -2 -> INVALID PARAMETERS
What have I done wrong ?
YC
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss