diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2008-01-12 18:41:58 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2008-01-12 18:41:58 +0000 |
commit | 2cf80ca8beaf98868c6c61400cd74636e925def1 (patch) | |
tree | 87b3ae58b41c27f6b566031394eff176f6a416b4 /src/utils.c | |
parent | cbc4ab593fb319d417a0305d63eb6c6cdbfa4d1f (diff) |
More IPR testing
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@250 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c index 457beb3..8fc3cf6 100644 --- a/src/utils.c +++ b/src/utils.c @@ -3,13 +3,14 @@ * * Utility stuff * - * (c) 2007 Thomas White <taw27@cam.ac.uk> + * (c) 2007-2008 Thomas White <taw27@cam.ac.uk> * * dtr - Diffraction Tomography Reconstruction * */ #include <math.h> +#include <gsl/gsl_matrix.h> #include "utils.h" #include "string.h" @@ -94,3 +95,19 @@ void chomp(char *s) { } } + +void matrix_vector_show(const gsl_matrix *m, const gsl_vector *v) { + + int i, j; + + for ( i=0; i<m->size1; i++ ) { + printf("[ "); + for ( j=0; j<m->size2; j++ ) { + printf("%12.8f ", gsl_matrix_get(m, i, j)); + } + printf(" ] [ q%i ] = [ %15.2f ]\n", i+1, gsl_vector_get(v, i)); + } + +} + + |