MayaFlux 0.1.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 30 of file OperationHelper.cpp.

33{
34 if (spans.empty()) {
35 return {};
36 }
37
38 if (structure_info.dimensions.size() >= 2) {
39 int expected_rows = structure_info.dimensions[0].size;
40 int expected_cols = structure_info.dimensions[1].size;
41
42 if (spans.size() != expected_cols) {
43 throw std::invalid_argument("Span count doesn't match dimension info");
44 }
45 if (!spans.empty() && spans[0].size() != expected_rows) {
46 throw std::invalid_argument("Span size doesn't match dimension info");
47 }
48 }
49
50 return create_eigen_matrix(spans);
51}
static Eigen::MatrixXd create_eigen_matrix(const std::vector< std::vector< T > > &columns)
Infer data structure from ComputeData type.

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

+ Here is the call graph for this function: