1 #ifndef STAN_MATH_PRIM_FUN_TRANSPOSE_HPP
2 #define STAN_MATH_PRIM_FUN_TRANSPOSE_HPP
3 
4 #include <stan/math/prim/meta.hpp>
5 #include <stan/math/prim/fun/Eigen.hpp>
6 
7 namespace stan {
8 namespace math {
9 
10 /**
11  * Transposes a matrix.
12  * @tparam T type of the matrix or expression
13  * @param m matrix or expression
14  * @return transposed matrix
15  */
16 template <typename T, require_matrix_t<T>* = nullptr>
transpose(const T & m)17 auto inline transpose(const T& m) {
18   return m.transpose();
19 }
20 
21 }  // namespace math
22 }  // namespace stan
23 #endif
24