aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/stream.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-01-11 09:53:47 +0100
committerThomas White <taw@physics.org>2021-01-11 09:57:58 +0100
commit9d9e819bc535102ca52d6270b6a928e6e70539b6 (patch)
tree135655915dc6418356f72076b572fc1ed032159e /libcrystfel/src/stream.c
parent708590dd4bfac92bde90d9762f413c7496afbddf (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/stream.c')
-rw-r--r--libcrystfel/src/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 08f0e332..afaf40a5 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1250,7 +1250,7 @@ Stream *stream_open_fd_for_write(int fd, const DataTemplate *dtempl)
}
-void stream_write_target_cell(Stream *st, const UnitCell *cell)
+void stream_write_target_cell(Stream *st, UnitCell *cell)
{
if ( cell == NULL ) return;
fprintf(st->fh, STREAM_CELL_START_MARKER"\n");