1 #ifndef STAN_MATH_FWD_MAT_FUN_SQUARED_DISTANCE_HPP 2 #define STAN_MATH_FWD_MAT_FUN_SQUARED_DISTANCE_HPP 28 template<
typename T,
int R,
int C>
31 const Eigen::Matrix<double, R, C>& v2) {
35 Eigen::Matrix<fvar<T>, R, C> v3 =
subtract(v1, v2);
54 template<
typename T,
int R1,
int C1,
int R2,
int C2>
57 const Eigen::Matrix<double, R2, C2>& v2) {
61 Eigen::Matrix<double, R1, C1> t_v2 = v2.transpose();
62 Eigen::Matrix<fvar<T>, R1, C1> v3 =
subtract(v1, t_v2);
79 template<
typename T,
int R,
int C>
82 const Eigen::Matrix<
fvar<T>, R, C>& v2) {
86 Eigen::Matrix<fvar<T>, R, C> v3 =
subtract(v1, v2);
105 template<
typename T,
int R1,
int C1,
int R2,
int C2>
108 const Eigen::Matrix<
fvar<T>, R2, C2>& v2) {
112 Eigen::Matrix<double, R2, C2> t_v1 = v1.transpose();
113 Eigen::Matrix<fvar<T>, R2, C2> v3 =
subtract(t_v1, v2);
129 template<
typename T,
int R,
int C>
132 const Eigen::Matrix<
fvar<T>, R, C>& v2) {
136 Eigen::Matrix<fvar<T>, R, C> v3 =
subtract(v1, v2);
155 template<
typename T,
int R1,
int C1,
int R2,
int C2>
158 const Eigen::Matrix<
fvar<T>, R2, C2>& v2) {
162 Eigen::Matrix<fvar<T>, R2, C2> t_v1 = v1.transpose();
163 Eigen::Matrix<fvar<T>, R2, C2> v3 =
subtract(t_v1, v2);
Eigen::Matrix< typename boost::math::tools::promote_args< T1, T2 >::type, R, C > subtract(const Eigen::Matrix< T1, R, C > &m1, const Eigen::Matrix< T2, R, C > &m2)
Return the result of subtracting the second specified matrix from the first specified matrix...
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 > dot_self(const Eigen::Matrix< fvar< T >, R, C > &v)
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.