diff options
author | Thomas White <taw@physics.org> | 2012-10-15 18:51:50 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-10-15 18:51:50 +0200 |
commit | 79ac9f672d9f01ebce0248102f15cf4d669392b3 (patch) | |
tree | 6e34f5f0638924a7ce6b8104fe03813b474f5ba9 /libcrystfel/src | |
parent | 4548f166eeb7d29f28793b39ede58cafaa2b64f8 (diff) |
Add add_op_intmat()
Diffstat (limited to 'libcrystfel/src')
-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 */ |