aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c19
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));
+ }
+
+}
+
+