147 {
148 try {
149 std::vector<std::vector<double>> working_buffer;
151 const_cast<input_type&
>(input), working_buffer);
152
154
156 result.metadata = input.metadata;
157 result.container = input.container;
158 result.metadata["sort_type"] = "copy";
159
160 return result;
161
162 } catch (const std::exception& e) {
164 error_result.
metadata = input.metadata;
165 error_result.container = input.container;
166 error_result.metadata["error"] = std::string("Sorting failed: ") + e.what();
167 return error_result;
168 }
169 }
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 IO or ComputeData type.
SortingAlgorithm m_algorithm
typename base_type::input_type input_type
typename base_type::output_type output_type
SortingDirection get_direction() const
void sort_channels_inplace(std::vector< std::span< double > > &channels, SortingDirection direction, SortingAlgorithm algorithm)
Sort multiple channels (spans) in-place.
std::unordered_map< std::string, std::any > metadata
Associated metadata.