Stan Math Library  2.8.0
reverse mode automatic differentiation
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
columns_dot_self.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_MAT_FUN_COLUMNS_DOT_SELF_HPP
2 #define STAN_MATH_REV_MAT_FUN_COLUMNS_DOT_SELF_HPP
3 
7 #include <stan/math/rev/core.hpp>
10 #include <vector>
11 
12 namespace stan {
13  namespace math {
14 
20  template<int R, int C>
21  inline Eigen::Matrix<var, 1, C>
22  columns_dot_self(const Eigen::Matrix<var, R, C>& x) {
23  Eigen::Matrix<var, 1, C> ret(1, x.cols());
24  for (size_type i = 0; i < x.cols(); i++) {
25  ret(i) = var(new dot_self_vari(x.col(i)));
26  }
27  return ret;
28  }
29 
30 
31  }
32 }
33 #endif
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:32
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Definition: typedefs.hpp:13
Eigen::Matrix< fvar< T >, 1, C > columns_dot_self(const Eigen::Matrix< fvar< T >, R, C > &x)

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