-/* Copyright (c) 2007-2010 Massachusetts Institute of Technology
+/* Copyright (c) 2007-2014 Massachusetts Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
} subspace_data;
/* wrapper around objective function for subspace optimization */
-static double subspace_func(int ns, const double *xs, double *grad, void *data)
+static double subspace_func(unsigned ns, const double *xs, double *grad, void *data)
{
subspace_data *d = (subspace_data *) data;
int i, is = d->is;
double *x = d->x;
(void) grad; /* should always be NULL here */
- for (i = is; i < is + ns; ++i) x[p[i]] = xs[i-is];
+ for (i = is; i < is + ((int) ns); ++i) x[p[i]] = xs[i-is];
return d->f(d->n, x, NULL, d->f_data);
}
*minf = f(n, x, NULL, f_data);
stop->nevals++;
- if (nlopt_stop_forced(stop)) return NLOPT_FORCE_STOP;
+ if (nlopt_stop_forced(stop)) return NLOPT_FORCED_STOP;
if (*minf < stop->minf_max) return NLOPT_MINF_MAX_REACHED;
if (nlopt_stop_evals(stop)) return NLOPT_MAXEVAL_REACHED;
if (nlopt_stop_time(stop)) return NLOPT_MAXTIME_REACHED;