Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
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 
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  stan::math::check_vector("dot_self", "v", v);
20  return v.squaredNorm();
21  }
22 
23  }
24 }
25 #endif
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.
fvar< T > dot_self(const Eigen::Matrix< fvar< T >, R, C > &v)
Definition: dot_self.hpp:16

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