static void cost(double *energy, double tweight, double tcost);
#define COST(weight, compute) cost(&energy, (weight), (compute))
/*---------- main energy computation and subroutines ----------*/
static void cost(double *energy, double tweight, double tcost);
#define COST(weight, compute) cost(&energy, (weight), (compute))
/*---------- main energy computation and subroutines ----------*/