From 42e1753bcfd692d5aaf6d7551c6e4635f65c683f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 6 Sep 2012 10:38:12 +0200 Subject: WIP --- libcrystfel/src/cell-utils.c | 20 -------------------- libcrystfel/src/cell.c | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 21 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index b5d8f017..f0c6328f 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -263,26 +263,6 @@ int bravais_lattice(UnitCell *cell) } -static UnitCellTransformation *tfn_identity() -{ -} - - -static void *tfn_combine(UnitCellTransformation *t, - double *na, double *nb, double *nc) -{ -} - - -static double *v(double a, double b, double c) -{ - double *vec = malloc(3*sizeof(double)); - if ( vec == NULL ) return NULL; - vec[0] = a; vec[1] = b; vec[2] = c; - return vec; -} - - static UnitCellTransformation *uncentering_transformation(UnitCell *in) { UnitCellTransformation *t; diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c index e2617dfc..53b0436d 100644 --- a/libcrystfel/src/cell.c +++ b/libcrystfel/src/cell.c @@ -634,7 +634,7 @@ UnitCell *cell_transform(UnitCell *cell, UnitCellTransformation *t) /** - * cell_transform: + * cell_transform_inverse: * @cell: A %UnitCell. * @t: A %UnitCellTransformation. * @@ -649,6 +649,44 @@ UnitCell *cell_transform_inverse(UnitCell *cell, UnitCellTransformation *t) } +/** + * tfn_identity: + * + * Returns: A %UnitCellTransformation corresponding to an identity operation. + * + */ +static UnitCellTransformation *tfn_identity() +{ +} + + +/** + * tfn_combine: + * @t: A %UnitCellTransformation + * @na: Pointer to three doubles representing naa, nab, nac + * @nb: Pointer to three doubles representing nba, nbb, nbc + * @nc: Pointer to three doubles representing nca, ncb, ncc + * + * Updates @t such that it represents its previous transformation followed by + * a new transformation, corresponding to letting a = naa*a + nab*b + nac*c. + * Likewise, a = nba*a + nbb*b + nbc*c and c = nca*a + ncb*b + ncc*c. + * + */ +static void tfn_combine(UnitCellTransformation *t, + double *na, double *nb, double *nc) +{ +} + + +static double *v(double a, double b, double c) +{ + double *vec = malloc(3*sizeof(double)); + if ( vec == NULL ) return NULL; + vec[0] = a; vec[1] = b; vec[2] = c; + return vec; +} + + void cell_transformation_print(UnitCellTransformation *t) { -- cgit v1.2.3