From 5283fb1ec51132b5f7d65e5122d5f8c51aa063bd Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 18 Mar 2002 09:21:56 +0000 Subject: [PATCH] Operators take a Tensor as second argument, avoids possible copy in casting git-svn-id: https://svn.dealii.org/trunk@5569 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/point.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deal.II/base/include/base/point.h b/deal.II/base/include/base/point.h index 0b6ee51103..48464da4d8 100644 --- a/deal.II/base/include/base/point.h +++ b/deal.II/base/include/base/point.h @@ -104,14 +104,14 @@ class Point : public Tensor<1,dim> * @p{operator +=} instead since this does not * need to copy a point at least once. */ - Point operator + (const Point &) const; + Point operator + (const Tensor<1,dim> &) const; /** * Subtract two point vectors. If possible, use * @p{operator +=} instead since this does not * need to copy a point at least once. */ - Point operator - (const Point &) const; + Point operator - (const Tensor<1,dim> &) const; /** * The opposite vector. @@ -131,7 +131,7 @@ class Point : public Tensor<1,dim> /** * Returns the scalar product of two vectors. */ - double operator * (const Point &) const; + double operator * (const Tensor<1,dim> &) const; /** * Divide by a factor. If possible, use @@ -240,7 +240,7 @@ double & Point::operator () (const unsigned int index) template inline -Point Point::operator + (const Point &p) const +Point Point::operator + (const Tensor<1,dim> &p) const { return (Point(*this) += p); }; @@ -249,7 +249,7 @@ Point Point::operator + (const Point &p) const template inline -Point Point::operator - (const Point &p) const +Point Point::operator - (const Tensor<1,dim> &p) const { return (Point(*this) -= p); }; @@ -279,7 +279,7 @@ Point Point::operator * (const double factor) const template inline -double Point::operator * (const Point &p) const +double Point::operator * (const Tensor<1,dim> &p) const { // simply pass down return Tensor<1,dim>::operator * (p); -- 2.39.5