Having an external, row-major matrix A(m x n), and having already created the external, row-major matrix B(n x m) for the result, for getting the transpose I do:
Map<MatrixXd,RowMajor> (B,n,m) = Map<MatrixXd,RowMajor> (A,m,n).transpose()
where A and B point to the data buffers. This works fine in the default case of col-major matrices, but for row-major matrices the result is correct only for m == n, for m <> n the numbers are skewed up. Am I misinterpreting how to map row-major external data?
The second template argument of
Map
is for alignment control. The row-major layout must be specified through the matrix type: