From: Matthias Maier Date: Thu, 6 Apr 2017 20:36:50 +0000 (-0500) Subject: C++ cleanup: Remove deprecated class ProductSparseMatrix X-Git-Tag: v9.0.0-rc1~1724^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9431408def20932c79c48a4ba850a23480f336d2;p=dealii.git C++ cleanup: Remove deprecated class ProductSparseMatrix --- diff --git a/include/deal.II/lac/matrix_lib.h b/include/deal.II/lac/matrix_lib.h index 0ae8ac96a3..3527d048e1 100644 --- a/include/deal.II/lac/matrix_lib.h +++ b/include/deal.II/lac/matrix_lib.h @@ -212,102 +212,6 @@ private: }; - -/** - * Poor man's matrix product of two sparse matrices. Stores two matrices #m1 - * and #m2 of arbitrary type SparseMatrix and implements matrix-vector - * multiplications for the product M1M2 by - * performing multiplication with both factors consecutively. - * - * The documentation of ProductMatrix applies with exception that these - * matrices here may be rectangular. - * - * @deprecated If deal.II was configured with C++11 support, use the - * LinearOperator class instead, see the module on - * @ref LAOperators "linear operators" - * for further details. - * - * @author Guido Kanschat, 2000, 2001, 2002, 2005 - */ -template -class ProductSparseMatrix : public PointerMatrixBase > -{ -public: - /** - * Define the type of matrices used. - */ - typedef SparseMatrix MatrixType; - - /** - * Define the type of vectors we plly this matrix to. - */ - typedef Vector VectorType; - - /** - * Constructor. Additionally to the two constituting matrices, a memory - * pool for the auxiliary vector must be provided. - */ - ProductSparseMatrix (const MatrixType &m1, - const MatrixType &m2, - VectorMemory &mem); - - /** - * Constructor leaving an uninitialized matrix. initialize() must be called, - * before the matrix can be used. - */ - ProductSparseMatrix(); - - void initialize (const MatrixType &m1, - const MatrixType &m2, - VectorMemory &mem); - - // Doc in PointerMatrixBase - void clear(); - - /** - * Matrix-vector product w = m1 * m2 * v. - */ - virtual void vmult (VectorType &w, - const VectorType &v) const; - - /** - * Transposed matrix-vector product w = m2T * m1T * - * v. - */ - virtual void Tvmult (VectorType &w, - const VectorType &v) const; - - /** - * Adding matrix-vector product w += m1 * m2 * v - */ - virtual void vmult_add (VectorType &w, - const VectorType &v) const; - - /** - * Adding, transposed matrix-vector product w += m2T * - * m1T * v. - */ - virtual void Tvmult_add (VectorType &w, - const VectorType &v) const; - -private: - /** - * The left matrix of the product. - */ - SmartPointer > m1; - - /** - * The right matrix of the product. - */ - SmartPointer > m2; - - /** - * Memory for auxiliary vector. - */ - SmartPointer,ProductSparseMatrix > mem; -}; - - /** * Mean value filter. The vmult() functions of this matrix filter out mean * values of the vector. If the vector is of type BlockVector, then an diff --git a/source/lac/matrix_lib.cc b/source/lac/matrix_lib.cc index b8ea151670..05573f78df 100644 --- a/source/lac/matrix_lib.cc +++ b/source/lac/matrix_lib.cc @@ -23,122 +23,6 @@ MeanValueFilter::MeanValueFilter(size_type component) component(component) {} - -template -ProductSparseMatrix::ProductSparseMatrix( - const MatrixType &mat1, - const MatrixType &mat2, - VectorMemory &mem) - : - m1(&mat1, typeid(*this).name()), - m2(&mat2, typeid(*this).name()), - mem(&mem, typeid(*this).name()) -{ - Assert(mat1.n() == mat2.m(), ExcDimensionMismatch(mat1.n(),mat2.m())); -} - - -template -ProductSparseMatrix::ProductSparseMatrix() - : - m1(0, typeid(*this).name()), - m2(0, typeid(*this).name()), - mem(0, typeid(*this).name()) -{} - - -template -void -ProductSparseMatrix::initialize( - const MatrixType &mat1, - const MatrixType &mat2, - VectorMemory &memory) -{ - Assert(mat1.n() == mat2.m(), ExcDimensionMismatch(mat1.n(),mat2.m())); - mem = &memory; - m1 = &mat1; - m2 = &mat2; -} - - -template -void -ProductSparseMatrix::clear() -{ - m1 = 0; - m2 = 0; -} - - -template -void -ProductSparseMatrix::vmult (VectorType &dst, const VectorType &src) const -{ - Assert(mem != 0, ExcNotInitialized()); - Assert(m1 != 0, ExcNotInitialized()); - Assert(m2 != 0, ExcNotInitialized()); - - VectorType *v = mem->alloc(); - v->reinit(m1->n()); - m2->vmult (*v, src); - m1->vmult (dst, *v); - mem->free(v); -} - - -template -void -ProductSparseMatrix::vmult_add (VectorType &dst, const VectorType &src) const -{ - Assert(mem != 0, ExcNotInitialized()); - Assert(m1 != 0, ExcNotInitialized()); - Assert(m2 != 0, ExcNotInitialized()); - - VectorType *v = mem->alloc(); - v->reinit(m1->n()); - m2->vmult (*v, src); - m1->vmult_add (dst, *v); - mem->free(v); -} - - -template -void -ProductSparseMatrix::Tvmult (VectorType &dst, const VectorType &src) const -{ - Assert(mem != 0, ExcNotInitialized()); - Assert(m1 != 0, ExcNotInitialized()); - Assert(m2 != 0, ExcNotInitialized()); - - VectorType *v = mem->alloc(); - v->reinit(m1->n()); - m1->Tvmult (*v, src); - m2->Tvmult (dst, *v); - mem->free(v); -} - - -template -void -ProductSparseMatrix::Tvmult_add (VectorType &dst, const VectorType &src) const -{ - Assert(mem != 0, ExcNotInitialized()); - Assert(m1 != 0, ExcNotInitialized()); - Assert(m2 != 0, ExcNotInitialized()); - - VectorType *v = mem->alloc(); - v->reinit(m1->n()); - m1->Tvmult (*v, src); - m2->Tvmult_add (dst, *v); - mem->free(v); -} - - -template class ProductSparseMatrix; -template class ProductSparseMatrix; -template class ProductSparseMatrix; -template class ProductSparseMatrix; - template void MeanValueFilter::filter(Vector &) const; template void MeanValueFilter::filter(Vector &) const; template void MeanValueFilter::filter(BlockVector &) const;