diff --git a/dune/istl/basearray.hh b/dune/istl/basearray.hh index 61d1ab6fa3e01bcca1fc4d76f6deeb5ecd3da63e..2e7fdd326d6b53aed28b0b141b1fdf11c7a6948d 100644 --- a/dune/istl/basearray.hh +++ b/dune/istl/basearray.hh @@ -18,6 +18,9 @@ namespace Dune { +/** \brief Everything in this namespace is internal to dune-istl, and may change without warning */ +namespace Imp { + /** \brief A simple array container for objects of type B Implement. @@ -748,6 +751,8 @@ namespace Dune { size_type* j; // the index set }; +} // end namespace Imp + } // end namespace #endif diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh index 6db45d1e94c617b44698d62476af82d9d54d2f60..bf728daee567abb38ad17f830f4fe67dabf249d3 100644 --- a/dune/istl/bcrsmatrix.hh +++ b/dune/istl/bcrsmatrix.hh @@ -451,7 +451,7 @@ namespace Dune { typedef A allocator_type; //! implement row_type with compressed vector - typedef CompressedBlockVectorWindow<B,A> row_type; + typedef Imp::CompressedBlockVectorWindow<B,A> row_type; //! The type for the index access and the size typedef typename A::size_type size_type; diff --git a/dune/istl/bvector.hh b/dune/istl/bvector.hh index d88b02e6f522642a9ee977050514cf645bf0fbc0..f87e4ac7e82a0faf911741a706ad31a7c2f3db41 100644 --- a/dune/istl/bvector.hh +++ b/dune/istl/bvector.hh @@ -28,6 +28,9 @@ namespace Dune { template<class B, class A=std::allocator<B> > class BlockVectorWindow; +/** \brief Everything in this namespace is internal to dune-istl, and may change without warning */ +namespace Imp { + /** \brief An unmanaged vector of blocks. @@ -294,6 +297,7 @@ namespace Dune { { } }; +} // end namespace Imp /** @addtogroup ISTL_SPMV @{ @@ -309,7 +313,7 @@ namespace Dune { enables error checking. */ template<class B, class A=std::allocator<B> > - class BlockVector : public block_vector_unmanaged<B,A> + class BlockVector : public Imp::block_vector_unmanaged<B,A> { public: @@ -334,15 +338,15 @@ namespace Dune { }; //! make iterators available as types - typedef typename block_vector_unmanaged<B,A>::Iterator Iterator; + typedef typename Imp::block_vector_unmanaged<B,A>::Iterator Iterator; //! make iterators available as types - typedef typename block_vector_unmanaged<B,A>::ConstIterator ConstIterator; + typedef typename Imp::block_vector_unmanaged<B,A>::ConstIterator ConstIterator; //===== constructors and such //! makes empty vector - BlockVector () : block_vector_unmanaged<B,A>(), + BlockVector () : Imp::block_vector_unmanaged<B,A>(), capacity_(0) {} @@ -436,7 +440,7 @@ namespace Dune { */ void reserve(size_type capacity, bool copyOldValues=true) { - if(capacity >= block_vector_unmanaged<B,A>::N() && capacity != capacity_) { + if(capacity >= Imp::block_vector_unmanaged<B,A>::N() && capacity != capacity_) { // save the old data B* pold = this->p; @@ -450,7 +454,7 @@ namespace Dune { B* to = this->p; B* from = pold; - for(size_type i=0; i < block_vector_unmanaged<B,A>::N(); ++i, ++from, ++to) + for(size_type i=0; i < Imp::block_vector_unmanaged<B,A>::N(); ++i, ++from, ++to) *to = *from; } if(capacity_ > 0) { @@ -498,7 +502,7 @@ namespace Dune { */ void resize(size_type size, bool copyOldValues=true) { - if(size > block_vector_unmanaged<B,A>::N()) + if (size > Imp::block_vector_unmanaged<B,A>::N()) if(capacity_ < size) this->reserve(size, copyOldValues); this->n = size; @@ -509,7 +513,7 @@ namespace Dune { //! copy constructor BlockVector (const BlockVector& a) : - block_vector_unmanaged<B,A>(a) + Imp::block_vector_unmanaged<B,A>(a) { // allocate memory with same size as a this->n = a.n; @@ -575,7 +579,7 @@ namespace Dune { BlockVector& operator= (const field_type& k) { // forward to operator= in base class - (static_cast<block_vector_unmanaged<B,A>&>(*this)) = k; + (static_cast<Imp::block_vector_unmanaged<B,A>&>(*this)) = k; return *this; } @@ -623,6 +627,9 @@ namespace Dune { return s; } +/** \brief Everything in this namespace is internal to dune-istl, and may change without warning */ +namespace Imp { + /** BlockVectorWindow adds window manipulation functions to the block_vector_unmanaged template. @@ -646,7 +653,7 @@ namespace Dune { #else template<class B, class A=std::allocator<B> > #endif - class BlockVectorWindow : public block_vector_unmanaged<B,A> + class BlockVectorWindow : public Imp::block_vector_unmanaged<B,A> { public: @@ -671,15 +678,15 @@ namespace Dune { }; //! make iterators available as types - typedef typename block_vector_unmanaged<B,A>::Iterator Iterator; + typedef typename Imp::block_vector_unmanaged<B,A>::Iterator Iterator; //! make iterators available as types - typedef typename block_vector_unmanaged<B,A>::ConstIterator ConstIterator; + typedef typename Imp::block_vector_unmanaged<B,A>::ConstIterator ConstIterator; //===== constructors and such //! makes empty array - BlockVectorWindow () : block_vector_unmanaged<B,A>() + BlockVectorWindow () : Imp::block_vector_unmanaged<B,A>() { } //! make array from given pointer and size @@ -715,7 +722,7 @@ namespace Dune { //! assign from scalar BlockVectorWindow& operator= (const field_type& k) { - (static_cast<block_vector_unmanaged<B,A>&>(*this)) = k; + (static_cast<Imp::block_vector_unmanaged<B,A>&>(*this)) = k; return *this; } @@ -1156,6 +1163,8 @@ namespace Dune { } }; -} // end namespace +} // end namespace 'Imp' + +} // end namespace 'Dune' #endif diff --git a/dune/istl/matrix.hh b/dune/istl/matrix.hh index 1e77dad8982d1d3b7a253987cde162cbd9c92396..389af804cdd1c0b61206a5e8547345e5056a2ddc 100644 --- a/dune/istl/matrix.hh +++ b/dune/istl/matrix.hh @@ -31,7 +31,7 @@ namespace MatrixImp elegant solution. */ template<class B, class A=std::allocator<B> > - class DenseMatrixBase : public block_vector_unmanaged<B,A> + class DenseMatrixBase : public Imp::block_vector_unmanaged<B,A> // this derivation gives us all the blas level 1 and norms // on the large array. However, access operators have to be // overwritten. @@ -61,7 +61,7 @@ namespace MatrixImp typedef BlockVector<B,A> block_type; // just a shorthand - typedef BlockVectorWindow<B,A> window_type; + typedef Imp::BlockVectorWindow<B,A> window_type; typedef window_type reference; @@ -73,7 +73,7 @@ namespace MatrixImp /** constructor without arguments makes empty vector, object cannot be used yet */ - DenseMatrixBase () : block_vector_unmanaged<B,A>() + DenseMatrixBase () : Imp::block_vector_unmanaged<B,A>() { // nothing is known ... rows_ = 0; @@ -86,7 +86,7 @@ namespace MatrixImp \param _nblocks Number of blocks \param m Number of elements in each block */ - DenseMatrixBase (size_type rows, size_type columns) : block_vector_unmanaged<B,A>() + DenseMatrixBase (size_type rows, size_type columns) : Imp::block_vector_unmanaged<B,A>() { // and we can allocate the big array in the base class this->n = rows*columns; @@ -222,7 +222,7 @@ namespace MatrixImp //! assign from scalar DenseMatrixBase& operator= (const field_type& k) { - (static_cast<block_vector_unmanaged<B,A>&>(*this)) = k; + (static_cast<Imp::block_vector_unmanaged<B,A>&>(*this)) = k; return *this; } diff --git a/dune/istl/test/basearraytest.cc b/dune/istl/test/basearraytest.cc index 2695d05d9d5a4403d179c213085f1264c6ae106a..aab13c5e750fd62d33016f4e49e53aa92e523461 100644 --- a/dune/istl/test/basearraytest.cc +++ b/dune/istl/test/basearraytest.cc @@ -8,8 +8,8 @@ using namespace Dune; int main() { - base_array<double> v1(10); - base_array<double> v2 = v1; + Imp::base_array<double> v1(10); + Imp::base_array<double> v2 = v1; v1.resize(20); diff --git a/dune/istl/tutorial/example.cc b/dune/istl/tutorial/example.cc index bd34d12398045e71339ebeeae73a370ae6744f4e..69b72ed603243349292d0476591eb6dbe2b3c2aa 100644 --- a/dune/istl/tutorial/example.cc +++ b/dune/istl/tutorial/example.cc @@ -71,15 +71,15 @@ void test_basearray () // allocation typedef double Type; // any type - Dune::base_array<Type> a(20); + Dune::Imp::base_array<Type> a(20); // modifying iterator - for (Dune::base_array<Type>::iterator i=a.begin(); i!=a.end(); ++i) + for (Dune::Imp::base_array<Type>::iterator i=a.begin(); i!=a.end(); ++i) *i = 1.0; // read only iterator Type sum=0; - for (Dune::base_array<Type>::const_iterator i=a.begin(); i!=a.end(); ++i) + for (Dune::Imp::base_array<Type>::const_iterator i=a.begin(); i!=a.end(); ++i) sum += *i; // random access @@ -87,14 +87,14 @@ void test_basearray () sum = a[3]; // empty array - Dune::base_array<Type> b; + Dune::Imp::base_array<Type> b; // assignment b = a; // window mode Type p[13]; - Dune::base_array_window<Type> c(p+4,3); // c contains p[4]...p[6] + Dune::Imp::base_array_window<Type> c(p+4,3); // c contains p[4]...p[6] // move window to p[6]...p[10] c.move(2,5); @@ -209,10 +209,6 @@ void test_VariableBlockVector () x = 1.0; - Vector::block_type xi; - - xi = x[13]; - RN b; b = x[13][1]; diff --git a/dune/istl/vbvector.hh b/dune/istl/vbvector.hh index aa7779d3f14eca163470563ae447a61d6264230a..396d76a0c62b2d580aa71ce7c75e7fe25de1a90f 100644 --- a/dune/istl/vbvector.hh +++ b/dune/istl/vbvector.hh @@ -34,13 +34,13 @@ namespace Dune { */ template<class B, class A=std::allocator<B> > - class VariableBlockVector : public block_vector_unmanaged<B,A> + class VariableBlockVector : public Imp::block_vector_unmanaged<B,A> // this derivation gives us all the blas level 1 and norms // on the large array. However, access operators have to be // overwritten. { // just a shorthand - typedef BlockVectorWindow<B,A> window_type; + typedef Imp::BlockVectorWindow<B,A> window_type; public: @@ -91,7 +91,7 @@ namespace Dune { /** constructor without arguments makes empty vector, object cannot be used yet */ - VariableBlockVector () : block_vector_unmanaged<B,A>() + VariableBlockVector () : Imp::block_vector_unmanaged<B,A>() { // nothing is known ... nblocks = 0; @@ -102,7 +102,7 @@ namespace Dune { /** make vector with given number of blocks, but size of each block is not yet known, object cannot be used yet */ - explicit VariableBlockVector (size_type _nblocks) : block_vector_unmanaged<B,A>() + explicit VariableBlockVector (size_type _nblocks) : Imp::block_vector_unmanaged<B,A>() { // we can allocate the windows now nblocks = _nblocks; @@ -128,7 +128,7 @@ namespace Dune { \param _nblocks Number of blocks \param m Number of elements in each block */ - VariableBlockVector (size_type _nblocks, size_type m) : block_vector_unmanaged<B,A>() + VariableBlockVector (size_type _nblocks, size_type m) : Imp::block_vector_unmanaged<B,A>() { // and we can allocate the big array in the base class this->n = _nblocks*m; @@ -392,7 +392,7 @@ namespace Dune { //! assign from scalar VariableBlockVector& operator= (const field_type& k) { - (static_cast<block_vector_unmanaged<B,A>&>(*this)) = k; + (static_cast<Imp::block_vector_unmanaged<B,A>&>(*this)) = k; return *this; }