From 44015398514b8895f6a9a8698b5fb4b240a13ec7 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 18 Jul 2002 12:36:50 +0000 Subject: [PATCH] ProductMatrix moved to matrix_lib.h git-svn-id: https://svn.dealii.org/trunk@6261 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/pointer_matrix.h | 131 ----------------------- 1 file changed, 131 deletions(-) diff --git a/deal.II/lac/include/lac/pointer_matrix.h b/deal.II/lac/include/lac/pointer_matrix.h index 2f95805ae0..5eddb1e271 100644 --- a/deal.II/lac/include/lac/pointer_matrix.h +++ b/deal.II/lac/include/lac/pointer_matrix.h @@ -121,71 +121,6 @@ private: }; -/** - * Poor man's matrix product. Stores two matrices $m_1$ and $m_2$ and - * implements matrix-vector multiplications for the product $m_1 m_2$ - * by performing multiplication with both factors consecutively. - * - * @author Guido Kanschat, 2000, 2001, 2002 - */ -template -class ProductMatrix : public PointerMatrixBase -{ - public: - /** - * Constructor. Additionally to - * the two constituting matrices, a - * memory pool for the auxiliary - * vector must be provided. - */ - ProductMatrix(const MATRIX1& m1, - const MATRIX2& m2, - VectorMemory& mem); - - /** - * Matrix-vector product. - */ - virtual void vmult (VECTOR& dst, - const VECTOR& src) const; - - /** - * Tranposed matrix-vector product. - */ - virtual void Tvmult (VECTOR& dst, - const VECTOR& src) const; - - /** - * Matrix-vector product, adding to - * @p{dst}. - */ - virtual void vmult_add (VECTOR& dst, - const VECTOR& src) const; - - /** - * Tranposed matrix-vector product, - * adding to @p{dst}. - */ - virtual void Tvmult_add (VECTOR& dst, - const VECTOR& src) const; - - private: - /** - * The left matrix of the product. - */ - SmartPointer m1; - - /** - * The right matrix of the product. - */ - SmartPointer m2; - - /** - * Memory for auxiliary vector. - */ - SmartPointer > mem; -}; - - //----------------------------------------------------------------------// template @@ -248,71 +183,5 @@ PointerMatrix::Tvmult_add (VECTOR& dst, } -//----------------------------------------------------------------------// - -template -ProductMatrix::ProductMatrix ( - const MATRIX1& mat1, - const MATRIX2& mat2, - VectorMemory& m) - : m1(&mat1), - m2(&mat2), - mem(&m) -{} - - -template -void -ProductMatrix::vmult (VECTOR& dst, - const VECTOR& src) const -{ - VECTOR* v = mem->alloc(); - v->reinit(dst); - m2->vmult (*v, src); - m1->vmult (dst, *v); - mem->free(v); -} - - -template -void -ProductMatrix::vmult_add (VECTOR& dst, - const VECTOR& src) const -{ - VECTOR* v = mem->alloc(); - v->reinit(dst); - m2->vmult (*v, src); - m1->vmult_add (dst, *v); - mem->free(v); -} - - -template -void -ProductMatrix::Tvmult ( - VECTOR& dst, - const VECTOR& src) const -{ - VECTOR* v = mem->alloc(); - v->reinit(dst); - m1->Tvmult (*v, src); - m2->Tvmult (dst, *v); - mem->free(v); -} - - -template -void -ProductMatrix::Tvmult_add ( - VECTOR& dst, - const VECTOR& src) const -{ - VECTOR* v = mem->alloc(); - v->reinit(dst); - m1->Tvmult (*v, src); - m2->Tvmult_add (dst, *v); - mem->free(v); -} - #endif -- 2.39.5