diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-15 07:19:41 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-15 07:19:41 (GMT) |
commit | 07172495620db5631ec537e09090273495304f77 (patch) | |
tree | 3fd146c22f0b4b2167495f22b377a70aeed25a33 /include | |
parent | 015f256ef3c5ceadf950244feb9be4fc8fc482ac (diff) |
Compression precision can be set. Improved new frame set settings.
Two functions for getting and setting precision of lossy compression.
Functions automatically creating new frame sets when needed now
have better frame settings.
Diffstat (limited to 'include')
-rw-r--r-- | include/tng_io.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/include/tng_io.h b/include/tng_io.h index f6eb637..fb4efd6 100644 --- a/include/tng_io.h +++ b/include/tng_io.h @@ -1072,7 +1072,7 @@ tng_function_status DECLSPECDLLEXPORT tng_input_file_len_get /** * @brief Get the number of frames in the trajectory - * @param tng_data the trajectory of which to get the number of frames. + * @param tng_data is the trajectory of which to get the number of frames. * @param n is pointing to a value set to the number of frames. * @pre \code tng_data != 0 \endcode The trajectory container (tng_data) * must be initialised before using it. @@ -1085,6 +1085,34 @@ tng_function_status DECLSPECDLLEXPORT tng_num_frames_get int64_t *n); /** + * @brief Get the precision of lossy compression + * @param tng_data is the trajectory of which to get the compression precision. + * @param precision will be pointing to the retrieved compression precision. + * @pre \code tng_data != 0 \endcode The trajectory container (tng_data) + * must be initialised before using it. + * @details A compression precision of 0.001 (the default) means that the + * compressed values are accurate to the third decimal. + * @return TNG_SUCCESS (0) if successful. + */ +tng_function_status DECLSPECDLLEXPORT tng_compression_precision_get + (const tng_trajectory_t tng_data, + double *precision); + +/** + * @brief Get the precision of lossy compression + * @param tng_data is the trajectory of which to set the compression precision. + * @param precision is the new compression precision. + * @pre \code tng_data != 0 \endcode The trajectory container (tng_data) + * must be initialised before using it. + * @details A compression precision of 0.001 (the default) means that the + * compressed values are accurate to the third decimal. + * @return TNG_SUCCESS (0) if successful. + */ +tng_function_status DECLSPECDLLEXPORT tng_compression_precision_set + (tng_trajectory_t tng_data, + const double precision); + +/** * @brief Set the number of particles, in the case no molecular system is used. * @param tng_data is the trajectory of which to get the number of particles. * @param n is the number of particles to use. @@ -2645,8 +2673,9 @@ tng_function_status DECLSPECDLLEXPORT tng_time_get_str * @param filename is a string containing the name of the trajectory to open. * @param mode specifies the file mode of the trajectory. Can be set to 'r', * 'w' or 'a' for reading, writing or appending respectively. - * @param tng_data_p is a pointer to the opened trajectory. This must be - * closed by the user. + * @param tng_data_p is a pointer to the opened trajectory. This will be + * allocated by the TNG library. The trajectory must be + * closed by the user, whereby memory is freed. * @pre \code tng_data != 0 \endcode The trajectory container (tng_data) * must be initialised before using it. * @pre \code filename != 0 \endcode The pointer to the filename must not be a |