Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
mdivide_left_spd.hpp
Go to the documentation of this file.
1 #ifndef __STAN__MATH__MATRIX__MDIVIDE_LEFT_SPD_HPP__
2 #define __STAN__MATH__MATRIX__MDIVIDE_LEFT_SPD_HPP__
3 
4 #include <boost/math/tools/promotion.hpp>
9 
10 namespace stan {
11  namespace math {
12 
22  template <typename T1, typename T2, int R1, int C1, int R2, int C2>
23  inline
24  Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type,R1,C2>
25  mdivide_left_spd(const Eigen::Matrix<T1,R1,C1> &A,
26  const Eigen::Matrix<T2,R2,C2> &b) {
27  stan::math::validate_square(A,"mdivide_left_spd");
28  stan::math::validate_multiplicable(A,b,"mdivide_left_spd");
29  return promote_common<Eigen::Matrix<T1,R1,C1>,
30  Eigen::Matrix<T2,R1,C1> >(A)
31  .llt()
32  .solve( promote_common<Eigen::Matrix<T1,R2,C2>,
33  Eigen::Matrix<T2,R2,C2> >(b) );
34  }
35 
36  }
37 }
38 #endif

     [ Stan Home Page ] © 2011–2013, Stan Development Team.