1#ifndef STAN_MATH_PRIM_FUN_MATRIX_EXP_HPP
2#define STAN_MATH_PRIM_FUN_MATRIX_EXP_HPP
24template <
typename EigenMat,
typename = require_eigen_t<EigenMat>>
26 decltype(
auto) A =
to_ref(std::forward<EigenMat>(A_in));
27 using T = std::decay_t<EigenMat>;
29 if constexpr (T::RowsAtCompileTime == 1 && T::ColsAtCompileTime == 1) {
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< EigenMat > matrix_exp(EigenMat &&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.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
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< std::decay_t< T > >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...