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;
88 Base(), _data(x._data)
93 _data(std::move(x._data))
98 _data(x.
begin(), x.
end(), x.get_allocator())
109 _data.push_back( x[ i ] );
112 using Base::operator=;
124 _data = std::move(other._data);
135 return _data.capacity();
169 template<
class K,
class Allocator >
FieldTraits< K >::real_type real_type
Definition: dynvector.hh:46
T field_type
export the type representing the field
Definition: ftraits.hh:26
DynamicVector & operator=(const DynamicVector &other)
Copy assignment operator.
Definition: dynvector.hh:115
DynamicVector & operator=(DynamicVector &&other)
Move assignment operator.
Definition: dynvector.hh:122
const K & operator[](size_type i) const
Definition: dynvector.hh:152
Base::size_type size_type
Definition: dynvector.hh:62
Iterator end()
end iterator
Definition: densevector.hh:314
Definition: matvectraits.hh:29
A few common exception classes.
Iterator begin()
begin iterator
Definition: densevector.hh:308
size_type size() const
size method
Definition: densevector.hh:297
std::vector< K, Allocator > container_type
Definition: dynvector.hh:37
DynamicVector(const DenseVector< X > &x, const allocator_type &a=allocator_type())
Copy constructor from another DenseVector.
Definition: dynvector.hh:103
Interface for a class of dense vectors over a given field.
Definition: densevector.hh:19
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition: boundschecking.hh:28
FieldTraits< K >::field_type field_type
Definition: dynvector.hh:45
void resize(size_type n, value_type c=value_type())
Definition: dynvector.hh:137
Macro for wrapping boundary checks.
DynamicVector(const allocator_type &a=allocator_type())
Constructor making uninitialized vector.
Definition: dynvector.hh:68
container_type::size_type size_type
Definition: dynvector.hh:39
DynamicVector(size_type n, const allocator_type &a=allocator_type())
Definition: dynvector.hh:72
DynamicVector(size_type n, value_type c, const allocator_type &a=allocator_type())
Constructor making vector with identical coordinates.
Definition: dynvector.hh:77
K & operator[](size_type i)
Definition: dynvector.hh:148
Traits::value_type value_type
export the type representing the field
Definition: densevector.hh:257
Stream & operator>>(Stream &stream, std::tuple< Ts...> &t)
Read a std::tuple.
Definition: streamoperators.hh:41
Traits::size_type size_type
The type used for the index access and size operation.
Definition: densevector.hh:266
void reserve(size_type n)
Definition: dynvector.hh:141
DynamicVector(DynamicVector &&x)
Move constructor.
Definition: dynvector.hh:92
size_type size() const
Definition: dynvector.hh:147
Definition: ftraits.hh:23
DynamicVector(std::initializer_list< K > const &l)
Construct from a std::initializer_list.
Definition: dynvector.hh:82
Allocator allocator_type
Definition: dynvector.hh:65
Base::value_type value_type
Definition: dynvector.hh:63
Construct a vector with a dynamic size.
Definition: dynvector.hh:32
K value_type
Definition: dynvector.hh:38
DynamicVector< K, Allocator > derived_type
Definition: dynvector.hh:36
DynamicVector(const DynamicVector< T, Allocator > &x)
Definition: dynvector.hh:97
Implements a generic iterator class for writing stl conformant iterators.
T real_type
export the type representing the real type of the field
Definition: ftraits.hh:28
DynamicVector(const DynamicVector &x)
Constructor making vector with identical coordinates.
Definition: dynvector.hh:87
Implements the dense vector interface, with an exchangeable storage class.
size_type capacity() const
Number of elements for which memory has been allocated.
Definition: dynvector.hh:133