Hello all,
I am just a loss how to give/take parameters with arbitrary-precision
arithmetic instead of "double" type on the C++ interface.

For example, the following is not able to compile now, although I need
arbitrary precision. Please support mpfr/mpreal or gmp++ setting on
C++ version of nlopt.

mpreal myfitting(const vector<mpreal> &param, vector<mpreal> &grad,
void *in);

main(){
   vector<mpreal> llimit(10, 0.0), ulimit(10, 1.0);
   nlopt::opt opt(nlopt::LN_BOBYQA, 10);
   if(llimit){opt.set_lower_bounds(llimit);}
   if(ulimit){opt.set_upper_bounds(ulimit);}
   opt.set_min_objective(myfitting, static_cast<void *>(myclass));
   opt.set_xtol_rel(pricision);
   opt.set_maxeval(10000000);
   vector<mlreal> out(10);
   mpreal minf;
   nlopt::result result = opt.optimize(out, minf);
}

--
M. Shiro

_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to