diff options
author | Thomas White <taw@physics.org> | 2019-03-13 15:41:05 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-03-13 15:41:05 +0100 |
commit | bc84a4f8659244e11fddcb509664a2121bc40279 (patch) | |
tree | 6eeb71c185d0efcdd244853bad1cef91621df6e2 /libcrystfel | |
parent | 15e772078538ea071b873526d2ed64f965731bcb (diff) |
Rename rtnl_mtx_solve and rtnl_mtx_mult to make their purpose clearer
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/cell.c | 4 | ||||
-rw-r--r-- | libcrystfel/src/rational.c | 8 | ||||
-rw-r--r-- | libcrystfel/src/rational.h | 10 |
3 files changed, 13 insertions, 9 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c index 9ae77a6d..63b84fc3 100644 --- a/libcrystfel/src/cell.c +++ b/libcrystfel/src/cell.c @@ -736,7 +736,7 @@ static void check_point_fwd(RationalMatrix *m, CenteringMask *cmask, Rational nc[3]; /* Transform the lattice point */ - rtnl_mtx_solve(m, c, nc); + transform_fractional_coords_rtnl(m, c, nc); /* Eliminate any centerings which don't include the transformed point */ maybe_eliminate(CMASK_P, cmask, nc, 'P'); @@ -759,7 +759,7 @@ static void check_point_bwd(RationalMatrix *m, CenteringMask *mask, Rational nc[3]; Rational c[3] = {x, y, z}; - rtnl_mtx_mult(m, c, nc); + transform_fractional_coords_rtnl_inverse(m, c, nc); if ( !centering_has_point(cen, nc) ) { *mask |= exclude; diff --git a/libcrystfel/src/rational.c b/libcrystfel/src/rational.c index ab1eff91..c1512b8d 100644 --- a/libcrystfel/src/rational.c +++ b/libcrystfel/src/rational.c @@ -424,7 +424,8 @@ void rtnl_mtx_free(RationalMatrix *mtx) * * Returns: non-zero on error **/ -int rtnl_mtx_solve(const RationalMatrix *m, const Rational *ivec, Rational *ans) +int transform_fractional_coords_rtnl(const RationalMatrix *m, + const Rational *ivec, Rational *ans) { RationalMatrix *cm; Rational *vec; @@ -571,8 +572,9 @@ void rtnl_mtx_mtxmult(const RationalMatrix *A, const RationalMatrix *B, } -/* Calculate ans = m.vec, where 'ans' and 'vec' are column vectors */ -void rtnl_mtx_mult(const RationalMatrix *m, const Rational *vec, Rational *ans) +void transform_fractional_coords_rtnl_inverse(const RationalMatrix *m, + const Rational *vec, + Rational *ans) { int i, j; diff --git a/libcrystfel/src/rational.h b/libcrystfel/src/rational.h index 9ed20bfd..23c918cf 100644 --- a/libcrystfel/src/rational.h +++ b/libcrystfel/src/rational.h @@ -91,10 +91,12 @@ extern IntegerMatrix *intmat_from_rtnl_mtx(const RationalMatrix *m); extern void rtnl_mtx_free(RationalMatrix *mtx); extern void rtnl_mtx_mtxmult(const RationalMatrix *A, const RationalMatrix *B, RationalMatrix *ans); -extern void rtnl_mtx_mult(const RationalMatrix *m, const Rational *vec, - Rational *ans); -extern int rtnl_mtx_solve(const RationalMatrix *m, const Rational *vec, - Rational *ans); +extern int transform_fractional_coords_rtnl(const RationalMatrix *P, + const Rational *ivec, + Rational *ans); +extern void transform_fractional_coords_rtnl_inverse(const RationalMatrix *P, + const Rational *vec, + Rational *ans); extern void rtnl_mtx_print(const RationalMatrix *m); extern Rational rtnl_mtx_det(const RationalMatrix *m); |