diff options
author | Thomas White <taw@physics.org> | 2019-08-15 16:35:27 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-08-16 10:26:59 +0200 |
commit | 14b58086754586c4cf431ee0b54cb4adc7cc4cfd (patch) | |
tree | 077da888eecc0a75fcb9d7d704f5ece5c126a2ea | |
parent | 0ee4e84678765760059dd1708439404709e70296 (diff) |
Add intmat_zero
-rw-r--r-- | libcrystfel/src/integer_matrix.c | 6 | ||||
-rw-r--r-- | libcrystfel/src/integer_matrix.h | 2 |
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); |