diff options
author | Thomas White <taw@physics.org> | 2019-03-13 16:56:54 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-03-13 16:56:54 +0100 |
commit | a527e38ccc907a64420a2bd73245a0512c8baa87 (patch) | |
tree | 57637e9bb70fb4d6f67107b8acfff1aa2950b55c /libcrystfel | |
parent | c229a577b5c5578f1e83f8a6ee569bb5681524b9 (diff) |
cell_transform_rational: Complain if matrix is singular
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/cell.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c index 1e463bf7..ce9d37bb 100644 --- a/libcrystfel/src/cell.c +++ b/libcrystfel/src/cell.c @@ -876,9 +876,13 @@ UnitCell *cell_transform_rational(UnitCell *cell, RationalMatrix *m) gsl_matrix *tm; char ncen; int i, j; + Rational det; if ( m == NULL ) return NULL; + det = rtnl_mtx_det(m); + if ( rtnl_cmp(det, rtnl_zero()) == 0 ) return NULL; + tm = gsl_matrix_alloc(3,3); if ( tm == NULL ) { return NULL; |