From 4337cafe052c4ad238c969dfa4cb7c7ac52f5e07 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 25 Oct 2018 16:48:36 +0200 Subject: Use IntegerMatrix for all unit cell transformations Get rid of UnitCellTransformation, a thin wrapper which didn't do anything. --- libcrystfel/src/cell.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'libcrystfel/src/cell.h') diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h index 39e6a1ed..e6ccbdf7 100644 --- a/libcrystfel/src/cell.h +++ b/libcrystfel/src/cell.h @@ -91,14 +91,6 @@ typedef enum typedef struct _unitcell UnitCell; -/** - * UnitCellTransformation: - * - * This opaque data structure represents a tranformation of a unit cell, such - * as a rotation or a centering operation. - **/ -typedef struct _unitcelltransformation UnitCellTransformation; - #ifdef __cplusplus extern "C" { #endif @@ -156,18 +148,10 @@ extern void cell_set_unique_axis(UnitCell *cell, char unique_axis); extern const char *cell_rep(UnitCell *cell); -extern UnitCell *cell_transform(UnitCell *cell, UnitCellTransformation *t); -extern UnitCell *cell_transform_inverse(UnitCell *cell, - UnitCellTransformation *t); - -extern UnitCellTransformation *tfn_identity(void); -extern UnitCellTransformation *tfn_from_intmat(IntegerMatrix *m); -extern void tfn_combine(UnitCellTransformation *t, - double *na, double *nb, double *nc); -extern void tfn_print(UnitCellTransformation *t); -extern UnitCellTransformation *tfn_inverse(UnitCellTransformation *t); -extern double *tfn_vector(double a, double b, double c); -extern void tfn_free(UnitCellTransformation *t); +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(UnitCell *cell, IntegerMatrix *m); +extern UnitCell *cell_transform_inverse(UnitCell *cell, IntegerMatrix *m); #ifdef __cplusplus } -- cgit v1.2.3 From 169e7c5677ffc9c296c0a7eeddb0b77e024a4a55 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 18 Feb 2019 16:04:28 +0100 Subject: Be clear about whether functions need rational or integer transformations --- libcrystfel/src/cell.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libcrystfel/src/cell.h') diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h index e6ccbdf7..8e6809b5 100644 --- a/libcrystfel/src/cell.h +++ b/libcrystfel/src/cell.h @@ -150,8 +150,12 @@ 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(UnitCell *cell, IntegerMatrix *m); -extern UnitCell *cell_transform_inverse(UnitCell *cell, IntegerMatrix *m); + +extern UnitCell *cell_transform_rational(UnitCell *cell, RationalMatrix *m); +extern UnitCell *cell_transform_rational_inverse(UnitCell *cell, RationalMatrix *m); + +extern UnitCell *cell_transform_intmat(UnitCell *cell, IntegerMatrix *m); +extern UnitCell *cell_transform_intmat_inverse(UnitCell *cell, IntegerMatrix *m); #ifdef __cplusplus } -- cgit v1.2.3 From c04d93ef0e6faf50ad243932da158239f83cc619 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 11 Mar 2019 11:53:59 +0100 Subject: 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. --- libcrystfel/src/cell.h | 1 - 1 file changed, 1 deletion(-) (limited to 'libcrystfel/src/cell.h') 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); -- cgit v1.2.3