/* * utils.c * * Utility stuff * * (c) 2007 Thomas White * dtr - Diffraction Tomography Reconstruction * */ #include #include /* Return the MOST POSITIVE of two numbers */ unsigned int biggest(signed int a, signed int b) { if ( a>b ) { return a; } return b; } /* Return the LEAST POSITIVE of two numbers */ unsigned int smallest(signed int a, signed int b) { if ( a1 * Re-written to use gsl_matrix native functions */ void matrix_renormalise(gsl_matrix *m) { double max,min; gsl_matrix_minmax(m,&min,&max); gsl_matrix_add_constant(m,0.-min); gsl_matrix_scale(m,1./(max-min)); }