dune-istl
2.7.0
|
A vector of blocks with memory management. More...
#include <dune/istl/bvector.hh>
Public Types | |
using | field_type = typename Imp::BlockTraits< B >::field_type |
export the type representing the field More... | |
typedef B | block_type |
export the type representing the components More... | |
typedef A | allocator_type |
export the allocator type More... | |
typedef A::size_type | size_type |
The type for the index access. More... | |
typedef Imp::block_vector_unmanaged< B, A >::Iterator | Iterator |
make iterators available as types More... | |
typedef Imp::block_vector_unmanaged< B, A >::ConstIterator | ConstIterator |
make iterators available as types More... | |
Public Member Functions | |
BlockVector () | |
makes empty vector More... | |
BlockVector (size_type _n) | |
make vector with _n components More... | |
BlockVector (std::initializer_list< B > const &l) | |
Construct from a std::initializer_list. More... | |
template<typename S > | |
BlockVector (size_type _n, S _capacity) | |
Make vector with _n components but preallocating capacity components. More... | |
void | reserve (size_type capacity) |
Reserve space. More... | |
DUNE_DEPRECATED_MSG ("Use the overload without the second parameter, " "values are always copied") void reserve(size_type capacity | |
Reserve space. More... | |
size_type | capacity () const |
Get the capacity of the vector. More... | |
void | resize (size_type size) |
Resize the vector. More... | |
DUNE_DEPRECATED_MSG ("Use the overload without the second parameter, " "values are always copied") void resize(size_type size | |
Resize the vector. More... | |
BlockVector (const BlockVector &a) noexcept(noexcept(std::declval< BlockVector >().storage_=a.storage_)) | |
copy constructor More... | |
BlockVector (BlockVector &&a) noexcept(noexcept(std::declval< BlockVector >().swap(a))) | |
move constructor More... | |
BlockVector & | operator= (const BlockVector &a) noexcept(noexcept(std::declval< BlockVector >().storage_=a.storage_)) |
assignment More... | |
BlockVector & | operator= (BlockVector &&a) noexcept(noexcept(std::declval< BlockVector >().swap(a))) |
move assignment More... | |
void | swap (BlockVector &other) noexcept(noexcept(std::declval< BlockVector & >().storage_.swap(other.storage_))) |
swap operation More... | |
BlockVector & | operator= (const field_type &k) |
assign from scalar More... | |
Public Attributes | |
bool | copyOldValues |
Static Public Attributes | |
static constexpr unsigned int | blocklevel = Imp::BlockTraits<B>::blockLevel()+1 |
increment block level counter More... | |
A vector of blocks with memory management.
BlockVector adds memory management with ordinary copy semantics to the block_vector_unmanaged template.
Error checking: no error checking is provided normally. Setting the compile time switch DUNE_ISTL_WITH_CHECKING enables error checking.
typedef A Dune::BlockVector< B, A >::allocator_type |
export the allocator type
typedef B Dune::BlockVector< B, A >::block_type |
export the type representing the components
typedef Imp::block_vector_unmanaged<B,A>::ConstIterator Dune::BlockVector< B, A >::ConstIterator |
make iterators available as types
using Dune::BlockVector< B, A >::field_type = typename Imp::BlockTraits<B>::field_type |
export the type representing the field
typedef Imp::block_vector_unmanaged<B,A>::Iterator Dune::BlockVector< B, A >::Iterator |
make iterators available as types
typedef A::size_type Dune::BlockVector< B, A >::size_type |
The type for the index access.
|
inline |
makes empty vector
|
inlineexplicit |
make vector with _n components
|
inline |
Construct from a std::initializer_list.
|
inline |
Make vector with _n components but preallocating capacity components.
If _n > capacity then space for _n entries is allocated.
|
inlinenoexcept |
copy constructor
|
inlinenoexcept |
move constructor
|
inline |
Get the capacity of the vector.
I. e. the maximum number of elements the vector can hold.
Dune::BlockVector< B, A >::DUNE_DEPRECATED_MSG | ( | "Use the overload without the second | parameter, |
" "values are always copied" | |||
) |
Reserve space.
After calling this method the vector can hold up to capacity values. If the specified capacity is smaller than the current capacity and bigger than the current size space will be freed.
If the template parameter copyOldValues is true the values will be copied. If it is false the old values are lost.
capacity | The maximum number of elements the vector needs to hold. |
copyOldValues | Ignored, values are always copied. |
Dune::BlockVector< B, A >::DUNE_DEPRECATED_MSG | ( | "Use the overload without the second | parameter, |
" "values are always copied" | |||
) |
Resize the vector.
After calling this method BlockVector::N() will return size If the capacity of the vector is smaller than the specified size then reserve(size) will be called.
If the template parameter copyOldValues is true the values will be copied if the capacity changes. If it is false the old values are lost.
size | The new size of the vector. |
copyOldValues | Ignored, values are always copied. |
|
inlinenoexcept |
move assignment
|
inlinenoexcept |
assignment
|
inline |
assign from scalar
|
inline |
Reserve space.
Allocate storage for up to capacity
blocks. Resizing won't cause reallocation until the size exceeds the capacity
capacity | The maximum number of elements the vector needs to hold. |
|
inline |
Resize the vector.
Resize the vector to the given number of blocks. Blocks below the given size are copied (moved if possible). Old blocks above the given size are destructed, new blocks above the given size are value-initialized.
size | The new number of blocks of the vector. |
|
inlinenoexcept |
swap operation
|
staticconstexpr |
increment block level counter
bool Dune::BlockVector< B, A >::copyOldValues |