From: guido Date: Mon, 18 Mar 2002 09:21:56 +0000 (+0000) Subject: Operators take a Tensor as second argument, avoids possible copy in casting X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a0cd953f05ec4559f944b1c48cab294f0500629;p=dealii-svn.git 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 --- 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);