diff options
author | Thomas White <taw@physics.org> | 2021-01-11 09:53:47 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-01-11 09:57:58 +0100 |
commit | 9d9e819bc535102ca52d6270b6a928e6e70539b6 (patch) | |
tree | 135655915dc6418356f72076b572fc1ed032159e /libcrystfel/src/cell-utils.h | |
parent | 708590dd4bfac92bde90d9762f413c7496afbddf (diff) |
UnitCell: Store all representations once they're calculated
Previously, the "getter" functions would re-calculate the requested
representation every time they were called. This could mean doing a
matrix inversion in the middle of a tight loop, wasting loads of time.
Now, it stores the calculated values and returns them directly next
time. Setting the parameters invalidates the values for all
representations other than the one given.
The cost of doing this is that the cell can no longer be "const" in the
getter functions. This tracked through some other code, but nothing too
severe.
Diffstat (limited to 'libcrystfel/src/cell-utils.h')
-rw-r--r-- | libcrystfel/src/cell-utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcrystfel/src/cell-utils.h b/libcrystfel/src/cell-utils.h index 0a110bf2..5789d606 100644 --- a/libcrystfel/src/cell-utils.h +++ b/libcrystfel/src/cell-utils.h @@ -58,7 +58,7 @@ extern void cell_print_full(UnitCell *cell); extern UnitCell *load_cell_from_pdb(const char *filename); extern UnitCell *load_cell_from_file(const char *filename); -extern void write_cell(const UnitCell *cell, FILE *fh); +extern void write_cell(UnitCell *cell, FILE *fh); extern int cell_is_sensible(UnitCell *cell); |