diff options
-rw-r--r-- | src/hrs-scaling.c | 13 | ||||
-rw-r--r-- | src/post-refinement.c | 14 | ||||
-rw-r--r-- | src/utils.c | 16 | ||||
-rw-r--r-- | src/utils.h | 3 |
4 files changed, 20 insertions, 26 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c index c0308483..0b0b700a 100644 --- a/src/hrs-scaling.c +++ b/src/hrs-scaling.c @@ -27,23 +27,12 @@ #include "symmetry.h" #include "geometry.h" #include "cell.h" +#include "utils.h" /* Maximum number of iterations of NLSq scaling per macrocycle. */ #define MAX_CYCLES (30) -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)); - } -} static double s_uha(signed int hat, signed int kat, signed int lat, struct image *images, int n, const char *sym, int a) diff --git a/src/post-refinement.c b/src/post-refinement.c index da7c86b6..b860bb42 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -266,20 +266,6 @@ 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) diff --git a/src/utils.c b/src/utils.c index 5efbdece..1d023783 100644 --- a/src/utils.c +++ b/src/utils.c @@ -16,11 +16,27 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> +#include <gsl/gsl_matrix.h> +#include <gsl/gsl_vector.h> #include "utils.h" #include "image.h" +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)); + } +} + + size_t notrail(char *s) { size_t i; diff --git a/src/utils.h b/src/utils.h index e7223f88..ff8a613b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -21,6 +21,8 @@ #include <string.h> #include <stdlib.h> #include <pthread.h> +#include <gsl/gsl_matrix.h> +#include <gsl/gsl_vector.h> #include "thread-pool.h" @@ -69,6 +71,7 @@ extern struct rvec quat_rot(struct rvec q, struct quaternion z); /* --------------------------- Useful functions ----------------------------- */ +extern void show_matrix_eqn(gsl_matrix *M, gsl_vector *v, int r); extern size_t notrail(char *s); extern void chomp(char *s); |