]> https://gitweb.dealii.org/ - dealii.git/commitdiff
capitalize template arguments to avoid Vector - VECTOR clash
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 30 May 2003 10:41:42 +0000 (10:41 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 30 May 2003 10:41:42 +0000 (10:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@7686 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/filtered_matrix.h
deal.II/lac/include/lac/filtered_matrix.templates.h

index 42fc51cae4707df07d8d6abaa2c86b90c883a60a..61109da1b8f4f25c25fd2c01eefbc099cd8997f1 100644 (file)
@@ -188,7 +188,7 @@ template <typename number> class Vector;
  *
  * @author Wolfgang Bangerth 2001
  */
-template <class Matrix, class Vector=::Vector<typename Matrix::value_type> >
+template <class MATRIX, class VECTOR=Vector<typename MATRIX::value_type> >
 class FilteredMatrix : public Subscriptor
 {
   public:
@@ -197,7 +197,7 @@ class FilteredMatrix : public Subscriptor
                                      * analogy to the STL container
                                      * classes.
                                      */
-    typedef typename Matrix::value_type value_type;
+    typedef typename MATRIX::value_type value_type;
 
                                     /**
                                      * Typedef defining a type that
@@ -228,7 +228,7 @@ class FilteredMatrix : public Subscriptor
                                      * Constructor. Use the given
                                      * matrix for future operations.
                                      */
-    FilteredMatrix (const Matrix &matrix);
+    FilteredMatrix (const MATRIX &matrix);
 
                                     /**
                                      * Copy operator. Take over
@@ -245,14 +245,14 @@ class FilteredMatrix : public Subscriptor
                                      * function if constraits were
                                      * previously added.
                                      */
-    void set_referenced_matrix (const Matrix &m);
+    void set_referenced_matrix (const MATRIX &m);
     
                                     /**
                                      * Return a reference to the
                                      * matrix that is used by this
                                      * object.
                                      */
-    const Matrix & get_referenced_matrix () const;
+    const MATRIX & get_referenced_matrix () const;
 
                                     /**
                                      * Add a list of constraints to
@@ -308,7 +308,7 @@ class FilteredMatrix : public Subscriptor
                                      * parameter to @p{true} to use a
                                      * faster algorithm.
                                      */
-    void apply_constraints (Vector     &v,
+    void apply_constraints (VECTOR     &v,
                            const bool  matrix_is_symmetric) const;
 
                                     /**
@@ -334,8 +334,8 @@ class FilteredMatrix : public Subscriptor
                                      * matrix is the filtered one to
                                      * which we store a reference.)
                                      */
-    void vmult (Vector       &dst,
-               const Vector &src) const;
+    void vmult (VECTOR       &dst,
+               const VECTOR &src) const;
     
                                     /**
                                      * Matrix-vector multiplication:
@@ -354,8 +354,8 @@ class FilteredMatrix : public Subscriptor
                                      * function only works for square
                                      * matrices.
                                      */
-    void Tvmult (Vector       &dst,
-                const Vector &src) const;
+    void Tvmult (VECTOR       &dst,
+                const VECTOR &src) const;
   
                                     /**
                                      * Return the square of the norm
@@ -390,7 +390,7 @@ class FilteredMatrix : public Subscriptor
                                      * have eliminated Dirichlet
                                      * boundary values.
                                      */
-    value_type matrix_norm_square (const Vector &v) const;
+    value_type matrix_norm_square (const VECTOR &v) const;
 
                                     /**
                                      * Compute the residual of an
@@ -415,9 +415,9 @@ class FilteredMatrix : public Subscriptor
                                      * do not contribute to the
                                      * residual at all.
                                      */
-    value_type residual (Vector       &dst,
-                        const Vector &x,
-                        const Vector &b) const;
+    value_type residual (VECTOR       &dst,
+                        const VECTOR &x,
+                        const VECTOR &b) const;
     
                                     /**
                                      * Apply the Jacobi
@@ -429,8 +429,8 @@ class FilteredMatrix : public Subscriptor
                                      * multiplies the result with the
                                      * damping factor @p{omega}.
                                      */
-    void precondition_Jacobi (Vector           &dst,
-                             const Vector     &src,
+    void precondition_Jacobi (VECTOR           &dst,
+                             const VECTOR     &src,
                              const value_type  omega = 1.) const;
 
                                     /**
@@ -480,7 +480,7 @@ class FilteredMatrix : public Subscriptor
                                      * it using the @p{SmartPointer}
                                      * class.
                                      */
-    SmartPointer<const Matrix> matrix;
+    SmartPointer<const MATRIX> matrix;
 
                                     /**
                                      * Sorted list of pairs denoting
@@ -504,7 +504,7 @@ class FilteredMatrix : public Subscriptor
                                      * have to synchronise access to
                                      * this vector.
                                      */
-    mutable Vector tmp_vector;
+    mutable VECTOR tmp_vector;
 
                                     /**
                                      * Mutex used to synchronise use
@@ -518,7 +518,7 @@ class FilteredMatrix : public Subscriptor
                                      * that belong to constrained
                                      * degrees of freedom.
                                      */
-    void pre_filter (Vector &v) const;
+    void pre_filter (VECTOR &v) const;
 
                                     /**
                                      * Do the postfiltering step,
@@ -529,8 +529,8 @@ class FilteredMatrix : public Subscriptor
                                      * diagonal for these degrees of
                                      * freedom.
                                      */
-    void post_filter (const Vector &in,
-                     Vector       &out) const;
+    void post_filter (const VECTOR &in,
+                     VECTOR       &out) const;
 
                                     /**
                                      * Based on the size of the
@@ -557,7 +557,7 @@ class FilteredMatrix : public Subscriptor
                                      * algorithm.
                                      *
                                      * This function needs to be
-                                     * specialised for the different
+                                     * specialized for the different
                                      * matrix types.
                                      */
     void get_column_entries (const unsigned int           index,
@@ -569,10 +569,10 @@ class FilteredMatrix : public Subscriptor
 /*---------------------- Inline functions -----------------------------------*/
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 inline
 bool
-FilteredMatrix<Matrix,Vector>::PairComparison::
+FilteredMatrix<MATRIX,VECTOR>::PairComparison::
 operator () (const IndexValuePair &i1,
             const IndexValuePair &i2) const
 {
@@ -581,10 +581,10 @@ operator () (const IndexValuePair &i1,
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 template <class ConstraintList>
 void
-FilteredMatrix<Matrix,Vector>::
+FilteredMatrix<MATRIX,VECTOR>::
 add_constraints (const ConstraintList &new_constraints)
 {
                                   // add new constraints to end
@@ -603,28 +603,28 @@ add_constraints (const ConstraintList &new_constraints)
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 inline
-const Matrix &
-FilteredMatrix<Matrix,Vector>::get_referenced_matrix () const
+const MATRIX &
+FilteredMatrix<MATRIX,VECTOR>::get_referenced_matrix () const
 {
   return *matrix;
 }
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 inline
-unsigned int FilteredMatrix<Matrix,Vector>::m () const
+unsigned int FilteredMatrix<MATRIX,VECTOR>::m () const
 {
   return matrix->m();
 }
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 inline
-unsigned int FilteredMatrix<Matrix,Vector>::n () const
+unsigned int FilteredMatrix<MATRIX,VECTOR>::n () const
 {
   return matrix->n();
 }
index 5efb5924bec27b3b144137bd1e723858d25ba32b..fc85475dc3b9d141980d6ce5d64c79a608d19eb3 100644 (file)
@@ -1,4 +1,4 @@
-//----------------------------  filtered_matrix.templates.h  ---------------------------
+//----------------------------------------------------------------------------
 //    $Id$
 //    Version: $Name$
 //
@@ -9,7 +9,7 @@
 //    to the file deal.II/doc/license.html for the  text  and
 //    further information on this license.
 //
-//----------------------------  filtered_matrix.templates.h  ---------------------------
+//----------------------------------------------------------------------------
 #ifndef __deal2__filtered_matrix_templates_h
 #define __deal2__filtered_matrix_templates_h
 
 #include <lac/block_vector.h>
 
 
-template <class Matrix, class Vector>
-FilteredMatrix<Matrix,Vector>::
+template <class MATRIX, class VECTOR>
+FilteredMatrix<MATRIX,VECTOR>::
 FilteredMatrix () 
 {}
 
 
 
-template <class Matrix, class Vector>
-FilteredMatrix<Matrix,Vector>::
+template <class MATRIX, class VECTOR>
+FilteredMatrix<MATRIX,VECTOR>::
 FilteredMatrix (const FilteredMatrix &fm)
                :
                Subscriptor (),
@@ -42,18 +42,18 @@ FilteredMatrix (const FilteredMatrix &fm)
 
 
 
-template <class Matrix, class Vector>
-FilteredMatrix<Matrix,Vector>::
-FilteredMatrix (const Matrix &m)
+template <class MATRIX, class VECTOR>
+FilteredMatrix<MATRIX,VECTOR>::
+FilteredMatrix (const MATRIX &m)
 {
   set_referenced_matrix (m);
 }
 
 
 
-template <class Matrix, class Vector>
-FilteredMatrix<Matrix,Vector> &
-FilteredMatrix<Matrix,Vector>::operator = (const FilteredMatrix &fm)
+template <class MATRIX, class VECTOR>
+FilteredMatrix<MATRIX,VECTOR> &
+FilteredMatrix<MATRIX,VECTOR>::operator = (const FilteredMatrix &fm)
 {
   set_referenced_matrix (*fm.matrix);
   constraints = fm.constraints;
@@ -62,10 +62,10 @@ FilteredMatrix<Matrix,Vector>::operator = (const FilteredMatrix &fm)
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::
-set_referenced_matrix (const Matrix &m)
+FilteredMatrix<MATRIX,VECTOR>::
+set_referenced_matrix (const MATRIX &m)
 {
   matrix = &m;
   allocate_tmp_vector ();
@@ -73,9 +73,9 @@ set_referenced_matrix (const Matrix &m)
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::clear_constraints () 
+FilteredMatrix<MATRIX,VECTOR>::clear_constraints () 
 {
                                   // swap vectors to release memory
   std::vector<IndexValuePair> empty;
@@ -84,10 +84,10 @@ FilteredMatrix<Matrix,Vector>::clear_constraints ()
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::
-apply_constraints (Vector     &v,
+FilteredMatrix<MATRIX,VECTOR>::
+apply_constraints (VECTOR     &v,
                   const bool  matrix_is_symmetric) const
 {
                                   // array that will hold the pairs
@@ -141,9 +141,9 @@ apply_constraints (Vector     &v,
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::pre_filter (Vector &v) const
+FilteredMatrix<MATRIX,VECTOR>::pre_filter (VECTOR &v) const
 {
                                   // iterate over all constraints and
                                   // zero out value
@@ -155,10 +155,10 @@ FilteredMatrix<Matrix,Vector>::pre_filter (Vector &v) const
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::post_filter (const Vector &in,
-                                           Vector       &out) const
+FilteredMatrix<MATRIX,VECTOR>::post_filter (const VECTOR &in,
+                                           VECTOR       &out) const
 {
                                   // iterate over all constraints and
                                   // set value correctly
@@ -170,10 +170,10 @@ FilteredMatrix<Matrix,Vector>::post_filter (const Vector &in,
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::vmult (Vector       &dst,
-                                     const Vector &src) const
+FilteredMatrix<MATRIX,VECTOR>::vmult (VECTOR       &dst,
+                                     const VECTOR &src) const
 {
   tmp_mutex.acquire ();
                                   // first copy over src vector and
@@ -190,11 +190,11 @@ FilteredMatrix<Matrix,Vector>::vmult (Vector       &dst,
 
 
 
-template <class Matrix, class Vector>
-typename FilteredMatrix<Matrix,Vector>::value_type
-FilteredMatrix<Matrix,Vector>::residual (Vector       &dst,
-                                        const Vector &x,
-                                        const Vector &b) const
+template <class MATRIX, class VECTOR>
+typename FilteredMatrix<MATRIX,VECTOR>::value_type
+FilteredMatrix<MATRIX,VECTOR>::residual (VECTOR       &dst,
+                                        const VECTOR &x,
+                                        const VECTOR &b) const
 {
   tmp_mutex.acquire ();
                                   // first copy over x vector and
@@ -225,10 +225,10 @@ FilteredMatrix<Matrix,Vector>::residual (Vector       &dst,
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::Tvmult (Vector       &dst,
-                                      const Vector &src) const
+FilteredMatrix<MATRIX,VECTOR>::Tvmult (VECTOR       &dst,
+                                      const VECTOR &src) const
 {
   tmp_mutex.acquire ();
                                   // first copy over src vector and
@@ -245,9 +245,9 @@ FilteredMatrix<Matrix,Vector>::Tvmult (Vector       &dst,
 
   
 
-template <class Matrix, class Vector>
-typename FilteredMatrix<Matrix,Vector>::value_type
-FilteredMatrix<Matrix,Vector>::matrix_norm_square (const Vector &v) const
+template <class MATRIX, class VECTOR>
+typename FilteredMatrix<MATRIX,VECTOR>::value_type
+FilteredMatrix<MATRIX,VECTOR>::matrix_norm_square (const VECTOR &v) const
 {
   tmp_mutex.acquire ();
   tmp_vector = v;
@@ -267,11 +267,11 @@ FilteredMatrix<Matrix,Vector>::matrix_norm_square (const Vector &v) const
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 void
-FilteredMatrix<Matrix,Vector>::
-precondition_Jacobi (Vector           &dst,
-                    const Vector     &src,
+FilteredMatrix<MATRIX,VECTOR>::
+precondition_Jacobi (VECTOR           &dst,
+                    const VECTOR     &src,
                     const value_type  omega) const
 {
                                   // first precondition as usual,
@@ -292,9 +292,9 @@ precondition_Jacobi (Vector           &dst,
 
 
 
-template <class Matrix, class Vector>
+template <class MATRIX, class VECTOR>
 unsigned int
-FilteredMatrix<Matrix,Vector>::memory_consumption () const
+FilteredMatrix<MATRIX,VECTOR>::memory_consumption () const
 {
   return (MemoryConsumption::memory_consumption (matrix) +
          MemoryConsumption::memory_consumption (constraints) +

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.