blob: bfaec50d655ef097e79479def0585917d2387e8d [file] [log] [blame]
Rasmus Munk Larsen2434cfd2023-12-06 12:02:41 -08001MatrixXf M1 = MatrixXf::Random(3, 8);
Googler45874d82019-08-21 12:06:47 -07002cout << "Column major input:" << endl << M1 << "\n";
Rasmus Munk Larsen2434cfd2023-12-06 12:02:41 -08003Map<MatrixXf, 0, OuterStride<> > M2(M1.data(), M1.rows(), (M1.cols() + 2) / 3, OuterStride<>(M1.outerStride() * 3));
Googler45874d82019-08-21 12:06:47 -07004cout << "1 column over 3:" << endl << M2 << "\n";
5
Rasmus Munk Larsen2434cfd2023-12-06 12:02:41 -08006typedef Matrix<float, Dynamic, Dynamic, RowMajor> RowMajorMatrixXf;
Googler45874d82019-08-21 12:06:47 -07007RowMajorMatrixXf M3(M1);
8cout << "Row major input:" << endl << M3 << "\n";
Rasmus Munk Larsen2434cfd2023-12-06 12:02:41 -08009Map<RowMajorMatrixXf, 0, Stride<Dynamic, 3> > M4(M3.data(), M3.rows(), (M3.cols() + 2) / 3,
10 Stride<Dynamic, 3>(M3.outerStride(), 3));
Rasmus Munk Larsene810da02020-03-25 17:33:10 -070011cout << "1 column over 3:" << endl << M4 << "\n";