1 #ifndef STAN__MATH__MATRIX__EXP_HPP
2 #define STAN__MATH__MATRIX__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>
exp(
const Eigen::Matrix<T,Rows,Cols>& m) {
19 return m.array().exp().matrix();
25 template<
int Rows,
int Cols>
26 inline Eigen::Matrix<double,Rows,Cols>
exp(
const Eigen::Matrix<double,Rows,Cols>& m) {
27 Eigen::Matrix<double,Rows,Cols> mat = m.array().exp().matrix();
28 for (
int i = 0,
size_ = mat.size(); i <
size_; i++)
30 mat(i) = std::numeric_limits<double>::quiet_NaN();
bool isnan(const stan::agrad::var &v)
Checks if the given number is NaN.
Eigen::Matrix< T, Rows, Cols > exp(const Eigen::Matrix< T, Rows, Cols > &m)
Return the element-wise exponentiation of the matrix or vector.