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

◆ recreate_eigen_matrix() [1/2]

Eigen::MatrixXd MayaFlux::Yantra::OperationHelper::recreate_eigen_matrix ( const std::vector< std::span< const double > > &  spans,
const DataStructureInfo structure_info 
)
staticprivate

Infer data structure from ComputeData type.

Template Parameters
TComputeData type
Parameters
compute_dataInput data
containerOptional container for region-like types
Returns
Pair of (dimensions, modality)

Definition at line 107 of file OperationHelper.cpp.

110{
111 if (spans.empty()) {
112 return {};
113 }
114
115 if (structure_info.dimensions.size() >= 2) {
116 int expected_rows = static_cast<int>(structure_info.dimensions[0].size);
117 int expected_cols = static_cast<int>(structure_info.dimensions[1].size);
118
119 if (spans.size() != expected_cols) {
120 error<std::invalid_argument>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(),
121 "Column count doesn't match dimension info. Expected {}, got {}", expected_cols, spans.size());
122 }
123 if (!spans.empty() && spans[0].size() != expected_rows) {
124 error<std::invalid_argument>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(),
125 "Row count doesn't match dimension info. Expected {}, got {}", expected_rows, spans[0].size());
126 }
127 }
128
129 return create_eigen_matrix(spans);
130}
static Eigen::MatrixXd create_eigen_matrix(const std::vector< std::vector< T > > &columns)
Infer data structure from ComputeData type.
@ Runtime
General runtime operations (default fallback)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.

References create_eigen_matrix(), MayaFlux::Yantra::DataStructureInfo::dimensions, MayaFlux::Journal::Runtime, and MayaFlux::Journal::Yantra.

+ Here is the call graph for this function: