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

◆ extract_from_eigen_matrix()

template<typename EigenMatrix >
static std::vector< std::span< double > > MayaFlux::Yantra::OperationHelper::extract_from_eigen_matrix ( const EigenMatrix &  matrix)
inlinestaticprivate

Infer data structure from ComputeData type.

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

Definition at line 561 of file OperationHelper.hpp.

562 {
563 static thread_local std::vector<std::vector<double>> columns;
564 columns.clear();
565 columns.resize(matrix.cols());
566 std::vector<std::span<double>> spans;
567 spans.reserve(matrix.cols());
568
569 for (int col = 0; col < matrix.cols(); ++col) {
570 columns[col].resize(matrix.rows());
571 for (int row = 0; row < matrix.rows(); ++row) {
572 columns[col][row] = static_cast<double>(matrix(row, col));
573 }
574 spans.emplace_back(columns[col].data(), columns[col].size());
575 }
576 return spans;
577 }