Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rows_dot_self.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__FWD__MATRIX__ROWS_DOT_SELF_HPP
2 #define STAN__AGRAD__FWD__MATRIX__ROWS_DOT_SELF_HPP
3 
4 #include <vector>
9 
10 namespace stan {
11  namespace agrad {
12 
13  template<typename T, int R,int C>
14  inline Eigen::Matrix<fvar<T>,R,1>
15  rows_dot_self(const Eigen::Matrix<fvar<T>,R,C>& x) {
16  Eigen::Matrix<fvar<T>,R,1> ret(x.rows(),1);
17  for (size_type i = 0; i < x.rows(); i++) {
18  Eigen::Matrix<fvar<T>,1,C> crow = x.row(i);
19  ret(i,0) = dot_self(crow);
20  }
21  return ret;
22  }
23  }
24 }
25 #endif
fvar< T > dot_self(const Eigen::Matrix< fvar< T >, R, C > &v)
Definition: dot_self.hpp:16
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Definition: typedefs.hpp:14
Eigen::Matrix< fvar< T >, R, 1 > rows_dot_self(const Eigen::Matrix< fvar< T >, R, C > &x)

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