dune-common  2.6-git
Public Types | Public Member Functions | Related Functions | List of all members
Dune::DynamicVector< K, Allocator > Class Template Reference

Construct a vector with a dynamic size. More...

#include <dune/common/dynvector.hh>

Inheritance diagram for Dune::DynamicVector< K, Allocator >:
Inheritance graph

Public Types

typedef Base::size_type size_type
 
typedef Base::value_type value_type
 
typedef std::vector< K, Allocator > container_type
 
typedef Allocator allocator_type
 

Public Member Functions

 DynamicVector (const allocator_type &a=allocator_type())
 Constructor making uninitialized vector. More...
 
 DynamicVector (size_type n, const allocator_type &a=allocator_type())
 
 DynamicVector (size_type n, value_type c, const allocator_type &a=allocator_type())
 Constructor making vector with identical coordinates. More...
 
 DynamicVector (std::initializer_list< K > const &l)
 Construct from a std::initializer_list. More...
 
 DynamicVector (const DynamicVector &x)
 Constructor making vector with identical coordinates. More...
 
 DynamicVector (DynamicVector &&x)
 Move constructor. More...
 
template<class T >
 DynamicVector (const DynamicVector< T, Allocator > &x)
 
template<class X >
 DynamicVector (const DenseVector< X > &x, const allocator_type &a=allocator_type())
 Copy constructor from another DenseVector. More...
 
DynamicVectoroperator= (const DynamicVector &other)
 Copy assignment operator. More...
 
DynamicVectoroperator= (DynamicVector &&other)
 Move assignment operator. More...
 
size_type capacity () const
 Number of elements for which memory has been allocated. More...
 
void resize (size_type n, value_type c=value_type())
 
void reserve (size_type n)
 
size_type size () const
 
K & operator[] (size_type i)
 
const K & operator[] (size_type i) const
 
const container_typecontainer () const
 
container_typecontainer ()
 
derived_type & operator= (const value_type &k)
 Assignment operator for scalar. More...
 

Related Functions

(Note that these are not member functions.)

template<class K , class Allocator >
std::istream & operator>> (std::istream &in, DynamicVector< K, Allocator > &v)
 Read a DynamicVector from an input stream. More...
 

Detailed Description

template<class K, class Allocator = std::allocator< K >>
class Dune::DynamicVector< K, Allocator >

Construct a vector with a dynamic size.

Template Parameters
Kis the field type (use float, double, complex, etc)
Allocatortype of allocator object used to define the storage allocation model, default Allocator = std::allocator< K >.

Member Typedef Documentation

◆ allocator_type

template<class K , class Allocator = std::allocator< K >>
typedef Allocator Dune::DynamicVector< K, Allocator >::allocator_type

◆ container_type

template<class K , class Allocator = std::allocator< K >>
typedef std::vector< K, Allocator > Dune::DynamicVector< K, Allocator >::container_type

◆ size_type

template<class K , class Allocator = std::allocator< K >>
typedef Base::size_type Dune::DynamicVector< K, Allocator >::size_type

◆ value_type

template<class K , class Allocator = std::allocator< K >>
typedef Base::value_type Dune::DynamicVector< K, Allocator >::value_type

Constructor & Destructor Documentation

◆ DynamicVector() [1/8]

template<class K , class Allocator = std::allocator< K >>
Dune::DynamicVector< K, Allocator >::DynamicVector ( const allocator_type a = allocator_type())
inlineexplicit

Constructor making uninitialized vector.

◆ DynamicVector() [2/8]

template<class K , class Allocator = std::allocator< K >>
Dune::DynamicVector< K, Allocator >::DynamicVector ( size_type  n,
const allocator_type a = allocator_type() 
)
inlineexplicit

◆ DynamicVector() [3/8]

template<class K , class Allocator = std::allocator< K >>
Dune::DynamicVector< K, Allocator >::DynamicVector ( size_type  n,
value_type  c,
const allocator_type a = allocator_type() 
)
inline

Constructor making vector with identical coordinates.

◆ DynamicVector() [4/8]

template<class K , class Allocator = std::allocator< K >>
Dune::DynamicVector< K, Allocator >::DynamicVector ( std::initializer_list< K > const &  l)
inline

Construct from a std::initializer_list.

◆ DynamicVector() [5/8]

template<class K , class Allocator = std::allocator< K >>
Dune::DynamicVector< K, Allocator >::DynamicVector ( const DynamicVector< K, Allocator > &  x)
inline

Constructor making vector with identical coordinates.

◆ DynamicVector() [6/8]

template<class K , class Allocator = std::allocator< K >>
Dune::DynamicVector< K, Allocator >::DynamicVector ( DynamicVector< K, Allocator > &&  x)
inline

Move constructor.

◆ DynamicVector() [7/8]

template<class K , class Allocator = std::allocator< K >>
template<class T >
Dune::DynamicVector< K, Allocator >::DynamicVector ( const DynamicVector< T, Allocator > &  x)
inline

◆ DynamicVector() [8/8]

template<class K , class Allocator = std::allocator< K >>
template<class X >
Dune::DynamicVector< K, Allocator >::DynamicVector ( const DenseVector< X > &  x,
const allocator_type a = allocator_type() 
)
inline

Copy constructor from another DenseVector.

Member Function Documentation

◆ capacity()

template<class K , class Allocator = std::allocator< K >>
size_type Dune::DynamicVector< K, Allocator >::capacity ( ) const
inline

Number of elements for which memory has been allocated.

capacity() is always greater than or equal to size().

◆ container() [1/2]

template<class K , class Allocator = std::allocator< K >>
container_type& Dune::DynamicVector< K, Allocator >::container ( )
inline

◆ container() [2/2]

template<class K , class Allocator = std::allocator< K >>
const container_type& Dune::DynamicVector< K, Allocator >::container ( ) const
inline

◆ operator=() [1/3]

template<class K , class Allocator = std::allocator< K >>
DynamicVector& Dune::DynamicVector< K, Allocator >::operator= ( const DynamicVector< K, Allocator > &  other)
inline

Copy assignment operator.

◆ operator=() [2/3]

template<class K , class Allocator = std::allocator< K >>
derived_type& Dune::DenseVector< V >::operator=
inline

Assignment operator for scalar.

◆ operator=() [3/3]

template<class K , class Allocator = std::allocator< K >>
DynamicVector& Dune::DynamicVector< K, Allocator >::operator= ( DynamicVector< K, Allocator > &&  other)
inline

Move assignment operator.

◆ operator[]() [1/2]

template<class K , class Allocator = std::allocator< K >>
K& Dune::DynamicVector< K, Allocator >::operator[] ( size_type  i)
inline

◆ operator[]() [2/2]

template<class K , class Allocator = std::allocator< K >>
const K& Dune::DynamicVector< K, Allocator >::operator[] ( size_type  i) const
inline

◆ reserve()

template<class K , class Allocator = std::allocator< K >>
void Dune::DynamicVector< K, Allocator >::reserve ( size_type  n)
inline

◆ resize()

template<class K , class Allocator = std::allocator< K >>
void Dune::DynamicVector< K, Allocator >::resize ( size_type  n,
value_type  c = value_type() 
)
inline

◆ size()

template<class K , class Allocator = std::allocator< K >>
size_type Dune::DynamicVector< K, Allocator >::size ( ) const
inline

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