transpose() which transposes the matrix object itself
transposed() which returns a new, transposed matrix object
would be consistent with other existing function names... but... transposing the object itself would probably require some kind of bool variable inside the class that indicates if transpose() has been called on the matrix, since switching dimensions N and M for the statically allocated Matrix object is not possible. An option would be to break consistency, and make transpose() return a new, transposed Matrix object.
transpose()
which transposes the matrix object itselftransposed()
which returns a new, transposed matrix object would be consistent with other existing function names... but... transposing the object itself would probably require some kind of bool variable inside the class that indicates if transpose() has been called on the matrix, since switching dimensionsN
andM
for the statically allocated Matrix object is not possible. An option would be to break consistency, and maketranspose()
return a new, transposed Matrix object.