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

#include <dune/common/dynvector.hh>

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

List of all members.

Public Types

typedef Base::size_type size_type
 The type used for the index access and size operation.
typedef Base::value_type value_type
 export the type representing the field
enum  
 

We are at the leaf of the block recursion.

More...
typedef Traits::derived_type derived_type
 type of derived vector class
typedef Traits::value_type field_type
 export the type representing the field
typedef Traits::value_type block_type
 export the type representing the components
typedef DenseIterator
< DenseVector, value_type
Iterator
 Iterator class for sequential access.
typedef Iterator iterator
 typedef for stl compliant access
typedef DenseIterator< const
DenseVector, const value_type
ConstIterator
 ConstIterator class for sequential access.
typedef ConstIterator const_iterator
 typedef for stl compliant access

Public Member Functions

 DynamicVector ()
 Constructor making uninitialized vector.
 DynamicVector (size_type n, value_type c=value_type())
 Constructor making vector with identical coordinates.
 DynamicVector (const DynamicVector &x)
 Constructor making vector with identical coordinates.
size_type capacity () const
 Number of elements for which memory has been allocated.
void resize (size_type n, value_type c=value_type())
void reserve (size_type n)
size_type vec_size () const
K & vec_access (size_type i)
const K & vec_access (size_type i) const
value_typeoperator[] (size_type i)
 random access
const value_typeoperator[] (size_type i) const
size_type size () const
 size method
Iterator begin ()
 begin iterator
ConstIterator begin () const
 begin ConstIterator
Iterator end ()
 end iterator
ConstIterator end () const
 end ConstIterator
Iterator rbegin ()
ConstIterator rbegin () const
Iterator beforeEnd ()
ConstIterator beforeEnd () const
Iterator rend ()
ConstIterator rend () const
Iterator beforeBegin ()
ConstIterator beforeBegin () const
Iterator find (size_type i)
 return iterator to given element or end()
ConstIterator find (size_type i) const
 return iterator to given element or end()
derived_typeoperator+= (const DenseVector &y)
 vector space addition
derived_typeoperator+= (const value_type &k)
 vector space add scalar to all comps
derived_typeoperator-= (const DenseVector &y)
 vector space subtraction
derived_typeoperator-= (const value_type &k)
 vector space subtract scalar from all comps
derived_type operator+ (const DenseVector &b) const
 Binary vector addition.
derived_type operator- (const DenseVector &b) const
 Binary vector subtraction.
derived_typeoperator*= (const value_type &k)
 vector space multiplication with scalar
derived_typeoperator/= (const value_type &k)
 vector space division by scalar
bool operator== (const DenseVector &y) const
 Binary vector comparison.
bool operator!= (const DenseVector &y) const
 Binary vector incomparison.
derived_typeaxpy (const value_type &a, const DenseVector &y)
 vector space axpy operation ( *this += a y )
value_type operator* (const DenseVector &y) const
 scalar product (x^T y)
FieldTraits< value_type >
::real_type 
one_norm () const
 one norm (sum over absolute values of entries)
FieldTraits< value_type >
::real_type 
one_norm_real () const
 simplified one norm (uses Manhattan norm for complex values)
FieldTraits< value_type >
::real_type 
two_norm () const
 two norm sqrt(sum over squared values of entries)
FieldTraits< value_type >
::real_type 
two_norm2 () const
 square of two norm (sum over squared values of entries), need for block recursion
FieldTraits< value_type >
::real_type 
infinity_norm () const
 infinity norm (maximum of absolute values of entries)
FieldTraits< value_type >
::real_type 
infinity_norm_real () const
 simplified infinity norm (uses Manhattan norm for complex values)
size_type N () const
 number of blocks in the vector (are of size 1 here)
size_type dim () const
 dimension of the vector space

Related Functions

(Note that these are not member functions.)



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

Detailed Description

template<class K>
class Dune::DynamicVector< K >

Construct a vector with a dynamic size.

Template Parameters:
K is the field type (use float, double, complex, etc)

Member Typedef Documentation

export the type representing the components

typedef for stl compliant access

ConstIterator class for sequential access.

type of derived vector class

export the type representing the field

typedef Iterator Dune::DenseVector< DynamicVector< K > >::iterator [inherited]

typedef for stl compliant access

Iterator class for sequential access.

template<class K>
typedef Base::size_type Dune::DynamicVector< K >::size_type

The type used for the index access and size operation.

Reimplemented from Dune::DenseVector< DynamicVector< K > >.

template<class K>
typedef Base::value_type Dune::DynamicVector< K >::value_type

export the type representing the field

Reimplemented from Dune::DenseVector< DynamicVector< K > >.


Member Enumeration Documentation

anonymous enum [inherited]

We are at the leaf of the block recursion.


Constructor & Destructor Documentation

template<class K>
Dune::DynamicVector< K >::DynamicVector (  )  [inline]

Constructor making uninitialized vector.

template<class K>
Dune::DynamicVector< K >::DynamicVector ( size_type  n,
value_type  c = value_type() 
) [inline, explicit]

Constructor making vector with identical coordinates.

template<class K>
Dune::DynamicVector< K >::DynamicVector ( const DynamicVector< K > &  x  )  [inline]

Constructor making vector with identical coordinates.


Member Function Documentation

derived_type& Dune::DenseVector< DynamicVector< K > >::axpy ( const value_type a,
const DenseVector< DynamicVector< K > > &  y 
) [inline, inherited]

vector space axpy operation ( *this += a y )

Iterator Dune::DenseVector< DynamicVector< K > >::beforeBegin (  )  [inline, inherited]
Returns:
an iterator that is positioned before the first entry of the vector.
ConstIterator Dune::DenseVector< DynamicVector< K > >::beforeBegin (  )  const [inline, inherited]
Returns:
an iterator that is positioned before the first entry of the vector.
Iterator Dune::DenseVector< DynamicVector< K > >::beforeEnd (  )  [inline, inherited]
Returns:
an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.
ConstIterator Dune::DenseVector< DynamicVector< K > >::beforeEnd (  )  const [inline, inherited]
Returns:
an iterator that is positioned before the end iterator of the vector. i.e. at the last element
Iterator Dune::DenseVector< DynamicVector< K > >::begin (  )  [inline, inherited]

begin iterator

ConstIterator Dune::DenseVector< DynamicVector< K > >::begin (  )  const [inline, inherited]

begin ConstIterator

template<class K>
size_type Dune::DynamicVector< K >::capacity (  )  const [inline]

Number of elements for which memory has been allocated.

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

size_type Dune::DenseVector< DynamicVector< K > >::dim (  )  const [inline, inherited]

dimension of the vector space

Iterator Dune::DenseVector< DynamicVector< K > >::end (  )  [inline, inherited]

end iterator

ConstIterator Dune::DenseVector< DynamicVector< K > >::end (  )  const [inline, inherited]

end ConstIterator

Iterator Dune::DenseVector< DynamicVector< K > >::find ( size_type  i  )  [inline, inherited]

return iterator to given element or end()

ConstIterator Dune::DenseVector< DynamicVector< K > >::find ( size_type  i  )  const [inline, inherited]

return iterator to given element or end()

FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K > >::infinity_norm (  )  const [inline, inherited]

infinity norm (maximum of absolute values of entries)

FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K > >::infinity_norm_real (  )  const [inline, inherited]

simplified infinity norm (uses Manhattan norm for complex values)

size_type Dune::DenseVector< DynamicVector< K > >::N (  )  const [inline, inherited]

number of blocks in the vector (are of size 1 here)

FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K > >::one_norm (  )  const [inline, inherited]

one norm (sum over absolute values of entries)

FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K > >::one_norm_real (  )  const [inline, inherited]

simplified one norm (uses Manhattan norm for complex values)

bool Dune::DenseVector< DynamicVector< K > >::operator!= ( const DenseVector< DynamicVector< K > > &  y  )  const [inline, inherited]

Binary vector incomparison.

value_type Dune::DenseVector< DynamicVector< K > >::operator* ( const DenseVector< DynamicVector< K > > &  y  )  const [inline, inherited]

scalar product (x^T y)

derived_type& Dune::DenseVector< DynamicVector< K > >::operator*= ( const value_type k  )  [inline, inherited]

vector space multiplication with scalar

derived_type Dune::DenseVector< DynamicVector< K > >::operator+ ( const DenseVector< DynamicVector< K > > &  b  )  const [inline, inherited]

Binary vector addition.

derived_type& Dune::DenseVector< DynamicVector< K > >::operator+= ( const DenseVector< DynamicVector< K > > &  y  )  [inline, inherited]

vector space addition

derived_type& Dune::DenseVector< DynamicVector< K > >::operator+= ( const value_type k  )  [inline, inherited]

vector space add scalar to all comps

derived_type Dune::DenseVector< DynamicVector< K > >::operator- ( const DenseVector< DynamicVector< K > > &  b  )  const [inline, inherited]

Binary vector subtraction.

derived_type& Dune::DenseVector< DynamicVector< K > >::operator-= ( const value_type k  )  [inline, inherited]

vector space subtract scalar from all comps

derived_type& Dune::DenseVector< DynamicVector< K > >::operator-= ( const DenseVector< DynamicVector< K > > &  y  )  [inline, inherited]

vector space subtraction

derived_type& Dune::DenseVector< DynamicVector< K > >::operator/= ( const value_type k  )  [inline, inherited]

vector space division by scalar

bool Dune::DenseVector< DynamicVector< K > >::operator== ( const DenseVector< DynamicVector< K > > &  y  )  const [inline, inherited]

Binary vector comparison.

value_type& Dune::DenseVector< DynamicVector< K > >::operator[] ( size_type  i  )  [inline, inherited]

random access

const value_type& Dune::DenseVector< DynamicVector< K > >::operator[] ( size_type  i  )  const [inline, inherited]
Iterator Dune::DenseVector< DynamicVector< K > >::rbegin (  )  [inline, inherited]
Deprecated:
This method was renamed to make it distinct from the STL version which returns a reverse iterator. Use the new method beforeEnd instead.
Deprecated:
ConstIterator Dune::DenseVector< DynamicVector< K > >::rbegin (  )  const [inline, inherited]
Deprecated:
This method was renamed to make it distinct from the STL version which returns a reverse iterator. Use the new method beforeEnd instead.
Deprecated:
ConstIterator Dune::DenseVector< DynamicVector< K > >::rend (  )  const [inline, inherited]
Deprecated:
This method was renamed to make

it distinct from the STL version which returns a reverse iterator. Use the new method beforeBegin instead.

Deprecated:
Iterator Dune::DenseVector< DynamicVector< K > >::rend (  )  [inline, inherited]
Deprecated:
This method was renamed to make it distinct from the STL version which returns a reverse iterator. Use the new method beforeBegin instead.
Deprecated:
template<class K>
void Dune::DynamicVector< K >::reserve ( size_type  n  )  [inline]
template<class K>
void Dune::DynamicVector< K >::resize ( size_type  n,
value_type  c = value_type() 
) [inline]

References c.

size_type Dune::DenseVector< DynamicVector< K > >::size (  )  const [inline, inherited]

size method

Referenced by Dune::DynamicVector< K >::operator>>().

FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K > >::two_norm (  )  const [inline, inherited]

two norm sqrt(sum over squared values of entries)

FieldTraits<value_type>::real_type Dune::DenseVector< DynamicVector< K > >::two_norm2 (  )  const [inline, inherited]

square of two norm (sum over squared values of entries), need for block recursion

template<class K>
const K& Dune::DynamicVector< K >::vec_access ( size_type  i  )  const [inline]
template<class K>
K& Dune::DynamicVector< K >::vec_access ( size_type  i  )  [inline]
template<class K>
size_type Dune::DynamicVector< K >::vec_size (  )  const [inline]

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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].