| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stan/math/prim/mat/fun/typedefs.hpp>
6 #include <stan/math/prim/mat/err/check_vector.hpp>
7 #include <stan/math/rev/core.hpp>
8 #include <stan/math/rev/mat/fun/typedefs.hpp>
9 #include <stan/math/rev/mat/fun/dot_self.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
core.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::var
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:31
stan::math::size_type
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
dot_self.hpp
typedefs.hpp
Eigen.hpp
check_vector.hpp
stan::math::columns_dot_self
Eigen::Matrix< fvar< T >, 1, C > columns_dot_self(const Eigen::Matrix< fvar< T >, R, C > &x)
Definition: columns_dot_self.hpp:15
typedefs.hpp

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