libprima / prima

PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration, P for Powell.
http://libprima.net
BSD 3-Clause "New" or "Revised" License
292 stars 36 forks source link

Add prima_options struct #101

Closed jschueller closed 9 months ago

jschueller commented 9 months ago

Move options to prima_options struct, that gets initialized to default values so we only need to set those different than defaults, we can see the actual c call takes much fewer args:

  prima_options options;
  prima_init_options(&options);
  options.iprint = PRIMA_MSG_EXIT;
  options.rhoend= 1e-3;
  options.maxfun = 200*n;
  int nf = 0;
  const int rc = prima_uobyqa(&fun, n, x, &f, &nf, &options);