/* toptmiz.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Test: optmiz A new function can be specified by setting the system dimension ND and coding a new 'double func(x)' to evaluate the criteria function, with x the parameter vector. */ #include "ccmath.h" #define ND 2 char nm[]="Rosenbrock"; void main(void) { double x[ND],de,test; double func(double *x); int i,n=ND,max=60; test=1.e-12; de=1.e-9; printf(" Test of Optimizer (%s function)\n",nm); printf(" max iterations = %d\n",max); printf(" convergence threshold= %8.2e\n",test); printf(" derivative interval= %8.2e\n",de); fprintf(stderr," input initial vector (%d components)\n",n); for(i=0; i