From 28723fd4d290c7631a4343b6db262b66a99ac9c8 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 9 Jan 2003 15:29:35 +0000 Subject: [PATCH] functions set_matrix added git-svn-id: https://svn.dealii.org/trunk@6897 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/multigrid/mg_matrix.h | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/multigrid/mg_matrix.h b/deal.II/deal.II/include/multigrid/mg_matrix.h index 16160b59ce..9606329ef9 100644 --- a/deal.II/deal.II/include/multigrid/mg_matrix.h +++ b/deal.II/deal.II/include/multigrid/mg_matrix.h @@ -30,10 +30,23 @@ class MGMatrix : public MGMatrixBase, /** * Constructor. The argument is * handed over to the - * @p{SmartPointer} constructor. + * @p{SmartPointer} + * constructor. The matrix object + * must exist longer as the + * @p{MGMatrix} object, since + * only a pointer is stored. */ MGMatrix (MGLevelObject* = 0); + /** + * Set the matrix object to be + * used. The matrix object must + * exist longer as the + * @p{MGMatrix} object, since + * only a pointer is stored. + */ + void set_matrix (MGLevelObject* M); + /** * Matrix-vector-multiplication on * a certain level. @@ -93,6 +106,15 @@ class MGMatrixSelect : public MGMatrixBase >, const unsigned int col = 0, MGLevelObject* = 0); + /** + * Set the matrix object to be + * used. The matrix object must + * exist longer as the + * @p{MGMatrix} object, since + * only a pointer is stored. + */ + void set_matrix (MGLevelObject* M); + /** * Select the block for * multiplication. @@ -152,6 +174,13 @@ MGMatrix::MGMatrix (MGLevelObject* p) {} +template +void +MGMatrix::set_matrix (MGLevelObject* p) +{ + (SmartPointer >) (*this) = p; +} + template void @@ -224,6 +253,14 @@ MGMatrixSelect (const unsigned int row, +template +void +MGMatrixSelect::set_matrix (MGLevelObject* p) +{ + (SmartPointer >) (*this) = p; +} + + template void MGMatrixSelect:: -- 2.39.5