From: bangerth Date: Wed, 29 Sep 2010 20:34:34 +0000 (+0000) Subject: Move forward declarations to the top of the file. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b65dc0a66fd84d718e449b42cab4adc9023a79c6;p=dealii-svn.git Move forward declarations to the top of the file. git-svn-id: https://svn.dealii.org/trunk@22198 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/pointer_matrix.h b/deal.II/lac/include/lac/pointer_matrix.h index d398afb7c7..4e0be50952 100644 --- a/deal.II/lac/include/lac/pointer_matrix.h +++ b/deal.II/lac/include/lac/pointer_matrix.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -22,6 +22,17 @@ DEAL_II_NAMESPACE_OPEN template class VectorMemory; +class IdentityMatrix; +template class FullMatrix; +template class LAPACKFullMatrix; +template class SparseMatrix; +template class BlockSparseMatrix; +template class SparseMatrixEZ; +template class BlockSparseMatrixEZ; +template class BlockMatrixArray; +template class TridiagonalMatrix; + + /*! @addtogroup Matrix2 *@{ */ @@ -53,7 +64,7 @@ class PointerMatrixBase : public Subscriptor * BlockMatrixArray. */ typedef typename VECTOR::value_type value_type; - + /** * Virtual destructor. Does * nothing except making sure that @@ -67,63 +78,63 @@ class PointerMatrixBase : public Subscriptor * matrix pointed to. */ virtual void clear () = 0; - + /** * Find out if two matrices point * to the same object. */ bool operator == (const PointerMatrixBase&) const; - + /** * Find out if two matrices do * not point to the same object. */ bool operator != (const PointerMatrixBase&) const; - + /** * Find out if this pointer is * less. */ bool operator < (const PointerMatrixBase&) const; - + /** * Find out if this pointer is * less or equal. */ bool operator <= (const PointerMatrixBase&) const; - + /** * Find out if this pointer is * greater. */ bool operator > (const PointerMatrixBase&) const; - + /** * Find out if this pointer is * greater or equal. */ bool operator >= (const PointerMatrixBase&) const; - - + + /** * Matrix-vector product. */ virtual void vmult (VECTOR& dst, const VECTOR& src) const = 0; - + /** * Tranposed matrix-vector product. */ virtual void Tvmult (VECTOR& dst, const VECTOR& src) const = 0; - + /** * Matrix-vector product, adding to * dst. */ virtual void vmult_add (VECTOR& dst, const VECTOR& src) const = 0; - + /** * Tranposed matrix-vector product, * adding to dst. @@ -170,7 +181,7 @@ class PointerMatrix : public PointerMatrixBase * SmartPointer for this object. */ PointerMatrix(const char* name); - + /** * Constructor. M points * to a matrix which must live @@ -185,13 +196,13 @@ class PointerMatrix : public PointerMatrixBase // Use doc from base class virtual void clear(); - + /** * Return whether the object is - * empty. + * empty. */ bool empty () const; - + /** * Assign a new matrix * pointer. Deletes the old pointer @@ -199,33 +210,33 @@ class PointerMatrix : public PointerMatrixBase * @see SmartPointer */ const PointerMatrix& operator= (const MATRIX* M); - + /** * 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 * dst. */ virtual void vmult_add (VECTOR& dst, const VECTOR& src) const; - + /** * Tranposed matrix-vector product, * adding to dst. */ virtual void Tvmult_add (VECTOR& dst, const VECTOR& src) const; - + private: /** * Return the address of the @@ -300,10 +311,10 @@ class PointerMatrixAux : public PointerMatrixBase // Use doc from base class virtual void clear(); - + /** * Return whether the object is - * empty. + * empty. */ bool empty () const; @@ -313,7 +324,7 @@ class PointerMatrixAux : public PointerMatrixBase * vectors. */ void set_memory(VectorMemory* mem); - + /** * Assign a new matrix * pointer. Deletes the old pointer @@ -321,33 +332,33 @@ class PointerMatrixAux : public PointerMatrixBase * @see SmartPointer */ const PointerMatrixAux& operator= (const MATRIX* M); - + /** * 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 * dst. */ virtual void vmult_add (VECTOR& dst, const VECTOR& src) const; - + /** * Tranposed matrix-vector product, * adding to dst. */ virtual void Tvmult_add (VECTOR& dst, const VECTOR& src) const; - + private: /** * Return the address of the @@ -365,7 +376,7 @@ class PointerMatrixAux : public PointerMatrixBase * auxiliary vector. */ mutable SmartPointer,PointerMatrixAux > mem; - + /** * The pointer to the actual matrix. */ @@ -407,7 +418,7 @@ class PointerMatrixVector : public PointerMatrixBase > * SmartPointer for this object. */ PointerMatrixVector (const char* name); - + /** * Constructor. M points * to a matrix which must live @@ -422,13 +433,13 @@ class PointerMatrixVector : public PointerMatrixBase > // Use doc from base class virtual void clear(); - + /** * Return whether the object is - * empty. + * empty. */ bool empty () const; - + /** * Assign a new matrix * pointer. Deletes the old pointer @@ -436,7 +447,7 @@ class PointerMatrixVector : public PointerMatrixBase > * @see SmartPointer */ const PointerMatrixVector& operator= (const Vector* M); - + /** * Matrix-vector product, * actually the scalar product of @@ -451,7 +462,7 @@ class PointerMatrixVector : public PointerMatrixBase > */ virtual void vmult (Vector& dst, const Vector& src) const; - + /** * Tranposed matrix-vector * product, actually the @@ -467,7 +478,7 @@ class PointerMatrixVector : public PointerMatrixBase > */ virtual void Tvmult (Vector& dst, const Vector& src) const; - + /** * Matrix-vector product, adding to * dst. @@ -480,7 +491,7 @@ class PointerMatrixVector : public PointerMatrixBase > */ virtual void vmult_add (Vector& dst, const Vector& src) const; - + /** * Tranposed matrix-vector product, * adding to dst. @@ -493,7 +504,7 @@ class PointerMatrixVector : public PointerMatrixBase > */ virtual void Tvmult_add (Vector& dst, const Vector& src) const; - + private: /** * Return the address of the @@ -536,16 +547,6 @@ new_pointer_matrix_base(MATRIX& matrix, const VECTOR&, const char* name = "Point return new PointerMatrixAux(0, &matrix, name); } -class IdentityMatrix; -template class FullMatrix; -template class LAPACKFullMatrix; -template class SparseMatrix; -template class BlockSparseMatrix; -template class SparseMatrixEZ; -template class BlockSparseMatrixEZ; -template class BlockMatrixArray; -template class TridiagonalMatrix; - /** * Specialized version for IdentityMatrix. * @@ -677,7 +678,7 @@ new_pointer_matrix_base(const TridiagonalMatrix& matrix, const Vector -inline +inline PointerMatrixBase::~PointerMatrixBase () {} @@ -1037,7 +1038,7 @@ PointerMatrixVector::vmult ( { Assert (m != 0, ExcNotInitialized()); Assert (dst.size() == 1, ExcDimensionMismatch(dst.size(), 1)); - + dst(0) = *m * src; } @@ -1050,7 +1051,7 @@ PointerMatrixVector::Tvmult ( { Assert (m != 0, ExcNotInitialized()); Assert(src.size() == 1, ExcDimensionMismatch(src.size(), 1)); - + dst.equ (src(0), *m); } @@ -1063,7 +1064,7 @@ PointerMatrixVector::vmult_add ( { Assert (m != 0, ExcNotInitialized()); Assert (dst.size() == 1, ExcDimensionMismatch(dst.size(), 1)); - + dst(0) += *m * src; } @@ -1076,7 +1077,7 @@ PointerMatrixVector::Tvmult_add ( { Assert (m != 0, ExcNotInitialized()); Assert(src.size() == 1, ExcDimensionMismatch(src.size(), 1)); - + dst.add (src(0), *m); }