Advanced Chunk Processing Library 0.2.0
A comprehensive C++ library for advanced data chunking strategies and processing operations
Loading...
Searching...
No Matches
chunk_processing::NeuralChunkingStrategy< T > Class Template Reference

#include <chunk_strategy_implementations.hpp>

+ Inheritance diagram for chunk_processing::NeuralChunkingStrategy< T >:
+ Collaboration diagram for chunk_processing::NeuralChunkingStrategy< T >:

Public Member Functions

 NeuralChunkingStrategy ()
 
std::vector< std::vector< T > > apply (const std::vector< T > &data) const override
 

Private Attributes

double threshold_
 

Detailed Description

template<typename T>
class chunk_processing::NeuralChunkingStrategy< T >

Definition at line 10 of file chunk_strategy_implementations.hpp.

Constructor & Destructor Documentation

◆ NeuralChunkingStrategy()

template<typename T >
chunk_processing::NeuralChunkingStrategy< T >::NeuralChunkingStrategy ( )
inlineexplicit

Member Function Documentation

◆ apply()

template<typename T >
std::vector< std::vector< T > > chunk_processing::NeuralChunkingStrategy< T >::apply ( const std::vector< T > &  data) const
inlineoverridevirtual

Implements chunk_processing::ChunkStrategy< T >.

Definition at line 17 of file chunk_strategy_implementations.hpp.

17 {
18 std::vector<std::vector<T>> result;
19 if (data.empty())
20 return result;
21
22 std::vector<T> current_chunk;
23 for (const auto& value : data) {
24 if (!current_chunk.empty() && std::abs(value - current_chunk.back()) > threshold_) {
25 result.push_back(current_chunk);
26 current_chunk.clear();
27 }
28 current_chunk.push_back(value);
29 }
30 if (!current_chunk.empty()) {
31 result.push_back(current_chunk);
32 }
33 return result;
34 }

References chunk_processing::NeuralChunkingStrategy< T >::threshold_.

Member Data Documentation

◆ threshold_

template<typename T >
double chunk_processing::NeuralChunkingStrategy< T >::threshold_
private

The documentation for this class was generated from the following file: