From 55518843abc34d0bbed654e5af5364a6c5faa997 Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 22 Jan 2008 22:21:37 +0000 Subject: [PATCH] Make the destructor of the class abstract to ensure that one can't try to instantiate an object of this type -- which currently is possible, but because this class is meant to be a base class isn't particularly useful. Improve documentation. git-svn-id: https://svn.dealii.org/trunk@15638 0785d39b-7218-0410-832d-ea1e28bc413d --- .../lac/include/lac/sparse_decomposition.h | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_decomposition.h b/deal.II/lac/include/lac/sparse_decomposition.h index 230cc7a27d..47564231b8 100644 --- a/deal.II/lac/include/lac/sparse_decomposition.h +++ b/deal.II/lac/include/lac/sparse_decomposition.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors // by the deal.II authors and Stephen "Cheffo" Kolaroff // // This file is subject to QPL and may not be distributed @@ -27,11 +27,16 @@ DEAL_II_NAMESPACE_OPEN /** * Abstract base class for sparse LU decompositions of a sparse matrix - * into another sparse matrix. + * into another sparse matrix. This class can't be used by itself, but + * only as the base class of derived classes that actually implement + * particular decompositions such as SparseILU or SparseMIC. * * The decomposition is stored as a sparse matrix which is why this * class is derived from the SparseMatrix. Since it is not a matrix in - * the usual sense, the derivation is protected rather than public. + * the usual sense (the stored entries are not those of a matrix, but + * of two different matrix factors), the derivation is + * protected rather than public. + * * *

Fill-in

* @@ -47,15 +52,18 @@ DEAL_II_NAMESPACE_OPEN * copy-constructor of the SparsityPattern class which allows the addition * of side-diagonals to a given sparsity structure. * + * *

Unified use of preconditioners

* - * An object of this class can be used in the same form as all - * PreconditionBlock preconditioners: + * While objects of this class can not be used directly (this class is + * only a base class for others implementing actual decompositions), + * derived classes such as SparseILU and SparseMIC can be used in the + * usual form as preconditioners. For example, this works: * @code - * SparseLUDecomposition lu; - * lu.initialize(matrix, SparseLUDecomposition::AdditionalData(...)); + * SparseILU ilu; + * ilu.initialize(matrix, SparseILU::AdditionalData(...)); * - * somesolver.solve (A, x, f, lu); + * somesolver.solve (A, x, f, ilu); * @endcode * * Through the AdditionalData object it is possible to specify @@ -89,7 +97,7 @@ DEAL_II_NAMESPACE_OPEN * The state management simply requires the initialize() function to * be called before the object is used as preconditioner. * - * Obsolete: + * Obsolete: * In order to prevent users from applying decompositions before the * decomposition itself has been built, and to introduce some * optimization of common "sparse idioms", this class introduces a @@ -150,9 +158,17 @@ class SparseLUDecomposition : protected SparseMatrix, SparseLUDecomposition (const SparsityPattern& sparsity); /** - * Destruction. + * Destruction. Mark the + * destructor pure to ensure that + * this class isn't used + * directly, but only its derived + * classes. */ - virtual ~SparseLUDecomposition (); + virtual ~SparseLUDecomposition () +#ifndef DEAL_II_IMPLEMENTED_PURE_FUNCTION_BUG + = 0 +#endif + ; /** * Deletes all member -- 2.39.5