1 #ifndef STAN__AGRAD__FWD__MATRIX__INVERSE_HPP
2 #define STAN__AGRAD__FWD__MATRIX__INVERSE_HPP
5 #include <boost/math/tools/promotion.hpp>
18 template<
typename T,
int R,
int C>
20 Eigen::Matrix<fvar<T>,R,C>
26 Eigen::Matrix<T,R,C> m_deriv(m.rows(), m.cols());
27 Eigen::Matrix<T,R,C> m_inv(m.rows(), m.cols());
31 m_inv(i,j) = m(i,j).val_;
32 m_deriv(i,j) = m(i,j).d_;
Eigen::Matrix< fvar< T >, R, C > inverse(const Eigen::Matrix< fvar< T >, R, C > &m)
fvar< T > to_fvar(const T &x)
Eigen::Matrix< fvar< T >, R1, C1 > multiply(const Eigen::Matrix< fvar< T >, R1, C1 > &m, const fvar< T > &c)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > inverse(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
Returns the inverse of the specified matrix.
boost::enable_if_c< boost::is_arithmetic< T >::value, Eigen::Matrix< double, R, C > >::type multiply(const Eigen::Matrix< double, R, C > &m, T c)
Return specified matrix multiplied by specified scalar.
bool check_square(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is square.