aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-08-15 16:35:27 +0200
committerThomas White <taw@physics.org>2019-08-16 10:26:59 +0200
commit14b58086754586c4cf431ee0b54cb4adc7cc4cfd (patch)
tree077da888eecc0a75fcb9d7d704f5ece5c126a2ea /libcrystfel/src
parent0ee4e84678765760059dd1708439404709e70296 (diff)
Add intmat_zero
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/integer_matrix.c6
-rw-r--r--libcrystfel/src/integer_matrix.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/libcrystfel/src/integer_matrix.c b/libcrystfel/src/integer_matrix.c
index 9431d189..c633a620 100644
--- a/libcrystfel/src/integer_matrix.c
+++ b/libcrystfel/src/integer_matrix.c
@@ -247,6 +247,12 @@ IntegerMatrix *intmat_intmat_mult(const IntegerMatrix *a,
}
+void intmat_zero(IntegerMatrix *m)
+{
+ memset(m->v, 0, m->rows*m->cols*sizeof(signed int));
+}
+
+
static IntegerMatrix *delete_row_and_column(const IntegerMatrix *m,
unsigned int di, unsigned int dj)
{
diff --git a/libcrystfel/src/integer_matrix.h b/libcrystfel/src/integer_matrix.h
index dcbe63bc..5a365f0a 100644
--- a/libcrystfel/src/integer_matrix.h
+++ b/libcrystfel/src/integer_matrix.h
@@ -64,6 +64,8 @@ extern void intmat_set(IntegerMatrix *m, unsigned int i, unsigned int j,
extern signed int intmat_get(const IntegerMatrix *m,
unsigned int i, unsigned int j);
+extern void intmat_zero(IntegerMatrix *m);
+
extern IntegerMatrix *intmat_create_3x3(signed int m11, signed int m12, signed int m13,
signed int m21, signed int m22, signed int m23,
signed int m31, signed int m32, signed int m33);