1 #ifndef STAN__MATH__MATRIX__QUAD_FORM_HPP
2 #define STAN__MATH__MATRIX__QUAD_FORM_HPP
4 #include <boost/utility/enable_if.hpp>
5 #include <boost/type_traits.hpp>
19 template<
int RA,
int CA,
int RB,
int CB,
typename T>
20 inline Eigen::Matrix<T,CB,CB>
22 const Eigen::Matrix<T,RB,CB>& B)
31 template<
int RA,
int CA,
int RB,
typename T>
34 const Eigen::Matrix<T,RB,1>& B)
45 template<
int RA,
int CA,
int RB,
int CB,
typename T>
46 inline Eigen::Matrix<T,CB,CB>
48 const Eigen::Matrix<T,RB,CB>& B)
60 template<
int RA,
int CA,
int RB,
typename T>
63 const Eigen::Matrix<T,RB,1>& B)
Eigen::Matrix< T, CB, CB > quad_form_sym(const Eigen::Matrix< T, RA, CA > &A, const Eigen::Matrix< T, RB, CB > &B)
bool check_symmetric(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 symmetric.
bool check_multiplicable(const char *function, const T1 &y1, const char *name1, const T2 &y2, const char *name2, T_result *result)
Eigen::Matrix< T, C, R > transpose(const Eigen::Matrix< T, R, C > &m)
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.
Eigen::Matrix< T, CB, CB > quad_form(const Eigen::Matrix< T, RA, CA > &A, const Eigen::Matrix< T, RB, CB > &B)
Compute B^T A B.
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.
double dot_product(const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
Returns the dot product of the specified vectors.