Go to the documentation of this file.
3 #ifndef DUNE_DYNVECTOR_HH
4 #define DUNE_DYNVECTOR_HH
11 #include <initializer_list>
33 template<
class K,
class Allocator >
39 typedef typename container_type::size_type
size_type;
42 template<
class K,
class Allocator >
55 template<
class K,
class Allocator = std::allocator< K > >
58 std::vector< K, Allocator > _data;
90 Base(), _data(x._data)
95 _data(std::move(x._data))
100 _data(x.begin(), x.end(), x.get_allocator())
111 _data.push_back( x[ i ] );
114 using Base::operator=;
126 _data = std::move(other._data);
137 return _data.capacity();
174 template<
class K,
class Allocator >
size_type capacity() const
Number of elements for which memory has been allocated.
Definition: dynvector.hh:135
FieldTraits< K >::field_type field_type
Definition: dynvector.hh:45
const K & operator[](size_type i) const
Definition: dynvector.hh:154
DynamicVector(const allocator_type &a=allocator_type())
Constructor making uninitialized vector.
Definition: dynvector.hh:70
DynamicVector & operator=(const DynamicVector &other)
Copy assignment operator.
Definition: dynvector.hh:117
A few common exception classes.
Dune namespace.
Definition: alignedallocator.hh:9
DynamicVector(const DynamicVector< T, Allocator > &x)
Definition: dynvector.hh:99
Traits::value_type value_type
export the type representing the field
Definition: densevector.hh:257
DynamicVector & operator=(DynamicVector &&other)
Move assignment operator.
Definition: dynvector.hh:124
Implements a generic iterator class for writing stl conformant iterators.
DynamicVector(DynamicVector &&x)
Move constructor.
Definition: dynvector.hh:94
DynamicVector(size_type n, const allocator_type &a=allocator_type())
Definition: dynvector.hh:74
DynamicVector(const DynamicVector &x)
Constructor making vector with identical coordinates.
Definition: dynvector.hh:89
DynamicVector(std::initializer_list< K > const &l)
Construct from a std::initializer_list.
Definition: dynvector.hh:84
K & operator[](size_type i)
Definition: dynvector.hh:150
std::vector< K, Allocator > container_type
Definition: dynvector.hh:37
Allocator allocator_type
Definition: dynvector.hh:67
void reserve(size_type n)
Definition: dynvector.hh:143
size_type size() const
Definition: dynvector.hh:149
Base::value_type value_type
Definition: dynvector.hh:63
DynamicVector(const DenseVector< X > &x, const allocator_type &a=allocator_type())
Copy constructor from another DenseVector.
Definition: dynvector.hh:105
T real_type
export the type representing the real type of the field
Definition: ftraits.hh:28
void resize(size_type n, value_type c=value_type())
Definition: dynvector.hh:139
DynamicVector(size_type n, value_type c, const allocator_type &a=allocator_type())
Constructor making vector with identical coordinates.
Definition: dynvector.hh:79
DynamicVector< K, Allocator > derived_type
Definition: dynvector.hh:36
container_type::size_type size_type
Definition: dynvector.hh:39
FieldTraits< K >::real_type real_type
Definition: dynvector.hh:46
Macro for wrapping boundary checks.
Base::size_type size_type
Definition: dynvector.hh:62
Implements the dense vector interface, with an exchangeable storage class.
Definition: ftraits.hh:23
K value_type
Definition: dynvector.hh:38
Stream & operator>>(Stream &stream, std::tuple< Ts... > &t)
Read a std::tuple.
Definition: streamoperators.hh:41
Interface for a class of dense vectors over a given field.
Definition: densevector.hh:19
T field_type
export the type representing the field
Definition: ftraits.hh:26
std::vector< K, Allocator > container_type
Definition: dynvector.hh:65
Construct a vector with a dynamic size.
Definition: dynvector.hh:32
const container_type & container() const
Definition: dynvector.hh:159
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition: boundschecking.hh:28
Traits::size_type size_type
The type used for the index access and size operation.
Definition: densevector.hh:266
container_type & container()
Definition: dynvector.hh:160
size_type size() const
size method
Definition: densevector.hh:297
Definition: matvectraits.hh:29