Create Eigen matrix from spans.
831 {
832 if (spans.empty()) {
833 return {};
834 }
835
836 int rows = spans[0].size();
837 int cols = spans.size();
838
839 for (const auto& span : spans) {
840 if (span.size() !=
rows) {
842 }
843 }
844
845 Eigen::MatrixXd matrix(
rows, cols);
846 for (int col = 0; col < cols; ++col) {
847 for (
int row = 0; row <
rows; ++row) {
848 matrix(row, col) = static_cast<double>(spans[col][row]);
849 }
850 }
851 return matrix;
852 }
@ Runtime
General runtime operations (default fallback)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.