From bca489384e1301b45e361b99cfd38c3d4f516c8d Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 11 Dec 2009 21:37:40 +0000 Subject: [PATCH] dot product --- cpp/Vector.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/Vector.h b/cpp/Vector.h index cd470feae..29899942c 100644 --- a/cpp/Vector.h +++ b/cpp/Vector.h @@ -142,6 +142,9 @@ Vector ediv(const Vector &a, const Vector &b); */ double sum(const Vector &a); +/** Dot product */ +inline double dot(const Vector &a, const Vector& b) { return sum(emul(a,b)); } + /** * house(x,j) computes HouseHolder vector v and scaling factor beta * from x, such that the corresponding Householder reflection zeroes out