| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

dot_self.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_DOT_SELF_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_DOT_SELF_HPP
3
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stan/math/prim/mat/err/check_vector.hpp>
6
7 namespace stan {
8 namespace math {
9
17 template <int R, int C>
18 inline double dot_self(const Eigen::Matrix<double, R, C>& v) {
19 check_vector("dot_self", "v", v);
20 return v.squaredNorm();
21 }
22
23 }
24 }
25 #endif
stan::math::check_vector
bool check_vector(const char *function, const char *name, const Eigen::Matrix< T, R, C > &x)
Return true if the matrix is either a row vector or column vector.
Definition: check_vector.hpp:34
stan
Definition: log_sum_exp.hpp:8
stan::math::dot_self
fvar< T > dot_self(const Eigen::Matrix< fvar< T >, R, C > &v)
Definition: dot_self.hpp:16
Eigen.hpp
check_vector.hpp

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