]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Deprecate VECTOR::scale. Introduce VECTOR::operator/=
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 31 May 2003 20:43:24 +0000 (20:43 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 31 May 2003 20:43:24 +0000 (20:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@7703 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_vector.h
deal.II/lac/include/lac/vector.h

index 4d162d58397b7beec1476dd6b001391c1be5371e..2b5cdf9fadaceb4dbab5d6f7ab2a5b2de24c798f 100644 (file)
@@ -1090,24 +1090,31 @@ class BlockVector
               const Number c, const BlockVector<Number>& X);
     
                                     /**
-                                     * Scale each element of the vector by the
-                                     * given factor. This function was
-                                     * previously called @p{equ(Number)}, which
-                                     * in my eyes is an extremely unintuitive
-                                     * naming and was thus replaced.
+                                     * Scale each element of the
+                                     * vector by the given factor.
+                                     *
+                                     * This function is deprecated
+                                     * and will be removed in a
+                                     * future version. Use
+                                     * @p{operator *=} and
+                                     * @p{operator /=} instead.
                                      */
     void scale (const Number factor);
     
                                     /**
                                      * Scale each element of the
                                      * vector by a constant
-                                     * value. This operator is an
-                                     * alias to the @ref{scale}
-                                     * function, except that it
-                                     * returns a reference to itself.
+                                     * value.
                                      */
     BlockVector<Number> & operator *= (const Number factor);
 
+                                    /**
+                                     * Scale each element of the
+                                     * vector by the inverse of the
+                                     * given value.
+                                     */
+    BlockVector<Number> & operator /= (const Number factor);
+    
                                     /**
                                      * Multiply each element of this
                                      * vector by the corresponding
@@ -1298,7 +1305,8 @@ Number& BlockVector<Number>::operator() (const unsigned int i)
 
 template <typename Number>
 inline
-BlockVector<Number> & BlockVector<Number>::operator *= (const Number factor) 
+BlockVector<Number> &
+BlockVector<Number>::operator *= (const Number factor) 
 {
   scale (factor);
   return *this;
@@ -1306,6 +1314,17 @@ BlockVector<Number> & BlockVector<Number>::operator *= (const Number factor)
 
 
 
+template <typename Number>
+inline
+BlockVector<Number> &
+BlockVector<Number>::operator /= (const Number factor) 
+{
+  scale (1./factor);
+  return *this;
+}
+
+
+
 template <typename Number>
 inline
 Vector<Number> &
index 0b2f55df255131bc64436171e4d241e877ef14fc..057e390dd7b738b5b72aaf5f946f8ee7fe52531e 100644 (file)
@@ -399,18 +399,29 @@ class Vector
                                     /**
                                      * Scale each element of the
                                      * vector by the given factor.
+                                     *
+                                     * This function is deprecated
+                                     * and will be removed in a
+                                     * future version. Use
+                                     * @p{operator *=} and
+                                     * @p{operator /=} instead.
                                      */
     void scale (const Number factor);
 
+    
                                     /**
                                      * Scale each element of the
                                      * vector by a constant
-                                     * value. This operator is an
-                                     * alias to the @ref{scale}
-                                     * function, except that it
-                                     * returns a reference to itself.
+                                     * value.
                                      */
     Vector<Number> & operator *= (const Number factor);
+
+                                    /**
+                                     * Scale each element of the
+                                     * vector by the inverse of the
+                                     * given value.
+                                     */
+    Vector<Number> & operator /= (const Number factor);
     
                                     /**
                                      * Scale each element of this
@@ -739,6 +750,16 @@ Vector<Number> & Vector<Number>::operator *= (const Number factor)
 
 
 
+template <typename Number>
+inline
+Vector<Number> & Vector<Number>::operator /= (const Number factor) 
+{
+  scale (1./factor);
+  return *this;
+}
+
+
+
 
 template <typename Number>
 inline

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.