/*************************************************/ /* Template program to use ASA: */ /* Revise MY_TEMPLATE in "asa_user.h" to change */ /* ASA options. */ /* Li Ju. June.23,1997 */ /*************************************************/ #include int number_params; int main () { extern void asa_seed (int); extern void asa_main (double *, int *, double *, double *, double *, double *, int *); double main_cost_value, anneal_rate=500.0; double main_cost_parameters[5] = {0, 0, 0, 0, 1.3}; double lower_bound[5] = {-10, -10, -10, -10, -20}; double higher_bound[5] = {10, 10, 10, 10, 20}; int main_exit_code; int n_param; /* Note this assumes the *parameter_dimension = 5 */ number_params = 5; asa_seed (696969); /* This is the default random seed. */ asa_main (&main_cost_value, &number_params, lower_bound, higher_bound, main_cost_parameters, &anneal_rate, &main_exit_code); printf ("main_exit_code = %d\n", main_exit_code); printf ("main_cost_value = %12.7g\n", main_cost_value); printf ("parameter\tvalue\n"); for (n_param = 0; n_param < number_params; ++n_param) { printf ("%ld\t\t%12.7g\n", n_param, main_cost_parameters[n_param]); } exit (0); } #ifdef _AIX /* AIX f77 compiler don't have _ before names */ double fe (double *guess) #elif _OSF1 double _fe (double *guess) #else double fe_ (double *guess) #endif { double total = 0.; int i; for (i=0; i