From 793d5ef67349a19b3a0a32519f591f04b9b787e9 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 14 Feb 2003 16:35:26 +0000 Subject: [PATCH] Move some parts of accessor implementations into namespace internal. Shouldn't be a problem for applications since they shouldn't use these classes directly, but removes these cluttering classes from the class index in the doc. git-svn-id: https://svn.dealii.org/trunk@7084 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/table.h | 1067 +++++----- deal.II/doc/news/2002/c-3-4.html | 21 + deal.II/lac/include/lac/block_vector.h | 1814 +++++++++-------- .../lac/include/lac/block_vector.templates.h | 200 +- deal.II/lac/source/block_vector.cc | 16 +- 5 files changed, 1579 insertions(+), 1539 deletions(-) diff --git a/deal.II/base/include/base/table.h b/deal.II/base/include/base/table.h index 977213dc36..144c404d69 100644 --- a/deal.II/base/include/base/table.h +++ b/deal.II/base/include/base/table.h @@ -33,7 +33,6 @@ template class Table<6,T>; - /** * Base class for an array of indices of fixed size used for the * @ref{TableBase} class. Actually, this class serves a dual purpose, @@ -42,22 +41,22 @@ template class Table<6,T>; * * @author Wolfgang Bangerth, 2002 */ -template -class TableIndicesBase -{ - public: - /** - * Access the value of the - * @p{i}th index. - */ - unsigned int operator[] (const unsigned int i) const; + template + class TableIndicesBase + { + public: + /** + * Access the value of the + * @p{i}th index. + */ + unsigned int operator[] (const unsigned int i) const; - protected: - /** - * Store the indices in an array. - */ - unsigned indices[N]; -}; + protected: + /** + * Store the indices in an array. + */ + unsigned indices[N]; + }; /** @@ -74,9 +73,10 @@ class TableIndicesBase * * @author Wolfgang Bangerth, 2002 */ -template -class TableIndices -{}; + template + class TableIndices + { + }; @@ -92,22 +92,22 @@ class TableIndices * * @author Wolfgang Bangerth, 2002 */ -template <> -class TableIndices<1> : public TableIndicesBase<1> -{ - public: - /** - * Default constructor. Set all - * indices to zero. - */ - TableIndices (); + template <> + class TableIndices<1> : public TableIndicesBase<1> + { + public: + /** + * Default constructor. Set all + * indices to zero. + */ + TableIndices (); - /** - * Constructor. Set indices to - * the given values. - */ - TableIndices (const unsigned int index1); -}; + /** + * Constructor. Set indices to + * the given values. + */ + TableIndices (const unsigned int index1); + }; @@ -122,23 +122,23 @@ class TableIndices<1> : public TableIndicesBase<1> * * @author Wolfgang Bangerth, 2002 */ -template <> -class TableIndices<2> : public TableIndicesBase<2> -{ - public: - /** - * Default constructor. Set all - * indices to zero. - */ - TableIndices (); + template <> + class TableIndices<2> : public TableIndicesBase<2> + { + public: + /** + * Default constructor. Set all + * indices to zero. + */ + TableIndices (); - /** - * Constructor. Set indices to - * the given values. - */ - TableIndices (const unsigned int index1, - const unsigned int index2); -}; + /** + * Constructor. Set indices to + * the given values. + */ + TableIndices (const unsigned int index1, + const unsigned int index2); + }; @@ -153,24 +153,24 @@ class TableIndices<2> : public TableIndicesBase<2> * * @author Wolfgang Bangerth, 2002 */ -template <> -class TableIndices<3> : public TableIndicesBase<3> -{ - public: - /** - * Default constructor. Set all - * indices to zero. - */ - TableIndices (); + template <> + class TableIndices<3> : public TableIndicesBase<3> + { + public: + /** + * Default constructor. Set all + * indices to zero. + */ + TableIndices (); - /** - * Constructor. Set indices to - * the given values. - */ - TableIndices (const unsigned int index1, - const unsigned int index2, - const unsigned int index3); -}; + /** + * Constructor. Set indices to + * the given values. + */ + TableIndices (const unsigned int index1, + const unsigned int index2, + const unsigned int index3); + }; /** @@ -184,25 +184,25 @@ class TableIndices<3> : public TableIndicesBase<3> * * @author Wolfgang Bangerth, Ralf Hartmann 2002 */ -template <> -class TableIndices<4> : public TableIndicesBase<4> -{ - public: - /** - * Default constructor. Set all - * indices to zero. - */ - TableIndices (); + template <> + class TableIndices<4> : public TableIndicesBase<4> + { + public: + /** + * Default constructor. Set all + * indices to zero. + */ + TableIndices (); - /** - * Constructor. Set indices to - * the given values. - */ - TableIndices (const unsigned int index1, - const unsigned int index2, - const unsigned int index3, - const unsigned int index4); -}; + /** + * Constructor. Set indices to + * the given values. + */ + TableIndices (const unsigned int index1, + const unsigned int index2, + const unsigned int index3, + const unsigned int index4); + }; /** @@ -216,26 +216,26 @@ class TableIndices<4> : public TableIndicesBase<4> * * @author Wolfgang Bangerth, Ralf Hartmann 2002 */ -template <> -class TableIndices<5> : public TableIndicesBase<5> -{ - public: - /** - * Default constructor. Set all - * indices to zero. - */ - TableIndices (); + template <> + class TableIndices<5> : public TableIndicesBase<5> + { + public: + /** + * Default constructor. Set all + * indices to zero. + */ + TableIndices (); - /** - * Constructor. Set indices to - * the given values. - */ - TableIndices (const unsigned int index1, - const unsigned int index2, - const unsigned int index3, - const unsigned int index4, - const unsigned int index5); -}; + /** + * Constructor. Set indices to + * the given values. + */ + TableIndices (const unsigned int index1, + const unsigned int index2, + const unsigned int index3, + const unsigned int index4, + const unsigned int index5); + }; /** @@ -249,28 +249,31 @@ class TableIndices<5> : public TableIndicesBase<5> * * @author Wolfgang Bangerth, Ralf Hartmann 2002 */ -template <> -class TableIndices<6> : public TableIndicesBase<6> -{ - public: - /** - * Default constructor. Set all - * indices to zero. - */ - TableIndices (); + template <> + class TableIndices<6> : public TableIndicesBase<6> + { + public: + /** + * Default constructor. Set all + * indices to zero. + */ + TableIndices (); + + /** + * Constructor. Set indices to + * the given values. + */ + TableIndices (const unsigned int index1, + const unsigned int index2, + const unsigned int index3, + const unsigned int index4, + const unsigned int index5, + const unsigned int index6); + }; - /** - * Constructor. Set indices to - * the given values. - */ - TableIndices (const unsigned int index1, - const unsigned int index2, - const unsigned int index3, - const unsigned int index4, - const unsigned int index5, - const unsigned int index6); -}; +namespace internal +{ /** * Have a namespace in which we declare some classes that are used to @@ -289,8 +292,8 @@ class TableIndices<6> : public TableIndicesBase<6> * * @author Wolfgang Bangerth, 2002 */ -namespace TableBaseAccessors -{ + namespace TableBaseAccessors + { /** * Have a class which declares some nested typedefs, depending on its * template parameters. The general template declares nothing, but @@ -298,31 +301,31 @@ namespace TableBaseAccessors * indicating constness of the table for which accessor objects are to * be generated in this namespace. */ - template - class Types - {}; + template + class Types + {}; /** * Have a class which declares some nested typedefs, depending on its * template parameters. Specialization for accessors to constant * objects. */ - template struct Types - { - typedef const T value_type; - typedef const TableBase TableType; - }; + template struct Types + { + typedef const T value_type; + typedef const TableBase TableType; + }; /** * Have a class which declares some nested typedefs, depending on its * template parameters. Specialization for accessors to non-constant * objects. */ - template struct Types - { - typedef T value_type; - typedef TableBase TableType; - }; + template struct Types + { + typedef T value_type; + typedef TableBase TableType; + }; /** @@ -363,104 +366,104 @@ namespace TableBaseAccessors * * @author Wolfgang Bangerth, 2002 */ - template - class Accessor - { - public: - /** - * Import two typedefs from the - * switch class above. - */ - typedef typename Types::value_type * pointer; - typedef typename Types::TableType TableType; - - private: - /** - * Constructor. Take a pointer - * to the table object to know - * about the sizes of the - * various dimensions, and a - * pointer to the subset of - * data we may access. - * - * The constructor is made - * private in order to prevent - * you having such objects - * around. The only way to - * create such objects is via - * the @p{Table} class, which - * only generates them as - * temporary objects. This - * guarantees that the accessor - * objects go out of scope - * earlier than the mother - * object, avoid problems with - * data consistency. - */ - Accessor (const TableType &table, - const pointer data); - - /** - * Default constructor. Not - * needed, and invisible, so - * private. - */ - Accessor (); - /** - * Copy constructor. Not - * needed, and invisible, so - * private. - */ - Accessor (const Accessor &a); - - public: + template + class Accessor + { + public: + /** + * Import two typedefs from the + * switch class above. + */ + typedef typename Types::value_type * pointer; + typedef typename Types::TableType TableType; + + private: + /** + * Constructor. Take a pointer + * to the table object to know + * about the sizes of the + * various dimensions, and a + * pointer to the subset of + * data we may access. + * + * The constructor is made + * private in order to prevent + * you having such objects + * around. The only way to + * create such objects is via + * the @p{Table} class, which + * only generates them as + * temporary objects. This + * guarantees that the accessor + * objects go out of scope + * earlier than the mother + * object, avoid problems with + * data consistency. + */ + Accessor (const TableType &table, + const pointer data); + + /** + * Default constructor. Not + * needed, and invisible, so + * private. + */ + Accessor (); + /** + * Copy constructor. Not + * needed, and invisible, so + * private. + */ + Accessor (const Accessor &a); + + public: - /** - * Index operator. Performs a - * range check. - */ - Accessor operator [] (const unsigned int i) const; - - /** - * Exception for range - * check. Do not use global - * exception since this way we - * can output which index is - * the wrong one. - */ - DeclException3 (ExcIndexRange, int, int, int, - << "The " << N-P+1 << "th index has a value of " - << arg1 << " but needs to be in the range [" - << arg2 << "," << arg3 << "["); - private: - /** - * Store the data given to the - * constructor. There are no - * non-const member functions - * of this class, so there is - * no reason not to make these - * elements constant. - */ - const TableType &table; - const pointer data; - - // declare some other classes - // as friends. make sure to - // work around bugs in some - // compilers + /** + * Index operator. Performs a + * range check. + */ + Accessor operator [] (const unsigned int i) const; + + /** + * Exception for range + * check. Do not use global + * exception since this way we + * can output which index is + * the wrong one. + */ + DeclException3 (ExcIndexRange, int, int, int, + << "The " << N-P+1 << "th index has a value of " + << arg1 << " but needs to be in the range [" + << arg2 << "," << arg3 << "["); + private: + /** + * Store the data given to the + * constructor. There are no + * non-const member functions + * of this class, so there is + * no reason not to make these + * elements constant. + */ + const TableType &table; + const pointer data; + + // declare some other classes + // as friends. make sure to + // work around bugs in some + // compilers #ifndef DEAL_II_NAMESP_TEMPL_FRIEND_BUG - template friend class Table; - template - friend class Accessor; + template friend class Table; + template + friend class Accessor; # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG - friend class Table; - friend class Accessor; + friend class Table; + friend class Accessor; # endif #else - friend class Table; - friend class Accessor; + friend class Table; + friend class Accessor; #endif - }; + }; @@ -473,150 +476,151 @@ namespace TableBaseAccessors * * @author Wolfgang Bangerth, 2002 */ - template - class Accessor - { - public: - /** - * Typedef constant and - * non-constant iterator - * types to the elements of - * this row, as well as all - * the other types usually - * required for the standard - * library algorithms. - */ - typedef typename Types::value_type value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type* iterator; - typedef const value_type* const_iterator; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - - /** - * Import a typedef from the - * switch class above. - */ - typedef typename Types::TableType TableType; - - private: + template + class Accessor + { + public: + /** + * Typedef constant and + * non-constant iterator + * types to the elements of + * this row, as well as all + * the other types usually + * required for the standard + * library algorithms. + */ + typedef typename Types::value_type value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type* iterator; + typedef const value_type* const_iterator; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + + /** + * Import a typedef from the + * switch class above. + */ + typedef typename Types::TableType TableType; + + private: - /** - * Constructor. Take a pointer - * to the table object to know - * about the sizes of the - * various dimensions, and a - * pointer to the subset of - * data we may access (which in - * this particular case is only - * one row). - * - * The constructor is made - * private in order to prevent - * you having such objects - * around. The only way to - * create such objects is via - * the @p{Table} class, which - * only generates them as - * temporary objects. This - * guarantees that the accessor - * objects go out of scope - * earlier than the mother - * object, avoid problems with - * data consistency. - */ - Accessor (const TableType &table, - const pointer data); - - /** - * Default constructor. Not - * needed, and invisible, so - * private. - */ - Accessor (); - - /** - * Copy constructor. Not - * needed, and invisible, so - * private. - */ - Accessor (const Accessor &a); - - public: + /** + * Constructor. Take a pointer + * to the table object to know + * about the sizes of the + * various dimensions, and a + * pointer to the subset of + * data we may access (which in + * this particular case is only + * one row). + * + * The constructor is made + * private in order to prevent + * you having such objects + * around. The only way to + * create such objects is via + * the @p{Table} class, which + * only generates them as + * temporary objects. This + * guarantees that the accessor + * objects go out of scope + * earlier than the mother + * object, avoid problems with + * data consistency. + */ + Accessor (const TableType &table, + const pointer data); + + /** + * Default constructor. Not + * needed, and invisible, so + * private. + */ + Accessor (); + + /** + * Copy constructor. Not + * needed, and invisible, so + * private. + */ + Accessor (const Accessor &a); + + public: - /** - * Index operator. Performs a - * range check. - */ - reference operator [] (const unsigned int) const; + /** + * Index operator. Performs a + * range check. + */ + reference operator [] (const unsigned int) const; - /** - * Return the length of one row, - * i.e. the number of elements - * corresponding to the last - * index of the table object. - */ - unsigned int size () const; + /** + * Return the length of one row, + * i.e. the number of elements + * corresponding to the last + * index of the table object. + */ + unsigned int size () const; - /** - * Return an iterator to the - * first element of this - * row. - */ - iterator begin () const; + /** + * Return an iterator to the + * first element of this + * row. + */ + iterator begin () const; - /** - * Return an interator to the - * element past the end of - * this row. - */ - iterator end () const; + /** + * Return an interator to the + * element past the end of + * this row. + */ + iterator end () const; - /** - * Exception for range - * check. Do not use global - * exception since this way we - * can output which index is - * the wrong one. - */ - DeclException3 (ExcIndexRange, int, int, int, - << "The " << N << "th index has a value of " - << arg1 << " but needs to be in the range [" - << arg2 << "," << arg3 << "["); - private: - /** - * Store the data given to the - * constructor. There are no - * non-const member functions - * of this class, so there is - * no reason not to make these - * elements constant. - */ - const TableType &table; - const pointer data; - - // declare some other classes - // as friends. make sure to - // work around bugs in some - // compilers + /** + * Exception for range + * check. Do not use global + * exception since this way we + * can output which index is + * the wrong one. + */ + DeclException3 (ExcIndexRange, int, int, int, + << "The " << N << "th index has a value of " + << arg1 << " but needs to be in the range [" + << arg2 << "," << arg3 << "["); + private: + /** + * Store the data given to the + * constructor. There are no + * non-const member functions + * of this class, so there is + * no reason not to make these + * elements constant. + */ + const TableType &table; + const pointer data; + + // declare some other classes + // as friends. make sure to + // work around bugs in some + // compilers #ifndef DEAL_II_NAMESP_TEMPL_FRIEND_BUG - template friend class Table; - template - friend class Accessor; + template friend class Table; + template + friend class Accessor; # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG - friend class Table<2,T>; - friend class Accessor; + friend class Table<2,T>; + friend class Accessor; # endif #else - friend class Table<2,T>; - friend class Accessor; + friend class Table<2,T>; + friend class Accessor; #endif - }; -} + }; + } +} // namespace internal @@ -1071,7 +1075,7 @@ class Table<2,T> : public TableBase<2,T> * This version of the function * only allows read access. */ - TableBaseAccessors::Accessor<2,T,true,1> + internal::TableBaseAccessors::Accessor<2,T,true,1> operator [] (const unsigned int i) const; /** @@ -1084,7 +1088,7 @@ class Table<2,T> : public TableBase<2,T> * This version of the function * allows read-write access. */ - TableBaseAccessors::Accessor<2,T,false,1> + internal::TableBaseAccessors::Accessor<2,T,false,1> operator [] (const unsigned int i); /** @@ -1217,7 +1221,7 @@ class Table<3,T> : public TableBase<3,T> * This version of the function * only allows read access. */ - TableBaseAccessors::Accessor<3,T,true,2> + internal::TableBaseAccessors::Accessor<3,T,true,2> operator [] (const unsigned int i) const; /** @@ -1231,7 +1235,7 @@ class Table<3,T> : public TableBase<3,T> * This version of the function * allows read-write access. */ - TableBaseAccessors::Accessor<3,T,false,2> + internal::TableBaseAccessors::Accessor<3,T,false,2> operator [] (const unsigned int i); /** @@ -1304,7 +1308,7 @@ class Table<4,T> : public TableBase<4,T> * This version of the function * only allows read access. */ - TableBaseAccessors::Accessor<4,T,true,3> + internal::TableBaseAccessors::Accessor<4,T,true,3> operator [] (const unsigned int i) const; /** @@ -1318,7 +1322,7 @@ class Table<4,T> : public TableBase<4,T> * This version of the function * allows read-write access. */ - TableBaseAccessors::Accessor<4,T,false,3> + internal::TableBaseAccessors::Accessor<4,T,false,3> operator [] (const unsigned int i); /** @@ -1394,7 +1398,7 @@ class Table<5,T> : public TableBase<5,T> * This version of the function * only allows read access. */ - TableBaseAccessors::Accessor<5,T,true,4> + internal::TableBaseAccessors::Accessor<5,T,true,4> operator [] (const unsigned int i) const; /** @@ -1408,7 +1412,7 @@ class Table<5,T> : public TableBase<5,T> * This version of the function * allows read-write access. */ - TableBaseAccessors::Accessor<5,T,false,4> + internal::TableBaseAccessors::Accessor<5,T,false,4> operator [] (const unsigned int i); /** @@ -1487,7 +1491,7 @@ class Table<6,T> : public TableBase<6,T> * This version of the function * only allows read access. */ - TableBaseAccessors::Accessor<6,T,true,5> + internal::TableBaseAccessors::Accessor<6,T,true,5> operator [] (const unsigned int i) const; /** @@ -1501,7 +1505,7 @@ class Table<6,T> : public TableBase<6,T> * This version of the function * allows read-write access. */ - TableBaseAccessors::Accessor<6,T,false,5> + internal::TableBaseAccessors::Accessor<6,T,false,5> operator [] (const unsigned int i); /** @@ -1730,156 +1734,159 @@ TableBase::TableBase (const TableBase &src) -namespace TableBaseAccessors +namespace internal { - template - inline - Accessor::Accessor (const TableType &table, - const pointer data) - : - table (table), - data (data) - {} - - - - template - inline - Accessor::Accessor (const Accessor &) - : - table (*static_cast(0)), - data (0) + namespace TableBaseAccessors { - // accessor objects are only - // temporary objects, so should - // not need to be copied around - Assert (false, ExcInternalError()); - } + template + inline + Accessor::Accessor (const TableType &table, + const pointer data) + : + table (table), + data (data) + {} + + + + template + inline + Accessor::Accessor (const Accessor &) + : + table (*static_cast(0)), + data (0) + { + // accessor objects are only + // temporary objects, so should + // not need to be copied around + Assert (false, ExcInternalError()); + } - template - inline - Accessor::Accessor () - : - table (*static_cast(0)), - data (0) - { - // accessor objects are only - // temporary objects, so should - // not need to be copied around - Assert (false, ExcInternalError()); - } + template + inline + Accessor::Accessor () + : + table (*static_cast(0)), + data (0) + { + // accessor objects are only + // temporary objects, so should + // not need to be copied around + Assert (false, ExcInternalError()); + } - template - inline - Accessor - Accessor::operator [] (const unsigned int i) const - { - Assert (i < table.size()[N-P], - ExcIndexRange (i, 0, table.size()[N-P])); - - // access i-th - // subobject. optimize on the - // case i==0 - if (i==0) - return Accessor (table, data); - else - { - // note: P>1, otherwise the - // specialization would have - // been taken! - unsigned int subobject_size = table.size()[N-1]; - for (int p=P-1; p>1; --p) - subobject_size *= table.size()[N-p]; - const pointer new_data = data + i*subobject_size; - return Accessor (table, new_data); - }; - } - - - - template - inline - Accessor::Accessor (const TableType &table, - const pointer data) - : - table (table), - data (data) - {} - - - - template - inline - Accessor::Accessor () - : - table (*static_cast(0)), - data (0) - { - // accessor objects are only - // temporary objects, so should - // not need to be copied around - Assert (false, ExcInternalError()); - } + template + inline + Accessor + Accessor::operator [] (const unsigned int i) const + { + Assert (i < table.size()[N-P], + ExcIndexRange (i, 0, table.size()[N-P])); + + // access i-th + // subobject. optimize on the + // case i==0 + if (i==0) + return Accessor (table, data); + else + { + // note: P>1, otherwise the + // specialization would have + // been taken! + unsigned int subobject_size = table.size()[N-1]; + for (int p=P-1; p>1; --p) + subobject_size *= table.size()[N-p]; + const pointer new_data = data + i*subobject_size; + return Accessor (table, new_data); + }; + } + + + + template + inline + Accessor::Accessor (const TableType &table, + const pointer data) + : + table (table), + data (data) + {} + + + + template + inline + Accessor::Accessor () + : + table (*static_cast(0)), + data (0) + { + // accessor objects are only + // temporary objects, so should + // not need to be copied around + Assert (false, ExcInternalError()); + } - template - inline - Accessor::Accessor (const Accessor &) - : - table (*static_cast(0)), - data (0) - { - // accessor objects are only - // temporary objects, so should - // not need to be copied around - Assert (false, ExcInternalError()); - } + template + inline + Accessor::Accessor (const Accessor &) + : + table (*static_cast(0)), + data (0) + { + // accessor objects are only + // temporary objects, so should + // not need to be copied around + Assert (false, ExcInternalError()); + } - template - inline - typename Accessor::reference - Accessor::operator [] (const unsigned int i) const - { - Assert (i < table.size()[N-1], - ExcIndexRange (i, 0, table.size()[N-1])); - return data[i]; - } + template + inline + typename Accessor::reference + Accessor::operator [] (const unsigned int i) const + { + Assert (i < table.size()[N-1], + ExcIndexRange (i, 0, table.size()[N-1])); + return data[i]; + } - template - inline - unsigned int - Accessor::size () const - { - return table.size()[N-1]; - } + template + inline + unsigned int + Accessor::size () const + { + return table.size()[N-1]; + } - template - inline - typename Accessor::iterator - Accessor::begin () const - { - return data; - } + template + inline + typename Accessor::iterator + Accessor::begin () const + { + return data; + } - template - inline - typename Accessor::iterator - Accessor::end () const - { - return data+table.size()[N-1]; + template + inline + typename Accessor::iterator + Accessor::end () const + { + return data+table.size()[N-1]; + } } } @@ -2204,26 +2211,26 @@ Table<2,T>::reinit (const unsigned int size1, template inline -TableBaseAccessors::Accessor<2,T,true,1> +internal::TableBaseAccessors::Accessor<2,T,true,1> Table<2,T>::operator [] (const unsigned int i) const { Assert (i < this->table_size[0], ExcIndexRange (i, 0, this->table_size[0])); - return TableBaseAccessors::Accessor<2,T,true,1>(*this, - this->val+i*n_cols()); + return internal::TableBaseAccessors::Accessor<2,T,true,1>(*this, + this->val+i*n_cols()); } template inline -TableBaseAccessors::Accessor<2,T,false,1> +internal::TableBaseAccessors::Accessor<2,T,false,1> Table<2,T>::operator [] (const unsigned int i) { Assert (i < this->table_size[0], ExcIndexRange (i, 0, this->table_size[0])); - return TableBaseAccessors::Accessor<2,T,false,1>(*this, - this->val+i*n_cols()); + return internal::TableBaseAccessors::Accessor<2,T,false,1>(*this, + this->val+i*n_cols()); } @@ -2320,14 +2327,14 @@ Table<3,T>::Table (const unsigned int size1, template inline -TableBaseAccessors::Accessor<3,T,true,2> +internal::TableBaseAccessors::Accessor<3,T,true,2> Table<3,T>::operator [] (const unsigned int i) const { Assert (i < this->table_size[0], ExcIndexRange (i, 0, this->table_size[0])); const unsigned int subobject_size = this->table_size[1] * this->table_size[2]; - return (TableBaseAccessors::Accessor<3,T,true,2> + return (internal::TableBaseAccessors::Accessor<3,T,true,2> (*this, this->val+i*subobject_size)); } @@ -2336,14 +2343,14 @@ Table<3,T>::operator [] (const unsigned int i) const template inline -TableBaseAccessors::Accessor<3,T,false,2> +internal::TableBaseAccessors::Accessor<3,T,false,2> Table<3,T>::operator [] (const unsigned int i) { Assert (i < this->table_size[0], ExcIndexRange (i, 0, this->table_size[0])); const unsigned int subobject_size = this->table_size[1] * this->table_size[2]; - return (TableBaseAccessors::Accessor<3,T,false,2> + return (internal::TableBaseAccessors::Accessor<3,T,false,2> (*this, this->val+i*subobject_size)); } @@ -2364,7 +2371,7 @@ Table<3,T>::operator () (const unsigned int i, Assert (k < this->table_size[2], ExcIndexRange (k, 0, this->table_size[2])); return this->val[(i*this->table_size[1]+j) - *this->table_size[2] + k]; + *this->table_size[2] + k]; } @@ -2383,7 +2390,7 @@ Table<3,T>::operator () (const unsigned int i, Assert (k < this->table_size[2], ExcIndexRange (k, 0, this->table_size[2])); return this->val[(i*this->table_size[1]+j) - *this->table_size[2] + k]; + *this->table_size[2] + k]; } @@ -2407,7 +2414,7 @@ Table<4,T>::Table (const unsigned int size1, template inline -TableBaseAccessors::Accessor<4,T,true,3> +internal::TableBaseAccessors::Accessor<4,T,true,3> Table<4,T>::operator [] (const unsigned int i) const { Assert (i < this->table_size[0], @@ -2415,7 +2422,7 @@ Table<4,T>::operator [] (const unsigned int i) const const unsigned int subobject_size = this->table_size[1] * this->table_size[2] * this->table_size[3]; - return (TableBaseAccessors::Accessor<4,T,true,3> + return (internal::TableBaseAccessors::Accessor<4,T,true,3> (*this, this->val+i*subobject_size)); } @@ -2424,7 +2431,7 @@ Table<4,T>::operator [] (const unsigned int i) const template inline -TableBaseAccessors::Accessor<4,T,false,3> +internal::TableBaseAccessors::Accessor<4,T,false,3> Table<4,T>::operator [] (const unsigned int i) { Assert (i < this->table_size[0], @@ -2432,7 +2439,7 @@ Table<4,T>::operator [] (const unsigned int i) const unsigned int subobject_size = this->table_size[1] * this->table_size[2] * this->table_size[3]; - return (TableBaseAccessors::Accessor<4,T,false,3> + return (internal::TableBaseAccessors::Accessor<4,T,false,3> (*this, this->val+i*subobject_size)); } @@ -2457,7 +2464,7 @@ Table<4,T>::operator () (const unsigned int i, ExcIndexRange (l, 0, this->table_size[3])); return this->val[((i*this->table_size[1]+j) *this->table_size[2] + k) - *this->table_size[3] + l]; + *this->table_size[3] + l]; } @@ -2480,7 +2487,7 @@ Table<4,T>::operator () (const unsigned int i, ExcIndexRange (l, 0, this->table_size[3])); return this->val[((i*this->table_size[1]+j) *this->table_size[2] + k) - *this->table_size[3] + l]; + *this->table_size[3] + l]; } @@ -2506,7 +2513,7 @@ Table<5,T>::Table (const unsigned int size1, template inline -TableBaseAccessors::Accessor<5,T,true,4> +internal::TableBaseAccessors::Accessor<5,T,true,4> Table<5,T>::operator [] (const unsigned int i) const { Assert (i < this->table_size[0], @@ -2515,7 +2522,7 @@ Table<5,T>::operator [] (const unsigned int i) const this->table_size[2] * this->table_size[3] * this->table_size[4]; - return (TableBaseAccessors::Accessor<5,T,true,4> + return (internal::TableBaseAccessors::Accessor<5,T,true,4> (*this, this->val+i*subobject_size)); } @@ -2524,7 +2531,7 @@ Table<5,T>::operator [] (const unsigned int i) const template inline -TableBaseAccessors::Accessor<5,T,false,4> +internal::TableBaseAccessors::Accessor<5,T,false,4> Table<5,T>::operator [] (const unsigned int i) { Assert (i < this->table_size[0], @@ -2533,7 +2540,7 @@ Table<5,T>::operator [] (const unsigned int i) this->table_size[2] * this->table_size[3] * this->table_size[4]; - return (TableBaseAccessors::Accessor<5,T,false,4> + return (internal::TableBaseAccessors::Accessor<5,T,false,4> (*this, this->val+i*subobject_size)); } @@ -2562,7 +2569,7 @@ Table<5,T>::operator () (const unsigned int i, return this->val[(((i*this->table_size[1]+j) *this->table_size[2] + k) *this->table_size[3] + l) - *this->table_size[4] + m]; + *this->table_size[4] + m]; } @@ -2589,7 +2596,7 @@ Table<5,T>::operator () (const unsigned int i, return this->val[(((i*this->table_size[1]+j) *this->table_size[2] + k) *this->table_size[3] + l) - *this->table_size[4] + m]; + *this->table_size[4] + m]; } @@ -2615,7 +2622,7 @@ Table<6,T>::Table (const unsigned int size1, template inline -TableBaseAccessors::Accessor<6,T,true,5> +internal::TableBaseAccessors::Accessor<6,T,true,5> Table<6,T>::operator [] (const unsigned int i) const { Assert (i < this->table_size[0], @@ -2625,7 +2632,7 @@ Table<6,T>::operator [] (const unsigned int i) const this->table_size[3] * this->table_size[4] * this->table_size[5]; - return (TableBaseAccessors::Accessor<6,T,true,5> + return (internal::TableBaseAccessors::Accessor<6,T,true,5> (*this, this->val+i*subobject_size)); } @@ -2634,7 +2641,7 @@ Table<6,T>::operator [] (const unsigned int i) const template inline -TableBaseAccessors::Accessor<6,T,false,5> +internal::TableBaseAccessors::Accessor<6,T,false,5> Table<6,T>::operator [] (const unsigned int i) { Assert (i < this->table_size[0], @@ -2644,7 +2651,7 @@ Table<6,T>::operator [] (const unsigned int i) this->table_size[3] * this->table_size[4] * this->table_size[5]; - return (TableBaseAccessors::Accessor<6,T,false,5> + return (internal::TableBaseAccessors::Accessor<6,T,false,5> (*this, this->val+i*subobject_size)); } @@ -2677,7 +2684,7 @@ Table<6,T>::operator () (const unsigned int i, *this->table_size[2] + k) *this->table_size[3] + l) *this->table_size[4] + m) - *this->table_size[5] + n]; + *this->table_size[5] + n]; } @@ -2708,7 +2715,7 @@ Table<6,T>::operator () (const unsigned int i, *this->table_size[2] + k) *this->table_size[3] + l) *this->table_size[4] + m) - *this->table_size[5] + n]; + *this->table_size[5] + n]; } diff --git a/deal.II/doc/news/2002/c-3-4.html b/deal.II/doc/news/2002/c-3-4.html index 1fd8503309..1a1bcb4e73 100644 --- a/deal.II/doc/news/2002/c-3-4.html +++ b/deal.II/doc/news/2002/c-3-4.html @@ -300,6 +300,17 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

base

    +
  1. + Changed: The Table accessor classes + have been moved to a namespace internal. Since these classes are not (or should + not be) used directly in applications, this should not change + compatibility. However, they will now no longer show up in the class + overview of the documentation, which they were cluttering up. +
    + (WB 2003/02/13) +

    +
  2. New: The Function class now has an assignment operator. This way, you can put function objects into @@ -543,6 +554,16 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

    lac

      +
    1. + Changed: The BlockVector accessor classes + have been moved to a namespace internal. Since these classes are not (or should + not be) used directly in applications, this should not change + compatibility. However, they will now no longer show up in the class + overview of the documentation, which they were cluttering up. +
      + (WB 2003/02/13) +

    2. New: The SolverGMRES now accepts an AdditionalData parameter diff --git a/deal.II/lac/include/lac/block_vector.h b/deal.II/lac/include/lac/block_vector.h index 5c9cab6be6..4d162d5839 100644 --- a/deal.II/lac/include/lac/block_vector.h +++ b/deal.II/lac/include/lac/block_vector.h @@ -28,567 +28,569 @@ template class BlockVector; +namespace internal +{ + /** * Namespace in which iterators in block vectors are implemented. * * @author Wolfgang Bangerth, 2001 */ -namespace BlockVectorIterators -{ - /** - * Declaration of the general - * template of a structure which is - * used to determine some types - * based on the template arguments - * of other classes. - */ - template - struct Types + namespace BlockVectorIterators { - }; + /** + * Declaration of the general + * template of a structure which is + * used to determine some types + * based on the template arguments + * of other classes. + */ + template + struct Types + { + }; - /** - * Declaration of a specialized - * template of a structure which is - * used to determine some types - * based on the template arguments - * of other classes. - * - * This is for the use of non-const - * iterators. - */ - template - struct Types - { - /** - * Type of the vector - * underlying the block vector - * used in non-const - * iterators. There, the - * vector must not be constant. - */ - typedef ::Vector Vector; - - /** - * Type of the block vector - * used in non-const - * iterators. There, the block - * vector must not be constant. - */ - typedef ::BlockVector BlockVector; - - /** - * Type of the numbers we point - * to. Here, they are not - * constant. - */ - typedef number NumberType; - }; + /** + * Declaration of a specialized + * template of a structure which is + * used to determine some types + * based on the template arguments + * of other classes. + * + * This is for the use of non-const + * iterators. + */ + template + struct Types + { + /** + * Type of the vector + * underlying the block vector + * used in non-const + * iterators. There, the + * vector must not be constant. + */ + typedef ::Vector Vector; + + /** + * Type of the block vector + * used in non-const + * iterators. There, the block + * vector must not be constant. + */ + typedef ::BlockVector BlockVector; + + /** + * Type of the numbers we point + * to. Here, they are not + * constant. + */ + typedef number NumberType; + }; - /** - * Declaration of a specialized - * template of a structure which is - * used to determine some types - * based on the template arguments - * of other classes. - * - * This is for the use of - * @p{const_iterator}s. - */ - template - struct Types - { - /** - * Type of the vector - * underlying the block vector - * used in - * @p{const_iterators}. There, - * the vector must be - * constant. - */ - typedef const ::Vector Vector; - - /** - * Type of the block vector - * used in - * @p{const_iterator}s. There, - * the block vector must be - * constant. - */ - typedef const ::BlockVector BlockVector; - - /** - * Type of the numbers we point - * to. Here, they are constant - * since the block vector we - * use is constant. - */ - typedef const number NumberType; - }; - - - /** - * General random-access iterator - * class for block vectors. Since - * we do not want to have two - * classes for non-const - * @p{iterator}s and - * @p{const_iterator}s, we take a - * second template argument which - * denotes whether the vector we - * point into is a constant object - * or not. The first template - * argument is always the number - * type of the block vector in use. - * - * This class satisfies all - * requirements of random access - * iterators defined in the C++ - * standard. Operations on these - * iterators are constant in the - * number of elements in the block - * vector. However, they are - * sometimes linear in the number - * of blocks in the vector, but - * since that does rarely change - * dynamically within an - * application, this is a constant - * and we again have that the - * iterator satisfies the - * requirements of a random access - * iterator. - * - * The implementation of this class - * has to work around some problems - * in compilers and standard - * libraries. One of these requires - * us to write all comparison - * operators twice, once comparison - * with iterators of the same type - * and once with iterators pointing - * to numbers of opposite constness - * specification. The reason is - * that if we would have written - * the comparison operators as a - * template on the constness of the - * right hand side, then gcc2.95 - * signals an error that these - * operators ambiguate operators - * declared somewhere within the - * standard library. Likewise, we - * have to work around some - * problems with granting other - * iterators friendship. This makes - * the implementation somewhat - * non-optimal at places, but at - * least everything works. - * - * @author Wolfgang Bangerth, 2001 - */ - template - class Iterator : + /** + * Declaration of a specialized + * template of a structure which is + * used to determine some types + * based on the template arguments + * of other classes. + * + * This is for the use of + * @p{const_iterator}s. + */ + template + struct Types + { + /** + * Type of the vector + * underlying the block vector + * used in + * @p{const_iterators}. There, + * the vector must be + * constant. + */ + typedef const ::Vector Vector; + + /** + * Type of the block vector + * used in + * @p{const_iterator}s. There, + * the block vector must be + * constant. + */ + typedef const ::BlockVector BlockVector; + + /** + * Type of the numbers we point + * to. Here, they are constant + * since the block vector we + * use is constant. + */ + typedef const number NumberType; + }; + + + /** + * General random-access iterator + * class for block vectors. Since + * we do not want to have two + * classes for non-const + * @p{iterator}s and + * @p{const_iterator}s, we take a + * second template argument which + * denotes whether the vector we + * point into is a constant object + * or not. The first template + * argument is always the number + * type of the block vector in use. + * + * This class satisfies all + * requirements of random access + * iterators defined in the C++ + * standard. Operations on these + * iterators are constant in the + * number of elements in the block + * vector. However, they are + * sometimes linear in the number + * of blocks in the vector, but + * since that does rarely change + * dynamically within an + * application, this is a constant + * and we again have that the + * iterator satisfies the + * requirements of a random access + * iterator. + * + * The implementation of this class + * has to work around some problems + * in compilers and standard + * libraries. One of these requires + * us to write all comparison + * operators twice, once comparison + * with iterators of the same type + * and once with iterators pointing + * to numbers of opposite constness + * specification. The reason is + * that if we would have written + * the comparison operators as a + * template on the constness of the + * right hand side, then gcc2.95 + * signals an error that these + * operators ambiguate operators + * declared somewhere within the + * standard library. Likewise, we + * have to work around some + * problems with granting other + * iterators friendship. This makes + * the implementation somewhat + * non-optimal at places, but at + * least everything works. + * + * @author Wolfgang Bangerth, 2001 + */ + template + class Iterator : #ifdef HAVE_STD_ITERATOR_CLASS - public std::iterator::NumberType> + public std::iterator::NumberType> #else - random_access_iterator::NumberType,int> + random_access_iterator::NumberType,int> #endif - { - private: - /** - * Typedef an iterator with - * opposite constness - * requirements on the elements - * it points to. - */ - typedef Iterator InverseConstnessIterator; - - public: - /** - * Declare some typedefs which - * are standard for iterators - * and are used by algorithms - * to enquire about the - * specifics of the iterators - * they work on. - */ - typedef std::random_access_iterator_tag iterator_type; - typedef typename Types::NumberType value_type; - typedef ptrdiff_t difference_type; - typedef value_type &reference; - typedef value_type *pointer; + { + private: + /** + * Typedef an iterator with + * opposite constness + * requirements on the elements + * it points to. + */ + typedef Iterator InverseConstnessIterator; + + public: + /** + * Declare some typedefs which + * are standard for iterators + * and are used by algorithms + * to enquire about the + * specifics of the iterators + * they work on. + */ + typedef std::random_access_iterator_tag iterator_type; + typedef typename Types::NumberType value_type; + typedef ptrdiff_t difference_type; + typedef value_type &reference; + typedef value_type *pointer; - /** - * Typedef the type of the - * block vector (which differs - * in constness, depending on - * the second template - * parameter). - */ - typedef typename Types::BlockVector BlockVectorType; - - /** - * Type of the number this - * iterator points - * to. Depending on the value - * of the second template - * parameter, this is either a - * constant or non-const - * number. - */ - typedef typename Types::NumberType NumberType; + /** + * Typedef the type of the + * block vector (which differs + * in constness, depending on + * the second template + * parameter). + */ + typedef typename Types::BlockVector BlockVectorType; + + /** + * Type of the number this + * iterator points + * to. Depending on the value + * of the second template + * parameter, this is either a + * constant or non-const + * number. + */ + typedef typename Types::NumberType NumberType; - /** - * Construct an iterator from - * a vector to which we point - * and the global index of - * the element pointed to. - * - * Depending on the value of - * the @p{constness} template - * argument of this class, - * the first argument of this - * constructor is either is a - * @p{const} or non-@p{const} - * reference. - */ - Iterator (BlockVectorType &parent, - const unsigned int global_index); + /** + * Construct an iterator from + * a vector to which we point + * and the global index of + * the element pointed to. + * + * Depending on the value of + * the @p{constness} template + * argument of this class, + * the first argument of this + * constructor is either is a + * @p{const} or non-@p{const} + * reference. + */ + Iterator (BlockVectorType &parent, + const unsigned int global_index); - /** - * Copy constructor. - */ - Iterator (const Iterator &c); - - /** - * Copy constructor for - * conversion between iterators - * with different constness - * requirements. This - * constructor throws an error - * if an attempt is made at - * converting a constant to a - * non-constant iterator. - */ - Iterator (const InverseConstnessIterator &c); - - private: - /** - * Constructor used internally - * in this class. The arguments - * match exactly the values of - * the respective member - * variables. - */ - Iterator (BlockVectorType &parent, - const unsigned int global_index, - const unsigned int current_block, - const unsigned int index_within_block, - const unsigned int next_break_forward, - const unsigned int next_break_backward); + /** + * Copy constructor. + */ + Iterator (const Iterator &c); + + /** + * Copy constructor for + * conversion between iterators + * with different constness + * requirements. This + * constructor throws an error + * if an attempt is made at + * converting a constant to a + * non-constant iterator. + */ + Iterator (const InverseConstnessIterator &c); + + private: + /** + * Constructor used internally + * in this class. The arguments + * match exactly the values of + * the respective member + * variables. + */ + Iterator (BlockVectorType &parent, + const unsigned int global_index, + const unsigned int current_block, + const unsigned int index_within_block, + const unsigned int next_break_forward, + const unsigned int next_break_backward); - public: + public: - /** - * Copy operator. - */ - Iterator & operator = (const Iterator &c); - - /** - * Dereferencing operator. If - * the template argument - * @p{constness} is @p{true}, - * then no writing to the - * result is possible, making - * this a @p{const_iterator}. - */ - reference operator * () const; - - /** - * Dereferencing operator. If - * the template argument - * @p{constness} is @p{true}, - * then no writing to the - * result is possible, making - * this a @p{const_iterator}. - */ - pointer operator -> () const; - - /** - * Random access operator, - * grant access to arbitrary - * elements relative to the one - * presently pointed to. - */ - reference operator [] (const difference_type d) const; + /** + * Copy operator. + */ + Iterator & operator = (const Iterator &c); + + /** + * Dereferencing operator. If + * the template argument + * @p{constness} is @p{true}, + * then no writing to the + * result is possible, making + * this a @p{const_iterator}. + */ + reference operator * () const; + + /** + * Dereferencing operator. If + * the template argument + * @p{constness} is @p{true}, + * then no writing to the + * result is possible, making + * this a @p{const_iterator}. + */ + pointer operator -> () const; + + /** + * Random access operator, + * grant access to arbitrary + * elements relative to the one + * presently pointed to. + */ + reference operator [] (const difference_type d) const; - /** - * Prefix @p{++} operator: - * @p{++i}. This operator - * advances the iterator to - * the next element and - * returns a reference to - * @p{*this}. - */ - Iterator & operator ++ (); - - /** - * Postfix @p{++} operator: - * @p{i++}. This operator - * advances the iterator to - * the next element and - * returns a copy of the old - * value of this iterator. - */ - Iterator operator ++ (int); - - /** - * Prefix @p{--} operator: - * @p{--i}. This operator - * retracts the iterator to - * the previous element and - * returns a reference to - * @p{*this}. - */ - Iterator & operator -- (); - - /** - * Postfix @p{--} operator: - * @p{i--}. This operator - * retracts the iterator to - * the previous element and - * returns a copy of the old - * value of this iterator. - */ - Iterator operator -- (int); - - /** - * Compare for equality of - * iterators. This operator - * checks whether the vectors - * pointed to are the same, - * and if not it throws an - * exception. - */ - bool operator == (const Iterator &i) const; + /** + * Prefix @p{++} operator: + * @p{++i}. This operator + * advances the iterator to + * the next element and + * returns a reference to + * @p{*this}. + */ + Iterator & operator ++ (); + + /** + * Postfix @p{++} operator: + * @p{i++}. This operator + * advances the iterator to + * the next element and + * returns a copy of the old + * value of this iterator. + */ + Iterator operator ++ (int); + + /** + * Prefix @p{--} operator: + * @p{--i}. This operator + * retracts the iterator to + * the previous element and + * returns a reference to + * @p{*this}. + */ + Iterator & operator -- (); + + /** + * Postfix @p{--} operator: + * @p{i--}. This operator + * retracts the iterator to + * the previous element and + * returns a copy of the old + * value of this iterator. + */ + Iterator operator -- (int); + + /** + * Compare for equality of + * iterators. This operator + * checks whether the vectors + * pointed to are the same, + * and if not it throws an + * exception. + */ + bool operator == (const Iterator &i) const; - /** - * Same, but compare with an - * iterator of different - * constness. - */ - bool operator == (const InverseConstnessIterator &i) const; - - /** - * Compare for inequality of - * iterators. This operator - * checks whether the vectors - * pointed to are the same, - * and if not it throws an - * exception. - */ - bool operator != (const Iterator &i) const; - - /** - * Same, but compare with an - * iterator of different - * constness. - */ - bool operator != (const InverseConstnessIterator &i) const; - - /** - * Check whether this - * iterators points to an - * element previous to the - * one pointed to by the - * given argument. This - * operator checks whether - * the vectors pointed to are - * the same, and if not it - * throws an exception. - */ - bool operator < (const Iterator &i) const; - - /** - * Same, but compare with an - * iterator of different - * constness. - */ - bool operator < (const InverseConstnessIterator &i) const; - - /** - * Comparison operator alike - * to the one above. - */ - bool operator <= (const Iterator &i) const; - - /** - * Same, but compare with an - * iterator of different - * constness. - */ - bool operator <= (const InverseConstnessIterator &i) const; - - /** - * Comparison operator alike - * to the one above. - */ - bool operator > (const Iterator &i) const; - - /** - * Same, but compare with an - * iterator of different - * constness. - */ - bool operator > (const InverseConstnessIterator &i) const; - - /** - * Comparison operator alike - * to the one above. - */ - bool operator >= (const Iterator &i) const; - - /** - * Same, but compare with an - * iterator of different - * constness. - */ - bool operator >= (const InverseConstnessIterator &i) const; - - /** - * Return the distance between - * the two iterators, in - * elements. - */ - difference_type operator - (const Iterator &i) const; - - /** - * Same, but for iterators of - * opposite constness. - */ - difference_type operator - (const InverseConstnessIterator &i) const; - - /** - * Return an iterator which is - * the given number of elements - * in front of the present one. - */ - Iterator operator + (const difference_type &d) const; + /** + * Same, but compare with an + * iterator of different + * constness. + */ + bool operator == (const InverseConstnessIterator &i) const; + + /** + * Compare for inequality of + * iterators. This operator + * checks whether the vectors + * pointed to are the same, + * and if not it throws an + * exception. + */ + bool operator != (const Iterator &i) const; + + /** + * Same, but compare with an + * iterator of different + * constness. + */ + bool operator != (const InverseConstnessIterator &i) const; + + /** + * Check whether this + * iterators points to an + * element previous to the + * one pointed to by the + * given argument. This + * operator checks whether + * the vectors pointed to are + * the same, and if not it + * throws an exception. + */ + bool operator < (const Iterator &i) const; + + /** + * Same, but compare with an + * iterator of different + * constness. + */ + bool operator < (const InverseConstnessIterator &i) const; + + /** + * Comparison operator alike + * to the one above. + */ + bool operator <= (const Iterator &i) const; + + /** + * Same, but compare with an + * iterator of different + * constness. + */ + bool operator <= (const InverseConstnessIterator &i) const; + + /** + * Comparison operator alike + * to the one above. + */ + bool operator > (const Iterator &i) const; + + /** + * Same, but compare with an + * iterator of different + * constness. + */ + bool operator > (const InverseConstnessIterator &i) const; + + /** + * Comparison operator alike + * to the one above. + */ + bool operator >= (const Iterator &i) const; + + /** + * Same, but compare with an + * iterator of different + * constness. + */ + bool operator >= (const InverseConstnessIterator &i) const; + + /** + * Return the distance between + * the two iterators, in + * elements. + */ + difference_type operator - (const Iterator &i) const; + + /** + * Same, but for iterators of + * opposite constness. + */ + difference_type operator - (const InverseConstnessIterator &i) const; + + /** + * Return an iterator which is + * the given number of elements + * in front of the present one. + */ + Iterator operator + (const difference_type &d) const; - /** - * Return an iterator which is - * the given number of elements - * behind the present one. - */ - Iterator operator - (const difference_type &d) const; - - /** - * Move the iterator @p{d} - * elements forward at once, - * and return the result. - */ - Iterator & operator += (const difference_type &d); - - /** - * Move the iterator @p{d} - * elements backward at once, - * and return the result. - */ - Iterator & operator -= (const difference_type &d); + /** + * Return an iterator which is + * the given number of elements + * behind the present one. + */ + Iterator operator - (const difference_type &d) const; + + /** + * Move the iterator @p{d} + * elements forward at once, + * and return the result. + */ + Iterator & operator += (const difference_type &d); + + /** + * Move the iterator @p{d} + * elements backward at once, + * and return the result. + */ + Iterator & operator -= (const difference_type &d); - /** - * Exception. - */ - DeclException0 (ExcPointerToDifferentVectors); - /** - * Exception. - */ - DeclException0 (ExcCastingAwayConstness); + /** + * Exception. + */ + DeclException0 (ExcPointerToDifferentVectors); + /** + * Exception. + */ + DeclException0 (ExcCastingAwayConstness); - private: - /** - * Pointer to the block - * vector object to which - * this iterator - * points. Depending on the - * value of the @p{constness} - * template argument of this - * class, this is a @p{const} - * or non-@p{const} pointer. - */ - BlockVectorType *parent; - - /** - * Global index of the - * element to which we - * presently point. - */ - unsigned int global_index; - - /** - * Current block and index - * within this block of the - * element presently pointed - * to. - */ - unsigned int current_block; - unsigned int index_within_block; - - /** - * Indices of the global - * element address at which - * we have to move on to - * another block when moving - * forward and - * backward. These indices - * are kept as a cache since - * this is much more - * efficient than always - * asking the parent object. - */ - unsigned int next_break_forward; - unsigned int next_break_backward; - - /** - * Move forward one element. - */ - void move_forward (); - - /** - * Move backward one element. - */ - void move_backward (); + private: + /** + * Pointer to the block + * vector object to which + * this iterator + * points. Depending on the + * value of the @p{constness} + * template argument of this + * class, this is a @p{const} + * or non-@p{const} pointer. + */ + BlockVectorType *parent; + + /** + * Global index of the + * element to which we + * presently point. + */ + unsigned int global_index; + + /** + * Current block and index + * within this block of the + * element presently pointed + * to. + */ + unsigned int current_block; + unsigned int index_within_block; + + /** + * Indices of the global + * element address at which + * we have to move on to + * another block when moving + * forward and + * backward. These indices + * are kept as a cache since + * this is much more + * efficient than always + * asking the parent object. + */ + unsigned int next_break_forward; + unsigned int next_break_backward; + + /** + * Move forward one element. + */ + void move_forward (); + + /** + * Move backward one element. + */ + void move_backward (); #ifndef DEAL_II_NAMESP_TEMPL_FRIEND_BUG - /** - * Mark all other instances of - * this template as friends. In - * fact, we only need the - * inverse constness iterator - * as friend, but this is - * something that ISO C++ does - * not allow to specify. If we - * have detected a compiler bug - * during configuration of the - * library, use a workaround - * that works for this - * particular compiler, but is - * not ISO C++ conforming. - */ - template - friend class Iterator; + /** + * Mark all other instances of + * this template as friends. In + * fact, we only need the + * inverse constness iterator + * as friend, but this is + * something that ISO C++ does + * not allow to specify. If we + * have detected a compiler bug + * during configuration of the + * library, use a workaround + * that works for this + * particular compiler, but is + * not ISO C++ conforming. + */ + template + friend class Iterator; #else - friend class InverseConstnessIterator; + friend class InverseConstnessIterator; #endif - }; -} - - + }; + } // namespace BlockVectorIterators +} // namespace internal /** * A vector composed of several blocks each representing a vector of @@ -647,8 +649,8 @@ class BlockVector typedef Number value_type; typedef value_type *pointer; typedef const value_type *const_pointer; - typedef BlockVectorIterators::Iterator iterator; - typedef BlockVectorIterators::Iterator const_iterator; + typedef internal::BlockVectorIterators::Iterator iterator; + typedef internal::BlockVectorIterators::Iterator const_iterator; typedef value_type &reference; typedef const value_type &const_reference; typedef size_t size_type; @@ -1218,7 +1220,7 @@ class BlockVector */ #ifndef DEAL_II_NAMESP_TEMPL_FRIEND_BUG template - friend class BlockVectorIterators::Iterator; + friend class internal::BlockVectorIterators::Iterator; #else friend class iterator; friend class const_iterator; @@ -1337,465 +1339,469 @@ BlockVector::get_block_indices () const } -namespace BlockVectorIterators +namespace internal { - - template - inline - Iterator:: - Iterator (const Iterator &c) - : - parent (c.parent), - global_index (c.global_index), - current_block (c.current_block), - index_within_block (c.index_within_block), - next_break_forward (c.next_break_forward), - next_break_backward (c.next_break_backward) - {} - - - - template - inline - Iterator:: - Iterator (const InverseConstnessIterator &c) - : - parent (const_cast(c.parent)), - global_index (c.global_index), - current_block (c.current_block), - index_within_block (c.index_within_block), - next_break_forward (c.next_break_forward), - next_break_backward (c.next_break_backward) + namespace BlockVectorIterators { - // if constness==false, then the - // constness of the iterator we - // got is true and we are trying - // to cast away the - // constness. disallow this - Assert (constness==true, ExcCastingAwayConstness()); - } + + template + inline + Iterator:: + Iterator (const Iterator &c) + : + parent (c.parent), + global_index (c.global_index), + current_block (c.current_block), + index_within_block (c.index_within_block), + next_break_forward (c.next_break_forward), + next_break_backward (c.next_break_backward) + {} + + + + template + inline + Iterator:: + Iterator (const InverseConstnessIterator &c) + : + parent (const_cast(c.parent)), + global_index (c.global_index), + current_block (c.current_block), + index_within_block (c.index_within_block), + next_break_forward (c.next_break_forward), + next_break_backward (c.next_break_backward) + { + // if constness==false, then the + // constness of the iterator we + // got is true and we are trying + // to cast away the + // constness. disallow this + Assert (constness==true, ExcCastingAwayConstness()); + } - template - inline - Iterator:: - Iterator (BlockVectorType &parent, - const unsigned int global_index, - const unsigned int current_block, - const unsigned int index_within_block, - const unsigned int next_break_forward, - const unsigned int next_break_backward) - : - parent (&parent), - global_index (global_index), - current_block (current_block), - index_within_block (index_within_block), - next_break_forward (next_break_forward), - next_break_backward (next_break_backward) - { - } + template + inline + Iterator:: + Iterator (BlockVectorType &parent, + const unsigned int global_index, + const unsigned int current_block, + const unsigned int index_within_block, + const unsigned int next_break_forward, + const unsigned int next_break_backward) + : + parent (&parent), + global_index (global_index), + current_block (current_block), + index_within_block (index_within_block), + next_break_forward (next_break_forward), + next_break_backward (next_break_backward) + { + } - template - inline - Iterator & - Iterator:: - operator = (const Iterator &c) - { - parent = c.parent; - global_index = c.global_index; - index_within_block = c.index_within_block; - current_block = c.current_block; - next_break_forward = c.next_break_forward; - next_break_backward = c.next_break_backward; + template + inline + Iterator & + Iterator:: + operator = (const Iterator &c) + { + parent = c.parent; + global_index = c.global_index; + index_within_block = c.index_within_block; + current_block = c.current_block; + next_break_forward = c.next_break_forward; + next_break_backward = c.next_break_backward; - return *this; - } + return *this; + } - template - inline - typename Iterator::reference - Iterator::operator * () const - { - // we might want to return the - // following directly, but if we do - // that we run into a gcc bug where - // it complains that we return a - // reference to a temporary - reference p = parent->block(current_block)(index_within_block); - return p; - } + template + inline + typename Iterator::reference + Iterator::operator * () const + { + // we might want to return the + // following directly, but if we do + // that we run into a gcc bug where + // it complains that we return a + // reference to a temporary + reference p = parent->block(current_block)(index_within_block); + return p; + } - template - inline - typename Iterator::pointer - Iterator::operator -> () const - { - // we might want to return the - // following directly, but if we do - // that we run into a gcc bug where - // it complains that we return a - // reference to a temporary - reference p = parent->block(current_block)(index_within_block); - return &p; - } + template + inline + typename Iterator::pointer + Iterator::operator -> () const + { + // we might want to return the + // following directly, but if we do + // that we run into a gcc bug where + // it complains that we return a + // reference to a temporary + reference p = parent->block(current_block)(index_within_block); + return &p; + } - template - inline - typename Iterator::reference - Iterator::operator [] (const difference_type d) const - { - // if the index pointed to is - // still within the block we - // currently point into, then we - // can save the computation of - // the block - if ((global_index+d >= next_break_backward) && - (global_index+d <= next_break_forward)) - { - reference p = parent->block(current_block)(index_within_block + d); - return p; - }; + template + inline + typename Iterator::reference + Iterator::operator [] (const difference_type d) const + { + // if the index pointed to is + // still within the block we + // currently point into, then we + // can save the computation of + // the block + if ((global_index+d >= next_break_backward) && + (global_index+d <= next_break_forward)) + { + reference p = parent->block(current_block)(index_within_block + d); + return p; + }; - // if the index is not within the - // block of the block vector into - // which we presently point, then - // there is no way: we have to - // search for the block. this can - // be done through the parent - // class as well. - reference p = (*parent)(global_index+d); - return p; - } - - - - template - inline - Iterator & - Iterator::operator ++ () - { - move_forward (); - return *this; - } + // if the index is not within the + // block of the block vector into + // which we presently point, then + // there is no way: we have to + // search for the block. this can + // be done through the parent + // class as well. + reference p = (*parent)(global_index+d); + return p; + } + + + + template + inline + Iterator & + Iterator::operator ++ () + { + move_forward (); + return *this; + } - template - inline - Iterator - Iterator::operator ++ (int) - { - const Iterator old_value = *this; - move_forward (); - return old_value; - } + template + inline + Iterator + Iterator::operator ++ (int) + { + const Iterator old_value = *this; + move_forward (); + return old_value; + } - template - inline - Iterator & - Iterator::operator -- () - { - move_backward (); - return *this; - } + template + inline + Iterator & + Iterator::operator -- () + { + move_backward (); + return *this; + } - template - inline - Iterator - Iterator::operator -- (int) - { - const Iterator old_value = *this; - move_backward (); - return old_value; - } + template + inline + Iterator + Iterator::operator -- (int) + { + const Iterator old_value = *this; + move_backward (); + return old_value; + } - template - inline - bool - Iterator::operator == (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator == (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index == i.global_index); - } + return (global_index == i.global_index); + } - template - inline - bool - Iterator::operator == (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator == (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index == i.global_index); - } + return (global_index == i.global_index); + } - template - inline - bool - Iterator::operator != (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator != (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index != i.global_index); - } + return (global_index != i.global_index); + } - template - inline - bool - Iterator::operator != (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator != (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index != i.global_index); - } + return (global_index != i.global_index); + } - template - inline - bool - Iterator::operator < (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator < (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index < i.global_index); - } + return (global_index < i.global_index); + } - template - inline - bool - Iterator::operator < (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator < (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index < i.global_index); - } + return (global_index < i.global_index); + } - template - inline - bool - Iterator::operator <= (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator <= (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index <= i.global_index); - } + return (global_index <= i.global_index); + } - template - inline - bool - Iterator::operator <= (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator <= (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index <= i.global_index); - } + return (global_index <= i.global_index); + } - template - inline - bool - Iterator::operator > (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator > (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index > i.global_index); - } + return (global_index > i.global_index); + } - template - inline - bool - Iterator::operator > (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator > (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index > i.global_index); - } + return (global_index > i.global_index); + } - template - inline - bool - Iterator::operator >= (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator >= (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index >= i.global_index); - } + return (global_index >= i.global_index); + } - template - inline - bool - Iterator::operator >= (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + bool + Iterator::operator >= (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (global_index >= i.global_index); - } + return (global_index >= i.global_index); + } - template - inline - typename Iterator::difference_type - Iterator::operator - (const Iterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + typename Iterator::difference_type + Iterator::operator - (const Iterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (static_cast(global_index) - - static_cast(i.global_index)); - } + return (static_cast(global_index) - + static_cast(i.global_index)); + } - template - inline - typename Iterator::difference_type - Iterator::operator - (const InverseConstnessIterator &i) const - { - Assert (parent == i.parent, ExcPointerToDifferentVectors()); + template + inline + typename Iterator::difference_type + Iterator::operator - (const InverseConstnessIterator &i) const + { + Assert (parent == i.parent, ExcPointerToDifferentVectors()); - return (static_cast(global_index) - - static_cast(i.global_index)); - } + return (static_cast(global_index) - + static_cast(i.global_index)); + } - template - inline - Iterator - Iterator::operator + (const difference_type &d) const - { - // if the index pointed to is - // still within the block we - // currently point into, then we - // can save the computation of - // the block - if ((global_index+d >= next_break_backward) && - (global_index+d <= next_break_forward)) - return Iterator (*parent, global_index+d, current_block, - index_within_block+d, - next_break_forward, next_break_backward); - else - // outside present block, so - // have to seek new block - // anyway - return Iterator (*parent, global_index+d); - } - - - - template - inline - Iterator - Iterator::operator - (const difference_type &d) const - { - // if the index pointed to is - // still within the block we - // currently point into, then we - // can save the computation of - // the block - if ((global_index-d >= next_break_backward) && - (global_index-d <= next_break_forward)) - return Iterator (*parent, global_index-d, current_block, - index_within_block-d, - next_break_forward, next_break_backward); - else - // outside present block, so - // have to seek new block - // anyway - return Iterator (*parent, global_index-d); - } - - - - template - inline - Iterator & - Iterator::operator += (const difference_type &d) - { - // if the index pointed to is - // still within the block we - // currently point into, then we - // can save the computation of - // the block - if ((global_index+d >= next_break_backward) && - (global_index+d <= next_break_forward)) - { - global_index += d; - index_within_block += d; - } - else - // outside present block, so - // have to seek new block - // anyway - *this = Iterator (*parent, global_index+d); - - return *this; - } - - - - template - inline - Iterator & - Iterator::operator -= (const difference_type &d) - { - // if the index pointed to is - // still within the block we - // currently point into, then we - // can save the computation of - // the block - if ((global_index-d >= next_break_backward) && - (global_index-d <= next_break_forward)) - { - global_index -= d; - index_within_block -= d; - } - else - // outside present block, so - // have to seek new block - // anyway - *this = Iterator (*parent, global_index-d); - - return *this; - } + template + inline + Iterator + Iterator::operator + (const difference_type &d) const + { + // if the index pointed to is + // still within the block we + // currently point into, then we + // can save the computation of + // the block + if ((global_index+d >= next_break_backward) && + (global_index+d <= next_break_forward)) + return Iterator (*parent, global_index+d, current_block, + index_within_block+d, + next_break_forward, next_break_backward); + else + // outside present block, so + // have to seek new block + // anyway + return Iterator (*parent, global_index+d); + } + + + + template + inline + Iterator + Iterator::operator - (const difference_type &d) const + { + // if the index pointed to is + // still within the block we + // currently point into, then we + // can save the computation of + // the block + if ((global_index-d >= next_break_backward) && + (global_index-d <= next_break_forward)) + return Iterator (*parent, global_index-d, current_block, + index_within_block-d, + next_break_forward, next_break_backward); + else + // outside present block, so + // have to seek new block + // anyway + return Iterator (*parent, global_index-d); + } + + + + template + inline + Iterator & + Iterator::operator += (const difference_type &d) + { + // if the index pointed to is + // still within the block we + // currently point into, then we + // can save the computation of + // the block + if ((global_index+d >= next_break_backward) && + (global_index+d <= next_break_forward)) + { + global_index += d; + index_within_block += d; + } + else + // outside present block, so + // have to seek new block + // anyway + *this = Iterator (*parent, global_index+d); + + return *this; + } + + + + template + inline + Iterator & + Iterator::operator -= (const difference_type &d) + { + // if the index pointed to is + // still within the block we + // currently point into, then we + // can save the computation of + // the block + if ((global_index-d >= next_break_backward) && + (global_index-d <= next_break_forward)) + { + global_index -= d; + index_within_block -= d; + } + else + // outside present block, so + // have to seek new block + // anyway + *this = Iterator (*parent, global_index-d); + + return *this; + } -} + } // namespace BlockVectorIterators + +} //namespace internal /** diff --git a/deal.II/lac/include/lac/block_vector.templates.h b/deal.II/lac/include/lac/block_vector.templates.h index 8e256d307c..66061cf4a8 100644 --- a/deal.II/lac/include/lac/block_vector.templates.h +++ b/deal.II/lac/include/lac/block_vector.templates.h @@ -582,118 +582,120 @@ BlockVector::memory_consumption () const -namespace BlockVectorIterators +namespace internal { - - - template - Iterator:: - Iterator (BlockVectorType &parent, - const unsigned global_index) - : - parent (&parent), - global_index (global_index) + namespace BlockVectorIterators { - // find which block we are - // in. for this, take into - // account that it happens at - // times that people want to - // initialize iterators - // past-the-end - if (global_index < parent.size()) - { - const std::pair - indices = parent.block_indices.global_to_local(global_index); - current_block = indices.first; - index_within_block = indices.second; + + template + Iterator:: + Iterator (BlockVectorType &parent, + const unsigned global_index) + : + parent (&parent), + global_index (global_index) + { + // find which block we are + // in. for this, take into + // account that it happens at + // times that people want to + // initialize iterators + // past-the-end + if (global_index < parent.size()) + { + const std::pair + indices = parent.block_indices.global_to_local(global_index); + current_block = indices.first; + index_within_block = indices.second; - next_break_backward - = parent.block_indices.local_to_global (current_block, 0); - next_break_forward - = (parent.block_indices.local_to_global (current_block, 0) - +parent.block_indices.block_size(current_block)-1); - } - else - // past the end. only have one - // value for this - { - this->global_index = parent.size (); - current_block = parent.n_blocks(); - index_within_block = 0; - next_break_backward = global_index; - next_break_forward = static_cast(-1); - }; - } + next_break_backward + = parent.block_indices.local_to_global (current_block, 0); + next_break_forward + = (parent.block_indices.local_to_global (current_block, 0) + +parent.block_indices.block_size(current_block)-1); + } + else + // past the end. only have one + // value for this + { + this->global_index = parent.size (); + current_block = parent.n_blocks(); + index_within_block = 0; + next_break_backward = global_index; + next_break_forward = static_cast(-1); + }; + } - template - void - Iterator::move_forward () - { - if (global_index != next_break_forward) - ++index_within_block; - else - { - // ok, we traverse a boundary - // between blocks: - index_within_block = 0; - ++current_block; - - // break backwards is now old - // break forward - next_break_backward = next_break_forward+1; - - // compute new break forward - if (current_block < parent->block_indices.size()) - next_break_forward - += parent->block_indices.block_size(current_block); - else - // if we are beyond the end, - // then move the next - // boundary arbitrarily far - // away - next_break_forward = static_cast(-1); - }; + template + void + Iterator::move_forward () + { + if (global_index != next_break_forward) + ++index_within_block; + else + { + // ok, we traverse a boundary + // between blocks: + index_within_block = 0; + ++current_block; + + // break backwards is now old + // break forward + next_break_backward = next_break_forward+1; + + // compute new break forward + if (current_block < parent->block_indices.size()) + next_break_forward + += parent->block_indices.block_size(current_block); + else + // if we are beyond the end, + // then move the next + // boundary arbitrarily far + // away + next_break_forward = static_cast(-1); + }; - ++global_index; - } + ++global_index; + } - template - void - Iterator::move_backward () - { - if (global_index != next_break_backward) - --index_within_block; - else - if (current_block != 0) - { - // ok, we traverse a boundary - // between blocks: - --current_block; - index_within_block = parent->block_indices.block_size(current_block)-1; + template + void + Iterator::move_backward () + { + if (global_index != next_break_backward) + --index_within_block; + else + if (current_block != 0) + { + // ok, we traverse a boundary + // between blocks: + --current_block; + index_within_block = parent->block_indices.block_size(current_block)-1; - // break forwards is now old - // break backward - next_break_forward = next_break_backward-1; + // break forwards is now old + // break backward + next_break_forward = next_break_backward-1; - // compute new break forward - next_break_backward - -= parent->block_indices.block_size (current_block); - } - else - // current block was 0, we now - // get into unspecified terrain - { - --current_block; - index_within_block = static_cast(-1); - next_break_forward = 0; - next_break_backward = 0; - }; + // compute new break forward + next_break_backward + -= parent->block_indices.block_size (current_block); + } + else + // current block was 0, we now + // get into unspecified terrain + { + --current_block; + index_within_block = static_cast(-1); + next_break_forward = 0; + next_break_backward = 0; + }; - --global_index; + --global_index; + } } } diff --git a/deal.II/lac/source/block_vector.cc b/deal.II/lac/source/block_vector.cc index 4ba71f0897..54ae82e39b 100644 --- a/deal.II/lac/source/block_vector.cc +++ b/deal.II/lac/source/block_vector.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002 by the deal authors +// Copyright (C) 2000, 2001, 2002, 2003 by the deal authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -42,11 +42,15 @@ template void BlockVector::equ(const float, template void BlockVector::scale(const BlockVector&); template void BlockVector::scale(const BlockVector&); -namespace BlockVectorIterators +namespace internal { - template class Iterator; - template class Iterator; + namespace BlockVectorIterators + { + template class Iterator; + template class Iterator; - template class Iterator; - template class Iterator; + template class Iterator; + template class Iterator; + } } + -- 2.39.5