aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/utils.c20
-rw-r--r--libcrystfel/src/utils.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/libcrystfel/src/utils.c b/libcrystfel/src/utils.c
index 7f8882a2..697c773f 100644
--- a/libcrystfel/src/utils.c
+++ b/libcrystfel/src/utils.c
@@ -77,6 +77,26 @@ void show_matrix_eqn(gsl_matrix *M, gsl_vector *v, int r)
}
+/**
+ * show_matrix:
+ * @M: A matrix
+ *
+ * Displays a matrix.
+ **/
+void show_matrix(gsl_matrix *M)
+{
+ int i, j;
+
+ for ( i=0; i<M->size1; i++ ) {
+ STATUS("[ ");
+ for ( j=0; j<M->size2; j++ ) {
+ STATUS("%+9.3e ", gsl_matrix_get(M, i, j));
+ }
+ STATUS("]\n");
+ }
+}
+
+
size_t notrail(char *s)
{
size_t i;
diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h
index 1adb69e6..a206ccfd 100644
--- a/libcrystfel/src/utils.h
+++ b/libcrystfel/src/utils.h
@@ -97,6 +97,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 void show_matrix(gsl_matrix *M);
extern size_t notrail(char *s);
extern void chomp(char *s);