aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-11-24 12:08:15 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:07 +0100
commit372072c004f8c4ea1859c71c7eb17ecf3dd9ccb8 (patch)
treed1a3122b663a2a13ed93581542dcf84b1d5f1088 /src/post-refinement.c
parentb0d8a9b7203a92997f2847d15b54a3850b360d05 (diff)
Display the matrix before solving
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index bc1caa4c..f1c59bff 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -268,6 +268,20 @@ double mean_partial_dev(struct image *image, struct cpeak *spots, int n,
}
+static void show_matrix_eqn(gsl_matrix *M, gsl_vector *v, int r)
+{
+ int i, j;
+
+ for ( i=0; i<r; i++ ) {
+ STATUS("[ ");
+ for ( j=0; j<r; j++ ) {
+ STATUS("%+9.3e ", gsl_matrix_get(M, i, j));
+ }
+ STATUS("][ a%2i ] = [ %+9.3e ]\n", i, gsl_vector_get(v, i));
+ }
+}
+
+
/* Perform one cycle of post refinement on 'image' against 'i_full' */
double pr_iterate(struct image *image, double *i_full, const char *sym,
struct cpeak **pspots, int *n)
@@ -341,6 +355,7 @@ double pr_iterate(struct image *image, double *i_full, const char *sym,
}
}
+ show_matrix_eqn(M, v, NUM_PARAMS);
shifts = gsl_vector_alloc(NUM_PARAMS);
gsl_linalg_HH_solve(M, v, shifts);