1 #ifndef STAN_MATH_PRIM_MAT_FUN_SQUARED_DISTANCE_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_SQUARED_DISTANCE_HPP 24 template <
int R,
int C>
26 const Eigen::Matrix<double, R, C>& v2) {
30 return (v1 - v2).squaredNorm();
47 template <
int R1,
int C1,
int R2,
int C2>
49 const Eigen::Matrix<double, R2, C2>& v2) {
53 return (v1.transpose() - v2).squaredNorm();
void check_vector(const char *function, const char *name, const Eigen::Matrix< T, R, C > &x)
Check if the matrix is either a row vector or column vector.
fvar< T > squared_distance(const Eigen::Matrix< fvar< T >, R, C > &v1, const Eigen::Matrix< double, R, C > &v2)
Returns the squared distance between the specified vectors of the same dimensions.
void check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Check if two structures at the same size.