aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-03-11 11:53:59 +0100
committerThomas White <taw@physics.org>2019-03-11 16:49:37 +0100
commitc04d93ef0e6faf50ad243932da158239f83cc619 (patch)
tree1b2c758107e9ff6077fb0e76eefdf578ada3076a /libcrystfel
parentcb51ba0e53425ae663db313d730c1df644e4f76b (diff)
Get rid of cell_transform_gsl_reciprocal()
It's confusing to have matrices acting on both real and reciprocal vectors. Let's standardise instead on transformations always applying to real-space cells. It was only used in one place.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/cell.c43
-rw-r--r--libcrystfel/src/cell.h1
-rw-r--r--libcrystfel/src/taketwo.c2
3 files changed, 1 insertions, 45 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c
index 5e00ac9c..9ae77a6d 100644
--- a/libcrystfel/src/cell.c
+++ b/libcrystfel/src/cell.c
@@ -659,49 +659,6 @@ UnitCell *cell_transform_gsl_direct(UnitCell *in, gsl_matrix *m)
}
-UnitCell *cell_transform_gsl_reciprocal(UnitCell *in, gsl_matrix *m)
-{
- gsl_matrix *c;
- double asx, asy, asz;
- double bsx, bsy, bsz;
- double csx, csy, csz;
- gsl_matrix *res;
- UnitCell *out;
-
- cell_get_reciprocal(in, &asx, &asy, &asz, &bsx, &bsy,
- &bsz, &csx, &csy, &csz);
-
- c = gsl_matrix_alloc(3, 3);
- gsl_matrix_set(c, 0, 0, asx);
- gsl_matrix_set(c, 1, 0, asy);
- gsl_matrix_set(c, 2, 0, asz);
- gsl_matrix_set(c, 0, 1, bsx);
- gsl_matrix_set(c, 1, 1, bsy);
- gsl_matrix_set(c, 2, 1, bsz);
- gsl_matrix_set(c, 0, 2, csx);
- gsl_matrix_set(c, 1, 2, csy);
- gsl_matrix_set(c, 2, 2, csz);
-
- res = gsl_matrix_calloc(3, 3);
- gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, c, m, 0.0, res);
-
- out = cell_new_from_cell(in);
- cell_set_reciprocal(out, gsl_matrix_get(res, 0, 0),
- gsl_matrix_get(res, 1, 0),
- gsl_matrix_get(res, 2, 0),
- gsl_matrix_get(res, 0, 1),
- gsl_matrix_get(res, 1, 1),
- gsl_matrix_get(res, 2, 1),
- gsl_matrix_get(res, 0, 2),
- gsl_matrix_get(res, 1, 2),
- gsl_matrix_get(res, 2, 2));
-
- gsl_matrix_free(res);
- gsl_matrix_free(c);
- return out;
-}
-
-
static int centering_has_point(char cen, Rational *p)
{
/* First, put the point into the range 0..1 */
diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h
index 8e6809b5..c868cd29 100644
--- a/libcrystfel/src/cell.h
+++ b/libcrystfel/src/cell.h
@@ -149,7 +149,6 @@ extern void cell_set_unique_axis(UnitCell *cell, char unique_axis);
extern const char *cell_rep(UnitCell *cell);
extern UnitCell *cell_transform_gsl_direct(UnitCell *in, gsl_matrix *m);
-extern UnitCell *cell_transform_gsl_reciprocal(UnitCell *in, gsl_matrix *m);
extern UnitCell *cell_transform_rational(UnitCell *cell, RationalMatrix *m);
extern UnitCell *cell_transform_rational_inverse(UnitCell *cell, RationalMatrix *m);
diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c
index 37a29722..572ef793 100644
--- a/libcrystfel/src/taketwo.c
+++ b/libcrystfel/src/taketwo.c
@@ -2059,7 +2059,7 @@ static UnitCell *run_taketwo(UnitCell *cell, const struct taketwo_options *opts,
tp->numPrevs++;
/* Prepare the solution for CrystFEL friendliness */
- result = cell_transform_gsl_reciprocal(cell, solution);
+ result = cell_transform_gsl_direct(cell, solution);
cleanup_taketwo_cell(&ttCell);
return result;