1#ifndef STAN_MATH_PRIM_FUN_MATRIX_EXP_HPP
2#define STAN_MATH_PRIM_FUN_MATRIX_EXP_HPP
24template <
typename T,
typename = require_eigen_t<T>>
27 const auto& A = A_in.eval();
29 if (T::RowsAtCompileTime == 1 && T::ColsAtCompileTime == 1) {
34 if (A_in.size() == 0) {
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
plain_type_t< T > matrix_exp(const T &A_in)
Return the matrix exponential of the input matrix.
Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > matrix_exp_2x2(const EigMat &A)
Return the matrix exponential of a 2x2 matrix.
Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > matrix_exp_pade(const EigMat &arg)
Computes the matrix exponential, using a Pade approximation, coupled with scaling and squaring.
fvar< T > square(const fvar< T > &x)
fvar< T > exp(const fvar< T > &x)
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...