Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
check_pos_definite.hpp
Go to the documentation of this file.
1 #ifndef __STAN__AGRAD__REV__ERROR_HANDLING__MATRIX__CHECK_POS_DEFINITE_HPP__
2 #define __STAN__AGRAD__REV__ERROR_HANDLING__MATRIX__CHECK_POS_DEFINITE_HPP__
3 
4 // global include
7 #include <stan/agrad/rev/var.hpp>
9 
10 namespace stan {
11  namespace agrad {
12 
13  template <typename T_result, class Policy>
14  inline bool check_pos_definite(const char* function,
15  const Eigen::Matrix<var,Eigen::Dynamic,Eigen::Dynamic>& y,
16  const char* name,
17  T_result* result,
18  const Policy&) {
19  typedef
21  size_type;
22  Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> y_d(y.rows(),y.cols());
23  for (size_type i = 0; i < y_d.rows(); i++)
24  for (size_type j = 0; j < y_d.cols(); j++)
25  y_d(i,j) = y(i,j).val();
26  return stan::math::check_pos_definite(function,y_d,name,result,Policy());
27  }
28 
29  }
30 }
31 #endif

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