1 #ifndef STAN_MATH_FWD_MAT_FUN_INVERSE_HPP
2 #define STAN_MATH_FWD_MAT_FUN_INVERSE_HPP
11 #include <boost/math/tools/promotion.hpp>
17 template<
typename T,
int R,
int C>
19 Eigen::Matrix<fvar<T>, R, C>
25 Eigen::Matrix<T, R, C> m_deriv(m.rows(), m.cols());
26 Eigen::Matrix<T, R, C> m_inv(m.rows(), m.cols());
28 for (
size_type i = 0; i < m.rows(); i++) {
29 for (
size_type j = 0; j < m.cols(); j++) {
30 m_inv(i, j) = m(i, j).val_;
31 m_deriv(i, j) = m(i, j).d_;
Eigen::Matrix< fvar< T >, R1, C1 > multiply(const Eigen::Matrix< fvar< T >, R1, C1 > &m, const fvar< T > &c)
fvar< T > to_fvar(const T &x)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Eigen::Matrix< fvar< T >, R, C > inverse(const Eigen::Matrix< fvar< T >, R, C > &m)
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.