Add transpose() function to matrix.hpp