/* * utils.c * * Utility stuff * * (c) 2007-2008 Thomas White * * dtr - Diffraction Tomography Reconstruction * */ #include #include #include #include "utils.h" /* 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 ( asize1; i++ ) { printf("%s[ ", prefix); for ( j=0; jsize2; j++ ) { printf("%12.8f ", gsl_matrix_get(m, i, j)); } printf(" ] [ q%i ] = [ %15.2f ]\n", i+1, gsl_vector_get(v, i)); } } int sign(double a) { if ( a < 0 ) return -1; if ( a > 0 ) return +1; return 0; }