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

◆ set_analysis_parameter()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = Eigen::VectorXd>
void MayaFlux::Yantra::EnergyAnalyzer< InputType, OutputType >::set_analysis_parameter ( const std::string &  name,
std::any  value 
)
inlineoverrideprotectedvirtual

Handle analysis-specific parameters.

Reimplemented from MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType >.

Definition at line 343 of file EnergyAnalyzer.hpp.

344 {
345 if (name == "method") {
346 try {
347 auto method_str = safe_any_cast_or_throw<std::string>(value);
348 m_method = string_to_method(method_str);
349 return;
350 } catch (const std::runtime_error&) {
351 error_rethrow(Journal::Component::Yantra, Journal::Context::ComputeMatrix, std::source_location::current(), "Invalid method parameter - expected string or EnergyMethod enum");
352 }
353 if (auto* method_enum = std::any_cast<EnergyMethod>(&value)) {
354 m_method = *method_enum;
355 return;
356 }
357 } else if (name == "window_size") {
358 if (auto* size = std::any_cast<uint32_t>(&value)) {
359 m_window_size = *size;
361 return;
362 }
363 } else if (name == "hop_size") {
364 if (auto* size = std::any_cast<uint32_t>(&value)) {
365 m_hop_size = *size;
367 return;
368 }
369 } else if (name == "classification_enabled") {
370 if (auto* enabled = std::any_cast<bool>(&value)) {
371 m_classification_enabled = *enabled;
372 return;
373 }
374 }
375
376 base_type::set_analysis_parameter(name, std::move(value));
377 }
static EnergyMethod string_to_method(const std::string &str)
Convert string to energy method enum.
virtual void set_analysis_parameter(const std::string &name, std::any value)
Analysis-specific parameter handling (override for custom parameters)
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.