Dune Core Modules (2.3.1)

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

#include <dune/common/dynvector.hh>

Public Types

enum  
 We are at the leaf of the block recursion.
 
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. More...
 
value_type & operator[] (size_type i)
 random access
 
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 beforeEnd ()
 
ConstIterator beforeEnd () 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< Other > &y)
 vector space addition
 
derived_typeoperator+= (const value_type &k)
 vector space add scalar to all comps
 
derived_typeoperator-= (const DenseVector< Other > &y)
 vector space subtraction
 
derived_typeoperator-= (const value_type &k)
 vector space subtract scalar from all comps
 
derived_type operator+ (const DenseVector< Other > &b) const
 Binary vector addition.
 
derived_type operator- (const DenseVector< Other > &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< Other > &y) const
 Binary vector comparison.
 
bool operator!= (const DenseVector< Other > &y) const
 Binary vector incomparison.
 
derived_typeaxpy (const value_type &a, const DenseVector< Other > &y)
 vector space axpy operation ( *this += a y )
 
PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType operator* (const DenseVector< Other > &y) const
 indefinite vector dot product \(\left (x^T \cdot y \right)\) which corresponds to Petsc's VecTDot More...
 
PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType dot (const DenseVector< Other > &y) const
 vector dot product \(\left (x^H \cdot y \right)\) which corresponds to Petsc's VecDot More...
 
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. More...
 
std::ostream & operator<< (std::ostream &s, const DenseVector< DynamicVector< K > > &v)
 Write a DenseVector to an output stream. More...
 

Detailed Description

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

Construct a vector with a dynamic size.

Template Parameters
Kis the field type (use float, double, complex, etc)

Member Function Documentation

◆ beforeBegin() [1/2]

Iterator Dune::DenseVector< DynamicVector< K > >::beforeBegin ( )
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeBegin() [2/2]

ConstIterator Dune::DenseVector< DynamicVector< K > >::beforeBegin ( ) const
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeEnd() [1/2]

Iterator Dune::DenseVector< DynamicVector< K > >::beforeEnd ( )
inlineinherited
Returns
an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.

◆ beforeEnd() [2/2]

ConstIterator Dune::DenseVector< DynamicVector< K > >::beforeEnd ( ) const
inlineinherited
Returns
an iterator that is positioned before the end iterator of the vector. i.e. at the last element

◆ capacity()

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().

◆ dot()

PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType Dune::DenseVector< DynamicVector< K > >::dot ( const DenseVector< Other > &  y) const
inlineinherited

vector dot product \(\left (x^H \cdot y \right)\) which corresponds to Petsc's VecDot

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecDot.html

Parameters
yother vector
Returns

◆ operator*()

PromotionTraits< field_type, typenameDenseVector< Other >::field_type >::PromotedType Dune::DenseVector< DynamicVector< K > >::operator* ( const DenseVector< Other > &  y) const
inlineinherited

indefinite vector dot product \(\left (x^T \cdot y \right)\) which corresponds to Petsc's VecTDot

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecTDot.html

Parameters
yother vector
Returns

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  s,
const DenseVector< DynamicVector< K > > &  v 
)
related

Write a DenseVector to an output stream.

Parameters
[in]sstd :: ostream to write to
[in]vDenseVector to write
Returns
the output stream (s)

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)