]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Operators take a Tensor as second argument, avoids possible copy in casting
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2002 09:21:56 +0000 (09:21 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2002 09:21:56 +0000 (09:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@5569 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/point.h

index 0b6ee511037fc191fe94880a93dd12720afe5cb9..48464da4d88c927912522f50cbc0bb95d86049ad 100644 (file)
@@ -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<dim>   operator + (const Point<dim> &) const;
+    Point<dim>   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<dim>   operator - (const Point<dim> &) const;
+    Point<dim>   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<dim> &) const;
+    double       operator * (const Tensor<1,dim> &) const;
 
                                     /**
                                      *  Divide by a factor. If possible, use
@@ -240,7 +240,7 @@ double & Point<dim>::operator () (const unsigned int index)
 
 template <int dim>
 inline
-Point<dim> Point<dim>::operator + (const Point<dim> &p) const 
+Point<dim> Point<dim>::operator + (const Tensor<1,dim> &p) const 
 {
   return (Point<dim>(*this) += p);
 };
@@ -249,7 +249,7 @@ Point<dim> Point<dim>::operator + (const Point<dim> &p) const
 
 template <int dim>
 inline
-Point<dim> Point<dim>::operator - (const Point<dim> &p) const 
+Point<dim> Point<dim>::operator - (const Tensor<1,dim> &p) const 
 {
   return (Point<dim>(*this) -= p);
 };
@@ -279,7 +279,7 @@ Point<dim> Point<dim>::operator * (const double factor) const
 
 template <int dim>
 inline
-double Point<dim>::operator * (const Point<dim> &p) const 
+double Point<dim>::operator * (const Tensor<1,dim> &p) const 
 {
                                   // simply pass down
   return Tensor<1,dim>::operator * (p);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.