dune-istl 2.10
Loading...
Searching...
No Matches
Dune::VariableBlockVector< B, A > Class Template Reference

A Vector of blocks with different blocksizes. More...

#include <dune/istl/vbvector.hh>

Inheritance diagram for Dune::VariableBlockVector< B, A >:
Inheritance graph

Classes

class  CreateIterator
 Iterator class for sequential creation of blocks. More...
 

Public Types

using field_type = typename Imp::BlockTraits<B>::field_type
 export the type representing the field
 
using allocator_type = A
 export the allocator type
 
using reference = window_type&
 Export type used for references to container entries.
 
using const_reference = const window_type&
 Export type used for const references to container entries.
 
using size_type = typename A::size_type
 The size type for the index access.
 
using value_type = BlockVector<B,A>
 Type of the elements of the outer vector, i.e., dynamic vectors of B.
 
using block_type = BlockVector<B,A>
 Same as value_type, here for historical reasons.
 
using Iterator = IndexedIterator<typename VectorWindows::iterator>
 
using iterator = Iterator
 Export the iterator type using std naming rules.
 
using ConstIterator = IndexedIterator<typename VectorWindows::const_iterator>
 Const iterator.
 
using const_iterator = ConstIterator
 Export the const iterator type using std naming rules.
 

Public Member Functions

 VariableBlockVector ()
 Constructor without arguments makes an empty vector.
 
 VariableBlockVector (size_type numBlocks)
 Construct a vector with given number of blocks, but size of each block is not yet known.
 
 VariableBlockVector (size_type numBlocks, size_type blockSize)
 Construct a vector with given number of blocks each having a constant size.
 
 VariableBlockVector (const VariableBlockVector &a)
 Copy constructor, has copy semantics.
 
 VariableBlockVector (VariableBlockVector &&tmp)
 Move constructor:
 
 ~VariableBlockVector ()=default
 
VariableBlockVectoroperator= (VariableBlockVector tmp)
 Copy and move assignment.
 
void swap (VariableBlockVector &other) noexcept
 Exchange the storage and internal state with other.
 
void resize (size_type numBlocks)
 same effect as constructor with same argument
 
void resize (size_type numBlocks, size_type blockSize)
 same effect as constructor with same argument
 
VariableBlockVectoroperator= (const field_type &k)
 Set all entries to the given scalar k.
 
CreateIterator createbegin ()
 get initial create iterator
 
CreateIterator createend ()
 get create iterator pointing to one after the last block
 
window_type & operator[] (size_type i)
 random access to blocks
 
const window_type & operator[] (size_type i) const
 same for read only access
 
Iterator begin ()
 begin Iterator
 
Iterator end ()
 end Iterator
 
Iterator beforeEnd ()
 
Iterator beforeBegin ()
 
ConstIterator begin () const
 begin ConstIterator
 
ConstIterator end () const
 end ConstIterator
 
ConstIterator beforeEnd () const
 
ConstIterator beforeBegin () const
 
ConstIterator rend () const
 end ConstIterator
 
Iterator find (size_type i)
 random access returning iterator (end if not contained)
 
ConstIterator find (size_type i) const
 random access returning iterator (end if not contained)
 
size_type N () const noexcept
 number of blocks in the vector (are of variable size here)
 
size_type size () const noexcept
 

Detailed Description

template<class B, class A = std::allocator<B>>
class Dune::VariableBlockVector< B, A >

A Vector of blocks with different blocksizes.

implements a vector consisting of a number of blocks (to be given at run-time) which themselves consist of a number of blocks (also given at run-time) of the given type B.

VariableBlockVector is a container of containers!

Member Typedef Documentation

◆ allocator_type

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::allocator_type = A

export the allocator type

◆ block_type

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::block_type = BlockVector<B,A>

Same as value_type, here for historical reasons.

◆ const_iterator

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::const_iterator = ConstIterator

Export the const iterator type using std naming rules.

◆ const_reference

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::const_reference = const window_type&

Export type used for const references to container entries.

Note
This is not B&, but an internal proxy class!

◆ ConstIterator

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::ConstIterator = IndexedIterator<typename VectorWindows::const_iterator>

Const iterator.

◆ field_type

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::field_type = typename Imp::BlockTraits<B>::field_type

export the type representing the field

◆ Iterator

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::Iterator = IndexedIterator<typename VectorWindows::iterator>

◆ iterator

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::iterator = Iterator

Export the iterator type using std naming rules.

◆ reference

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::reference = window_type&

Export type used for references to container entries.

Note
This is not B&, but an internal proxy class!

◆ size_type

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::size_type = typename A::size_type

The size type for the index access.

◆ value_type

template<class B , class A = std::allocator<B>>
using Dune::VariableBlockVector< B, A >::value_type = BlockVector<B,A>

Type of the elements of the outer vector, i.e., dynamic vectors of B.

Note that this is not the type referred to by the iterators and random access operators, which return proxy objects.

Constructor & Destructor Documentation

◆ VariableBlockVector() [1/5]

template<class B , class A = std::allocator<B>>
Dune::VariableBlockVector< B, A >::VariableBlockVector ( )
inline

Constructor without arguments makes an empty vector.

Note
object cannot be used yet. The size and block sizes need to be initialized.

◆ VariableBlockVector() [2/5]

template<class B , class A = std::allocator<B>>
Dune::VariableBlockVector< B, A >::VariableBlockVector ( size_type numBlocks)
inlineexplicit

Construct a vector with given number of blocks, but size of each block is not yet known.

Note
Object cannot be used yet. Needs to be initialized using the createbegin() and createend() create-iterators to fill the block sizes.

◆ VariableBlockVector() [3/5]

template<class B , class A = std::allocator<B>>
Dune::VariableBlockVector< B, A >::VariableBlockVector ( size_type numBlocks,
size_type blockSize )
inline

Construct a vector with given number of blocks each having a constant size.

Note
Object is fully usable after construction.
Parameters
numBlocksNumber of blocks
blockSizeNumber of elements in each block

◆ VariableBlockVector() [4/5]

template<class B , class A = std::allocator<B>>
Dune::VariableBlockVector< B, A >::VariableBlockVector ( const VariableBlockVector< B, A > & a)
inline

Copy constructor, has copy semantics.

◆ VariableBlockVector() [5/5]

template<class B , class A = std::allocator<B>>
Dune::VariableBlockVector< B, A >::VariableBlockVector ( VariableBlockVector< B, A > && tmp)
inline

Move constructor:

◆ ~VariableBlockVector()

template<class B , class A = std::allocator<B>>
Dune::VariableBlockVector< B, A >::~VariableBlockVector ( )
default

Member Function Documentation

◆ beforeBegin() [1/2]

template<class B , class A = std::allocator<B>>
Iterator Dune::VariableBlockVector< B, A >::beforeBegin ( )
inline
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeBegin() [2/2]

template<class B , class A = std::allocator<B>>
ConstIterator Dune::VariableBlockVector< B, A >::beforeBegin ( ) const
inline
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeEnd() [1/2]

template<class B , class A = std::allocator<B>>
Iterator Dune::VariableBlockVector< B, A >::beforeEnd ( )
inline
Returns
an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.

◆ beforeEnd() [2/2]

template<class B , class A = std::allocator<B>>
ConstIterator Dune::VariableBlockVector< B, A >::beforeEnd ( ) const
inline
Returns
an iterator that is positioned before the end iterator of the vector. i.e. at the last element.

◆ begin() [1/2]

template<class B , class A = std::allocator<B>>
Iterator Dune::VariableBlockVector< B, A >::begin ( )
inline

begin Iterator

◆ begin() [2/2]

template<class B , class A = std::allocator<B>>
ConstIterator Dune::VariableBlockVector< B, A >::begin ( ) const
inline

begin ConstIterator

◆ createbegin()

template<class B , class A = std::allocator<B>>
CreateIterator Dune::VariableBlockVector< B, A >::createbegin ( )
inline

get initial create iterator

◆ createend()

template<class B , class A = std::allocator<B>>
CreateIterator Dune::VariableBlockVector< B, A >::createend ( )
inline

get create iterator pointing to one after the last block

◆ end() [1/2]

template<class B , class A = std::allocator<B>>
Iterator Dune::VariableBlockVector< B, A >::end ( )
inline

end Iterator

◆ end() [2/2]

template<class B , class A = std::allocator<B>>
ConstIterator Dune::VariableBlockVector< B, A >::end ( ) const
inline

end ConstIterator

◆ find() [1/2]

template<class B , class A = std::allocator<B>>
Iterator Dune::VariableBlockVector< B, A >::find ( size_type i)
inline

random access returning iterator (end if not contained)

◆ find() [2/2]

template<class B , class A = std::allocator<B>>
ConstIterator Dune::VariableBlockVector< B, A >::find ( size_type i) const
inline

random access returning iterator (end if not contained)

◆ N()

template<class B , class A = std::allocator<B>>
size_type Dune::VariableBlockVector< B, A >::N ( ) const
inlinenoexcept

number of blocks in the vector (are of variable size here)

◆ operator=() [1/2]

template<class B , class A = std::allocator<B>>
VariableBlockVector & Dune::VariableBlockVector< B, A >::operator= ( const field_type & k)
inline

Set all entries to the given scalar k.

◆ operator=() [2/2]

template<class B , class A = std::allocator<B>>
VariableBlockVector & Dune::VariableBlockVector< B, A >::operator= ( VariableBlockVector< B, A > tmp)
inline

Copy and move assignment.

◆ operator[]() [1/2]

template<class B , class A = std::allocator<B>>
window_type & Dune::VariableBlockVector< B, A >::operator[] ( size_type i)
inline

random access to blocks

◆ operator[]() [2/2]

template<class B , class A = std::allocator<B>>
const window_type & Dune::VariableBlockVector< B, A >::operator[] ( size_type i) const
inline

same for read only access

◆ rend()

template<class B , class A = std::allocator<B>>
ConstIterator Dune::VariableBlockVector< B, A >::rend ( ) const
inline

end ConstIterator

◆ resize() [1/2]

template<class B , class A = std::allocator<B>>
void Dune::VariableBlockVector< B, A >::resize ( size_type numBlocks)
inline

same effect as constructor with same argument

◆ resize() [2/2]

template<class B , class A = std::allocator<B>>
void Dune::VariableBlockVector< B, A >::resize ( size_type numBlocks,
size_type blockSize )
inline

same effect as constructor with same argument

◆ size()

template<class B , class A = std::allocator<B>>
size_type Dune::VariableBlockVector< B, A >::size ( ) const
inlinenoexcept

Number of blocks in the vector

Returns the same value as method N(), because the vector is dense

◆ swap()

template<class B , class A = std::allocator<B>>
void Dune::VariableBlockVector< B, A >::swap ( VariableBlockVector< B, A > & other)
inlinenoexcept

Exchange the storage and internal state with other.


The documentation for this class was generated from the following file: