[2c47b73] | 1 | /** |
---|
| 2 | * @file TightDataPointStorageF.h |
---|
| 3 | * @author Sheng Di and Dingwen Tao |
---|
| 4 | * @date Aug, 2016 |
---|
| 5 | * @brief Header file for the tight data point storage (TDPS). |
---|
| 6 | * (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory. |
---|
| 7 | * See COPYRIGHT in top-level directory. |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #ifndef _TightDataPointStorageF_H |
---|
| 11 | #define _TightDataPointStorageF_H |
---|
| 12 | |
---|
| 13 | #ifdef __cplusplus |
---|
| 14 | extern "C" { |
---|
| 15 | #endif |
---|
| 16 | |
---|
| 17 | #include <stdio.h> |
---|
| 18 | |
---|
| 19 | typedef struct TightDataPointStorageF |
---|
| 20 | { |
---|
| 21 | size_t dataSeriesLength; |
---|
| 22 | int allSameData; |
---|
| 23 | double realPrecision; //it's used as the pwrErrBoundRatio when errBoundMode==PW_REL |
---|
| 24 | float medianValue; |
---|
| 25 | char reqLength; |
---|
| 26 | char radExpo; //used to compute reqLength based on segmented precisions in "pw_rel_compression" |
---|
| 27 | |
---|
| 28 | int stateNum; |
---|
| 29 | int allNodes; |
---|
| 30 | |
---|
| 31 | size_t exactDataNum; |
---|
| 32 | float reservedValue; |
---|
| 33 | |
---|
| 34 | unsigned char* rtypeArray; |
---|
| 35 | size_t rtypeArray_size; |
---|
| 36 | |
---|
[9ee2ce3] | 37 | float minLogValue; |
---|
| 38 | |
---|
[2c47b73] | 39 | unsigned char* typeArray; //its size is dataSeriesLength/4 (or xxx/4+1) |
---|
| 40 | size_t typeArray_size; |
---|
| 41 | |
---|
| 42 | unsigned char* leadNumArray; //its size is exactDataNum/4 (or exactDataNum/4+1) |
---|
| 43 | size_t leadNumArray_size; |
---|
| 44 | |
---|
| 45 | unsigned char* exactMidBytes; |
---|
| 46 | size_t exactMidBytes_size; |
---|
| 47 | |
---|
| 48 | unsigned char* residualMidBits; |
---|
| 49 | size_t residualMidBits_size; |
---|
| 50 | |
---|
| 51 | unsigned int intervals; //quantization_intervals |
---|
| 52 | |
---|
| 53 | unsigned char isLossless; //a mark to denote whether it's lossless compression (1 is yes, 0 is no) |
---|
| 54 | |
---|
| 55 | size_t segment_size; |
---|
| 56 | |
---|
| 57 | unsigned char* pwrErrBoundBytes; |
---|
| 58 | int pwrErrBoundBytes_size; |
---|
| 59 | |
---|
[9ee2ce3] | 60 | unsigned char* raBytes; |
---|
| 61 | size_t raBytes_size; |
---|
| 62 | |
---|
[2c47b73] | 63 | } TightDataPointStorageF; |
---|
| 64 | |
---|
| 65 | void new_TightDataPointStorageF_Empty(TightDataPointStorageF **self); |
---|
| 66 | int new_TightDataPointStorageF_fromFlatBytes(TightDataPointStorageF **self, unsigned char* flatBytes, size_t flatBytesLength); |
---|
| 67 | |
---|
| 68 | void new_TightDataPointStorageF(TightDataPointStorageF **self, |
---|
| 69 | size_t dataSeriesLength, size_t exactDataNum, |
---|
| 70 | int* type, unsigned char* exactMidBytes, size_t exactMidBytes_size, |
---|
| 71 | unsigned char* leadNumIntArray, //leadNumIntArray contains readable numbers.... |
---|
| 72 | unsigned char* resiMidBits, size_t resiMidBits_size, |
---|
| 73 | unsigned char resiBitLength, |
---|
| 74 | double realPrecision, float medianValue, char reqLength, unsigned int intervals, |
---|
| 75 | unsigned char* pwrErrBoundBytes, size_t pwrErrBoundBytes_size, unsigned char radExpo); |
---|
| 76 | |
---|
| 77 | /** |
---|
| 78 | * This function is designed for first-version of the point-wise relative error bound (developed by Sheng Di for TPDS18 paper) |
---|
| 79 | * |
---|
| 80 | * */ |
---|
| 81 | void new_TightDataPointStorageF2(TightDataPointStorageF **self, |
---|
| 82 | size_t dataSeriesLength, size_t exactDataNum, |
---|
| 83 | int* type, unsigned char* exactMidBytes, size_t exactMidBytes_size, |
---|
| 84 | unsigned char* leadNumIntArray, //leadNumIntArray contains readable numbers.... |
---|
| 85 | unsigned char* resiMidBits, size_t resiMidBits_size, |
---|
| 86 | unsigned char* resiBitLength, size_t resiBitLengthSize, |
---|
| 87 | double realPrecision, float medianValue, char reqLength, unsigned int intervals, |
---|
| 88 | unsigned char* pwrErrBoundBytes, size_t pwrErrBoundBytes_size, unsigned char radExpo); |
---|
| 89 | |
---|
| 90 | void convertTDPStoBytes_float(TightDataPointStorageF* tdps, unsigned char* bytes, unsigned char* dsLengthBytes, unsigned char sameByte); |
---|
| 91 | void convertTDPStoBytes_float_reserve(TightDataPointStorageF* tdps, unsigned char* bytes, unsigned char* dsLengthBytes, unsigned char sameByte); |
---|
| 92 | void convertTDPStoFlatBytes_float(TightDataPointStorageF *tdps, unsigned char** bytes, size_t *size); |
---|
| 93 | void convertTDPStoFlatBytes_float_args(TightDataPointStorageF *tdps, unsigned char* bytes, size_t *size); |
---|
| 94 | |
---|
| 95 | void free_TightDataPointStorageF(TightDataPointStorageF *tdps); |
---|
| 96 | void free_TightDataPointStorageF2(TightDataPointStorageF *tdps); |
---|
| 97 | |
---|
| 98 | #ifdef __cplusplus |
---|
| 99 | } |
---|
| 100 | #endif |
---|
| 101 | |
---|
| 102 | #endif /* ----- #ifndef _TightDataPointStorageF_H ----- */ |
---|