18 #define ISZERO(d) ((d)==0.0)
24 int lbfgs_(
long int *,
long int *,
double *,
double *,
double *,
long int *,
25 double *,
long int *,
double *,
double *,
double *,
long int *,
long int *,
38 cerr <<
"illegal value for number of steps in limited memory"
39 " quasi-newton method -- set equal to 10" <<
endl;
65 cerr <<
"Usage -crit option needs number -- ignored" <<
endl;
73 cerr <<
"Usage -crit option needs positive number -- ignored" <<
endl;
103 double fbest=1.e+100;
120 cerr <<
"Usage -iprint option needs integer -- ignored" <<
endl;
152 if(fmod(
double(itn),
double(
iprint)) == 0)
162 ad_printf(
"\nIntermediate statistics: ");
166 "%d variables; iteration %ld; function evaluation %ld\n",
172 "Function value %12.4le; maximum gradient component mag %12.4le\n",
178 "Function value %12.4le; maximum gradient component mag %12.4le\n",
185 fmmdisp(x, g, nvar, 0,noprintx);
187 fmmdisp(xbest, gbest, nvar, 0,noprintx);
194 long int liprintx= *iprintx;
195 long int liflag=iflag;
197 lbfgs_(&lnvar, &lm, &(x[1]) , &f, &(g[1]), &diagco, &(diag[1]),
198 &liprintx, &
crit, &xtol, &(w[1]), &liflag,&litn,&linfo);
218 "%d variables; iteration %ld; function evaluation %ld\n",
221 "Function value %12.4le; maximum gradient component mag %12.4le\n",
223 fmmdisp(x, g, nvar, 0,noprintx);
232 int maxfn,
double crit)
237 cerr <<
"illegal value for number of steps in limited memory"
238 " quasi-newton method -- set equal to 10" <<
endl;
254 cerr <<
"Usage -crit option needs number -- ignored" <<
endl;
262 cerr <<
"Usage -crit option needs positive number -- ignored" <<
endl;
273 double fbest=1.e+100;
308 if(fmod(
double(itn),
double(
iprint)) == 0)
318 ad_printf(
"\nIntermediate statistics: ");
322 "%d variables; iteration %ld; function evaluation %ld\n",
328 "Function value %12.4le; maximum gradient component mag %12.4le\n",
334 "Function value %12.4le; maximum gradient component mag %12.4le\n",
340 fmmdisp(x, g, nvar, 0,noprintx);
342 fmmdisp(xbest, gbest, nvar, 0,noprintx);
348 long int liprintx= *iprintx;
349 long int liflag=iflag;
351 lbfgs_(&lnvar, &lm, &(x[1]) , &f, &(g[1]), &diagco, &(diag[1]),
352 &liprintx, &crit, &xtol, &(w[1]), &liflag,&litn,&linfo);
370 ad_printf(
"%d variables; iteration %ld; function evaluation %ld\n",
373 "Function value %12.4le; maximum gradient component mag %12.4le\n",
375 fmmdisp(x, g, nvar, 0,noprintx);
void fmmdisp(const dvector &x, const dvector &g, const int &nvar, int scroll_flag, int noprintx)
Description not yet available.
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Vector of double precision numbers.
int lbfgs_(integer *n, integer *m, doublereal *x, doublereal *f, doublereal *g, logical *diagco, doublereal *diag, integer *iprint, doublereal *eps, doublereal *xtol, doublereal *w, integer *iflag, integer *iter, integer *info)
df1_two_variable fabs(const df1_two_variable &x)
static dvariable reset(const dvar_vector &x)
void gradcalc(int nvar, const dvector &g)
int atoi(adstring &s)
Returns a integer converted from input s.
void limited_memory_quasi_newton(const independent_variables &, int)
prnstream & endl(prnstream &)
Description not yet available.
static dvector maximum_function_evaluations
int indexmax() const
Get maximum valid index.
static objective_function_value * pobjfun
Description not yet available.
void initialize(void)
Initialze all elements of dvector to zero.
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument ("string").
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
dvector value(const df1_one_vector &v)
virtual void userfunction(void)=0
static dvector convergence_criteria
Fundamental data type for reverse mode automatic differentiation.
int ad_printf(FILE *stream, const char *format, Args...args)