| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

rows_dot_self.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_FWD_MAT_FUN_ROWS_DOT_SELF_HPP
2 #define STAN_MATH_FWD_MAT_FUN_ROWS_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/fwd/core.hpp>
7 #include <stan/math/fwd/mat/fun/dot_self.hpp>
8 #include <vector>
9
10 namespace stan {
11 namespace math {
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
core.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::rows_dot_self
Eigen::Matrix< fvar< T >, R, 1 > rows_dot_self(const Eigen::Matrix< fvar< T >, R, C > &x)
Definition: rows_dot_self.hpp:15
stan::math::dot_self
fvar< T > dot_self(const Eigen::Matrix< fvar< T >, R, C > &v)
Definition: dot_self.hpp:16
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
Eigen.hpp
stan::math::fvar
Definition: fvar.hpp:13
typedefs.hpp

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