1 #ifndef STAN_MATH_PRIM_MAT_FUN_EXP_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_EXP_HPP
5 #include <boost/math/special_functions/fpclassify.hpp>
17 template<
typename T,
int Rows,
int Cols>
18 inline Eigen::Matrix<T, Rows, Cols>
19 exp(
const Eigen::Matrix<T, Rows, Cols>& m) {
20 return m.array().exp().matrix();
26 template<
int Rows,
int Cols>
27 inline Eigen::Matrix<double, Rows, Cols>
28 exp(
const Eigen::Matrix<double, Rows, Cols>& m) {
29 Eigen::Matrix<double, Rows, Cols> mat = m.array().exp().matrix();
30 for (
int i = 0,
size_ = mat.size(); i <
size_; i++)
32 mat(i) = std::numeric_limits<double>::quiet_NaN();
bool isnan(const stan::math::var &v)
Checks if the given number is NaN.
fvar< T > exp(const fvar< T > &x)