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

◆ create_eigen_matrix() [2/2]

template<typename T >
static Eigen::MatrixXd MayaFlux::Yantra::OperationHelper::create_eigen_matrix ( const std::vector< std::vector< T > > &  columns)
inlinestaticprivate

Infer data structure from ComputeData type.

Template Parameters
TComputeData type
Parameters
compute_dataInput data
Returns
Pair of (dimensions, modality)

Definition at line 802 of file OperationHelper.hpp.

803 {
804 if (columns.empty()) {
805 return {};
806 }
807
808 int rows = columns[0].size();
809 int cols = columns.size();
810
811 for (const auto& col : columns) {
812 if (col.size() != rows) {
813 error<std::invalid_argument>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(), "All columns must have same size");
814 }
815 }
816
817 Eigen::MatrixXd matrix(rows, cols);
818 for (int col = 0; col < cols; ++col) {
819 for (int row = 0; row < rows; ++row) {
820 matrix(row, col) = static_cast<double>(columns[col][row]);
821 }
822 }
823 return matrix;
824 }
uint32_t rows
uint32_t columns
@ Runtime
General runtime operations (default fallback)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.

References columns, and rows.

Referenced by recreate_eigen_matrix(), and recreate_eigen_matrix().

+ Here is the caller graph for this function: