#include <wavelet_chunking.hpp>
template<typename T>
class WaveletChunking< T >
Definition at line 2 of file wavelet_chunking.hpp.
◆ WaveletChunking()
Definition at line 4 of file wavelet_chunking.hpp.
6 if (window_size == 0) {
7 throw std::invalid_argument("Window size cannot be zero");
8 }
9 }
◆ chunk()
template<typename T >
| std::vector< std::vector< T > > WaveletChunking< T >::chunk |
( |
const std::vector< T > & |
data | ) |
|
|
inline |
Definition at line 22 of file wavelet_chunking.hpp.
22 {
23 if (data.empty()) {
24 throw std::invalid_argument("Cannot chunk empty data");
25 }
26
27 std::vector<std::vector<T>> result;
28 std::vector<T> current_chunk;
29
30 for (size_t i = 0; i < data.size(); ++i) {
31 current_chunk.push_back(data[i]);
32
34
36 result.push_back(current_chunk);
37 current_chunk.clear();
38 }
39 }
40 }
41
42 if (!current_chunk.empty()) {
43 result.push_back(current_chunk);
44 }
45
46 return result;
47 }
bool detect_boundary(const std::vector< T > &window)
◆ detect_boundary()
template<typename T >
| bool WaveletChunking< T >::detect_boundary |
( |
const std::vector< T > & |
window | ) |
|
|
inlineprivate |
Definition at line 53 of file wavelet_chunking.hpp.
53 {
54 if (window.size() < 2)
55 return false;
56
57
58 double max_diff = 0.0;
59 for (size_t i = 1; i < window.size(); ++i) {
60 max_diff = std::max(max_diff, std::abs(static_cast<double>(window[i] - window[i - 1])));
61 }
63 }
◆ set_threshold()
◆ set_window_size()
Definition at line 11 of file wavelet_chunking.hpp.
11 {
12 if (new_size == 0) {
13 throw std::invalid_argument("Window size cannot be zero");
14 }
16 }
◆ threshold_
◆ window_size_
The documentation for this class was generated from the following file: