You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
525 B

  1. Matrix<int, 3, 4, ColMajor> Acolmajor;
  2. Acolmajor << 8, 2, 2, 9,
  3. 9, 1, 4, 4,
  4. 3, 5, 4, 5;
  5. cout << "The matrix A:" << endl;
  6. cout << Acolmajor << endl << endl;
  7. cout << "In memory (column-major):" << endl;
  8. for (int i = 0; i < Acolmajor.size(); i++)
  9. cout << *(Acolmajor.data() + i) << " ";
  10. cout << endl << endl;
  11. Matrix<int, 3, 4, RowMajor> Arowmajor = Acolmajor;
  12. cout << "In memory (row-major):" << endl;
  13. for (int i = 0; i < Arowmajor.size(); i++)
  14. cout << *(Arowmajor.data() + i) << " ";
  15. cout << endl;