5#ifndef DUNE_DYNVECTOR_HH
6#define DUNE_DYNVECTOR_HH
13#include <initializer_list>
34 template<
class K,
class Allocator >
class DynamicVector;
35 template<
class K,
class Allocator >
41 typedef typename container_type::size_type
size_type;
44 template<
class K,
class Allocator >
57 template<
class K,
class Allocator = std::allocator< K > >
60 std::vector< K, Allocator > _data;
92 Base(), _data(x._data)
97 _data(
std::move(x._data))
102 _data(x.
begin(), x.
end(), x.get_allocator())
113 _data.push_back( x[ i ] );
116 using Base::operator=;
128 _data = std::move(other._data);
139 return _data.capacity();
188 template<
class K,
class Allocator >
A few common exception classes.
Macro for wrapping boundary checks.
Implements a generic iterator class for writing stl conformant iterators.
Implements the dense vector interface, with an exchangeable storage class.
Stream & operator>>(Stream &stream, std::tuple< Ts... > &t)
Read a std::tuple.
Definition streamoperators.hh:43
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition boundschecking.hh:30
Dune namespace.
Definition alignedallocator.hh:13
Interface for a class of dense vectors over a given field.
Definition densevector.hh:229
Traits::value_type value_type
export the type representing the field
Definition densevector.hh:250
Iterator begin()
begin iterator
Definition densevector.hh:347
size_type size() const
size method
Definition densevector.hh:336
Iterator end()
end iterator
Definition densevector.hh:353
Traits::size_type size_type
The type used for the index access and size operation.
Definition densevector.hh:259
Construct a vector with a dynamic size.
Definition dynvector.hh:59
void resize(size_type n, value_type c=value_type())
Definition dynvector.hh:141
DynamicVector(const DynamicVector &x)
Constructor making vector with identical coordinates.
Definition dynvector.hh:91
Base::size_type size_type
Definition dynvector.hh:64
std::vector< K, Allocator > container_type
Definition dynvector.hh:67
size_type size() const
Definition dynvector.hh:151
K & operator[](size_type i)
Definition dynvector.hh:152
container_type & container()
Definition dynvector.hh:174
Base::value_type value_type
Definition dynvector.hh:65
const K * data() const noexcept
return pointer to underlying array
Definition dynvector.hh:168
Allocator allocator_type
Definition dynvector.hh:69
DynamicVector(const allocator_type &a=allocator_type())
Constructor making uninitialized vector.
Definition dynvector.hh:72
DynamicVector(DynamicVector &&x)
Move constructor.
Definition dynvector.hh:96
K * data() noexcept
return pointer to underlying array
Definition dynvector.hh:162
DynamicVector & operator=(DynamicVector &&other)
Move assignment operator.
Definition dynvector.hh:126
DynamicVector & operator=(const DynamicVector &other)
Copy assignment operator.
Definition dynvector.hh:119
size_type capacity() const
Number of elements for which memory has been allocated.
Definition dynvector.hh:137
const container_type & container() const
Definition dynvector.hh:173
DynamicVector(size_type n, const allocator_type &a=allocator_type())
Definition dynvector.hh:76
DynamicVector(std::initializer_list< K > const &l)
Construct from a std::initializer_list.
Definition dynvector.hh:86
DynamicVector(const DynamicVector< T, Allocator > &x)
Definition dynvector.hh:101
const K & operator[](size_type i) const
Definition dynvector.hh:156
void reserve(size_type n)
Definition dynvector.hh:145
DynamicVector(size_type n, value_type c, const allocator_type &a=allocator_type())
Constructor making vector with identical coordinates.
Definition dynvector.hh:81
DynamicVector(const DenseVector< X > &x, const allocator_type &a=allocator_type())
Copy constructor from another DenseVector.
Definition dynvector.hh:107
K value_type
Definition dynvector.hh:40
DynamicVector< K, Allocator > derived_type
Definition dynvector.hh:38
std::vector< K, Allocator > container_type
Definition dynvector.hh:39
container_type::size_type size_type
Definition dynvector.hh:41
FieldTraits< K >::real_type real_type
Definition dynvector.hh:48
FieldTraits< K >::field_type field_type
Definition dynvector.hh:47
T field_type
export the type representing the field
Definition ftraits.hh:28
T real_type
export the type representing the real type of the field
Definition ftraits.hh:30
Definition matvectraits.hh:31