COSC-4P80-Assignment-2/lib/eigen-3.4.0/doc/snippets/Tutorial_Map_rowmajor.cpp

8 lines
299 B
C++
Raw Normal View History

2024-10-21 16:42:03 -04:00
int array[8];
for(int i = 0; i < 8; ++i) array[i] = i;
cout << "Column-major:\n" << Map<Matrix<int,2,4> >(array) << endl;
cout << "Row-major:\n" << Map<Matrix<int,2,4,RowMajor> >(array) << endl;
cout << "Row-major using stride:\n" <<
Map<Matrix<int,2,4>, Unaligned, Stride<1,4> >(array) << endl;