diff options
-rw-r--r-- | libcrystfel/src/symmetry.c | 19 | ||||
-rw-r--r-- | libcrystfel/src/symmetry.h | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/libcrystfel/src/symmetry.c b/libcrystfel/src/symmetry.c index 5ea22e98..bff64b57 100644 --- a/libcrystfel/src/symmetry.c +++ b/libcrystfel/src/symmetry.c @@ -1701,3 +1701,22 @@ const char *symmetry_name(const SymOpList *ops) { return ops->name; } + + +/** + * add_op_intmat: + * @s: A %SymOpList + * @m: An %IntegerMatrix + * + * Adds @m to the @s. Operations are NOT cross-multiplied, i.e. the result + * might not be a point group. + */ + +void add_op_intmat(SymOpList *s, const IntegerMatrix *m) +{ + add_symop(s, + v(intmat_get(m, 0, 0), intmat_get(m, 0, 1), 0, intmat_get(m, 0, 2)), + v(intmat_get(m, 1, 0), intmat_get(m, 1, 1), 0, intmat_get(m, 1, 2)), + v(intmat_get(m, 2, 0), intmat_get(m, 2, 1), 0, intmat_get(m, 2, 2)), + 1); +} diff --git a/libcrystfel/src/symmetry.h b/libcrystfel/src/symmetry.h index b600bbc0..ad077603 100644 --- a/libcrystfel/src/symmetry.h +++ b/libcrystfel/src/symmetry.h @@ -33,6 +33,9 @@ #include <config.h> #endif + +#include "integer_matrix.h" + /** * SymOpList * @@ -76,4 +79,6 @@ extern int is_centrosymmetric(const SymOpList *s); extern const char *symmetry_name(const SymOpList *ops); extern void describe_symmetry(const SymOpList *s); +extern void add_op_intmat(SymOpList *s, const IntegerMatrix *m); + #endif /* SYMMETRY_H */ |