MayaFlux 0.1.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 363 of file OperationHelper.hpp.

364 {
365 static thread_local std::vector<std::vector<double>> columns;
366 columns.clear();
367 columns.resize(matrix.cols());
368 std::vector<std::span<double>> spans;
369 spans.reserve(matrix.cols());
370
371 for (int col = 0; col < matrix.cols(); ++col) {
372 columns[col].resize(matrix.rows());
373 for (int row = 0; row < matrix.rows(); ++row) {
374 columns[col][row] = static_cast<double>(matrix(row, col));
375 }
376 spans.emplace_back(columns[col].data(), columns[col].size());
377 }
378 return spans;
379 }

Referenced by extract_numeric_data().

+ Here is the caller graph for this function: