-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCompressMethod.h
34 lines (22 loc) · 1.48 KB
/
CompressMethod.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef COMPRESSMETHOD_H
#define COMPRESSMETHOD_H
#include <iostream>
#include <iostream>
#include <vector>
#include <fstream>
#include <chrono>
#include <armadillo>
#include "zfp.h"
#pragma comment(lib,"zfp.lib")
int compress_accuracy(const arma::fmat& TraceData, const double accuracy, std::vector<char>& buffer, size_t& compressed_size_out);
int compress_precision(const arma::fmat& TraceData, const double precision, std::vector<char>& buffer, size_t& compressed_size_out);
int compress_ratio(const arma::fmat& TraceData, const double bits_per_value, std::vector<char>& buffer, size_t& compressed_size_out);
int compress_reversible(const arma::fmat& TraceData, std::vector<char>& buffer, size_t& compressed_size_out);
int decompress_accuracy(const std::vector<char>& buffer, size_t cols, size_t rows, const double accuracy, arma::fmat& decompressedData);
int decompress_precision(const std::vector<char>& buffer, size_t cols, size_t rows, const double precision, arma::fmat& decompressedData);
int decompress_ratio(const std::vector<char>& buffer, size_t cols, size_t rows, const double bits_per_value, arma::fmat& decompressedData);
int decompress_reversible(const std::vector<char>& buffer, size_t cols, size_t rows, arma::fmat& decompressedData);
int part_read(const std::string& filePath, size_t All_T, size_t Samples, size_t t_start, size_t t_end, arma::fmat& TraceData);
bool readCompressedData(const std::string& filename, std::vector<char>& need_decompress);
#endif // DATA_READER_H
#pragma once