]> https://gitweb.dealii.org/ - dealii.git/commitdiff
There is no point in passing doubles by reference.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2005 17:04:43 +0000 (17:04 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2005 17:04:43 +0000 (17:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@10245 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/tensor.h
deal.II/base/include/base/tensor_base.h

index dec4268eb8d759509321a03291e4834d193b0ca6..ac72d4a9387862c8985fddc618f4ffd0dd726ece 100644 (file)
@@ -128,13 +128,13 @@ class Tensor
                                      *  i.e. multiply all components by
                                      *  <tt>factor</tt>.
                                      */
-    Tensor<rank_,dim> & operator *= (const double &factor);
+    Tensor<rank_,dim> & operator *= (const double factor);
 
                                     /**
                                      *  Scale the vector by
                                      *  <tt>1/factor</tt>.
                                      */
-    Tensor<rank_,dim> & operator /= (const double &factor);
+    Tensor<rank_,dim> & operator /= (const double factor);
 
                                     /**
                                      *  Add two tensors. If possible, you
@@ -333,7 +333,7 @@ Tensor<rank_,dim>::operator -= (const Tensor<rank_,dim> &p)
 template <int rank_, int dim>
 inline
 Tensor<rank_,dim> &
-Tensor<rank_,dim>::operator *= (const double &s)
+Tensor<rank_,dim>::operator *= (const double s)
 {
   for (unsigned int i=0; i<dim; ++i)
     subtensor[i] *= s;
@@ -344,7 +344,7 @@ Tensor<rank_,dim>::operator *= (const double &s)
 template <int rank_, int dim>
 inline
 Tensor<rank_,dim> &
-Tensor<rank_,dim>::operator /= (const double &s)
+Tensor<rank_,dim>::operator /= (const double s)
 {
   for (unsigned int i=0; i<dim; ++i)
     subtensor[i] /= s;
index de3535d9c711303075ce92639d36c8f98a0eb1d3..6133fbcb41d6d118a8057a8804baa8ab22a54838 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -175,12 +175,12 @@ class Tensor<1,dim>
                                      * <tt>factor</tt>, i.e. multiply all
                                      * coordinates by <tt>factor</tt>.
                                      */
-    Tensor<1,dim> & operator *= (const double &factor);
+    Tensor<1,dim> & operator *= (const double factor);
 
                                     /**
                                      * Scale the vector by <tt>1/factor</tt>.
                                      */
-    Tensor<1,dim> & operator /= (const double &factor);
+    Tensor<1,dim> & operator /= (const double factor);
 
                                     /**
                                      * Returns the scalar product of
@@ -520,7 +520,7 @@ Tensor<1,dim> & Tensor<1,dim>::operator -= (const Tensor<1,dim> &p)
 
 template <int dim>
 inline
-Tensor<1,dim> & Tensor<1,dim>::operator *= (const double &s)
+Tensor<1,dim> & Tensor<1,dim>::operator *= (const double s)
 {
   for (unsigned int i=0; i<dim; ++i)
     values[i] *= s;
@@ -531,7 +531,7 @@ Tensor<1,dim> & Tensor<1,dim>::operator *= (const double &s)
 
 template <int dim>
 inline
-Tensor<1,dim> & Tensor<1,dim>::operator /= (const double &s)
+Tensor<1,dim> & Tensor<1,dim>::operator /= (const double s)
 {
   for (unsigned int i=0; i<dim; ++i)
     values[i] /= s;

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.