This is a very simple issue that for some reason I am not sure why I keep getting wrong. I am basically trying to copy array ``n`` to array ``dummy`` as the following:
As written, dummy's buffer is assigned transpose(ne). But since the transposition of an X by Y matrix is a Y by X matrix, to actually finish the transposition you'd also have to swap dummy.rows and dummy.cols, or dummy will be the wrong shape (unless it's square).
BTW, this operation should be in a function so that it can be thoroughly tested once and re-used.
I usually use ``memcpy`` but it wasn't really working for this struct here.
Why is the first matrix 10x10 but the second matrix is 11x10? A typo? How should you copy a 10x10 matrix to an 11x10 matrix?
If the matrices are actually the same size, memcpy should work unless you are trying to swap storage orders.
If the matrices are actually the same size, memcpy should work unless you are trying to swap storage orders.
They are the same size, but I was getting an error when using memcpy. Something like: no suitable conversion function from "real_buffer" to "void *" exists
then you did something wrong.
specifically, if its the same code you had before, its real_buffer.a that can be treated as a pointer, not the struct itself. you forgot to get down to the right level. Memcpy is sort of playing with fire, though. Its fast, but it takes some care to avoid mistakes.
transpose in place isnt too hard to cook up if you don't need all this copying nonsense.