From d641b37b7a6e2b92405009e090708b10ccbb89bf Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 10 Jan 2003 11:01:05 +0000 Subject: [PATCH] base class replaced by member git-svn-id: https://svn.dealii.org/trunk@6906 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/multigrid/mg_matrix.h | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/mg_matrix.h b/deal.II/deal.II/include/multigrid/mg_matrix.h index 9606329ef9..2a626a458e 100644 --- a/deal.II/deal.II/include/multigrid/mg_matrix.h +++ b/deal.II/deal.II/include/multigrid/mg_matrix.h @@ -23,8 +23,7 @@ * @author Guido Kanschat, 2002 */ template -class MGMatrix : public MGMatrixBase, - public SmartPointer > +class MGMatrix : public MGMatrixBase { public: /** @@ -76,6 +75,12 @@ class MGMatrix : public MGMatrixBase, */ virtual void Tvmult_add(unsigned int level, VECTOR& dst, const VECTOR& src) const; + +private: + /** + * Pointer to the matrix objects on each level. + */ + SmartPointer > matrix; }; @@ -91,8 +96,7 @@ class MGMatrix : public MGMatrixBase, * @author Guido Kanschat, 2002 */ template -class MGMatrixSelect : public MGMatrixBase >, - public SmartPointer > +class MGMatrixSelect : public MGMatrixBase > { public: /** @@ -153,6 +157,10 @@ class MGMatrixSelect : public MGMatrixBase >, const Vector& src) const; private: + /** + * Pointer to the matrix objects on each level. + */ + SmartPointer > matrix; /** * Row coordinate of selected block. */ @@ -170,7 +178,7 @@ class MGMatrixSelect : public MGMatrixBase >, template MGMatrix::MGMatrix (MGLevelObject* p) : - SmartPointer > (p) + matrix (p) {} @@ -178,7 +186,7 @@ template void MGMatrix::set_matrix (MGLevelObject* p) { - (SmartPointer >) (*this) = p; + matrix = p; } @@ -188,10 +196,9 @@ MGMatrix::vmult (unsigned int level, VECTOR& dst, const VECTOR& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].vmult(dst, src); } @@ -202,10 +209,9 @@ MGMatrix::vmult_add (unsigned int level, VECTOR& dst, const VECTOR& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].vmult_add(dst, src); } @@ -216,10 +222,9 @@ MGMatrix::Tvmult (unsigned int level, VECTOR& dst, const VECTOR& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].Tvmult(dst, src); } @@ -230,10 +235,9 @@ MGMatrix::Tvmult_add (unsigned int level, VECTOR& dst, const VECTOR& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].Tvmult_add(dst, src); } @@ -245,8 +249,8 @@ MGMatrixSelect:: MGMatrixSelect (const unsigned int row, const unsigned int col, MGLevelObject* p) - : - SmartPointer > (p), + : + matrix (p), row(row), col(col) {} @@ -257,7 +261,7 @@ template void MGMatrixSelect::set_matrix (MGLevelObject* p) { - (SmartPointer >) (*this) = p; + matrix = p; } @@ -279,10 +283,9 @@ vmult (unsigned int level, Vector& dst, const Vector& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].block(row, col).vmult(dst, src); } @@ -294,10 +297,9 @@ vmult_add (unsigned int level, Vector& dst, const Vector& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].block(row, col).vmult_add(dst, src); } @@ -309,10 +311,9 @@ Tvmult (unsigned int level, Vector& dst, const Vector& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].block(row, col).Tvmult(dst, src); } @@ -324,10 +325,9 @@ Tvmult_add (unsigned int level, Vector& dst, const Vector& src) const { - Assert((SmartPointer >) *this != 0, - ExcNotInitialized()); + Assert(matrix != 0, ExcNotInitialized()); - const MGLevelObject& m = **this; + const MGLevelObject& m = *matrix; m[level].block(row, col).Tvmult_add(dst, src); } -- 2.39.5