MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ sort_copy()

template<ComputeData InputType = Kakshya::DataVariant, ComputeData OutputType = InputType>
output_type MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_copy ( const input_type &  input)
inlineprivate

Copy-based sorting (preserves input)

Definition at line 188 of file StandardSorter.hpp.

189 {
190 try {
191 std::vector<std::vector<double>> working_buffer;
192 auto [working_spans, structure_info] = OperationHelper::setup_operation_buffer(
193 const_cast<input_type&>(input), working_buffer);
194
196
197 output_type result = this->convert_result(working_buffer, structure_info);
198 result.metadata = input.metadata;
199 result.container = input.container;
200 result.metadata["sort_type"] = "copy";
201
202 return result;
203
204 } catch (const std::exception& e) {
205 output_type error_result;
206 error_result.metadata = input.metadata;
207 error_result.container = input.container;
208 error_result.metadata["error"] = std::string("Sorting failed: ") + e.what();
209 return error_result;
210 }
211 }
Core::GlobalInputConfig input
Definition Config.cpp:42
output_type convert_result(std::vector< std::vector< double > > &result_data, DataStructureInfo &metadata)
Convert processed double data back to OutputType using metadata and optional callback.
static auto setup_operation_buffer(T &input, std::vector< std::vector< double > > &working_buffer)
Setup operation buffer from Datum or ComputeData type.
typename base_type::input_type input_type
typename base_type::output_type output_type
SortingDirection get_direction() const
void sort_channels(std::vector< std::span< double > > &channels, SortingDirection direction, SortingAlgorithm algorithm)
Sort all channels in-place.
Definition Sort.cpp:19
std::unordered_map< std::string, std::any > metadata
Associated metadata.
Definition DataIO.hpp:30

References MayaFlux::Yantra::ComputeOperation< InputType, OutputType >::convert_result(), MayaFlux::Yantra::UniversalSorter< InputType, OutputType >::get_direction(), input, MayaFlux::Yantra::OperationHelper::setup_operation_buffer(), and MayaFlux::Kinesis::Discrete::sort_channels().

Referenced by MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_implementation(), MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_in_place(), MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_indices_only(), and MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_parallel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: