A sub vector, defined by another vector and an index set. More...

#include <subVector.hh>

Inheritance diagram for concepts::SubVector< F >:
concepts::Function< F > concepts::OutputOperator

Public Member Functions

virtual Function< F > & add (const Function< F > &fnc, F sc)
 Adds a times fnc to this function. More...
 
uint dim () const
 Returns the dimension of the function. More...
 
uint n () const
 Elements in the vector. More...
 
virtual F & operator() (uint i)
 Index operator. More...
 
virtual F operator() (uint i) const
 Index operator. More...
 
virtual Function< F > & operator*= (F sc)
 Scaling operator. More...
 
virtual Function< F > & operator+= (const Function< F > &fnc)
 Addition operator. More...
 
virtual Function< F > & operator+= (F c)
 Addition operator. More...
 
virtual Function< F > & operator-= (const Function< F > &fnc)
 Subtraction operator. More...
 
virtual Function< F > & operator-= (F c)
 Subtraction operator. More...
 
virtual Function< F > & operator= (const Function< F > &fnc)
 Assignment operator. More...
 
template<class H >
Function< F > & operator= (const Function< H > &fnc)
 
SubVector< F > & operator= (F c)
 Assignement operator. More...
 
 SubVector (const Vector< F > &f, const Set< IndexRange > &indices)
 
 SubVector (Vector< F > &f, const Set< IndexRange > &indices)
 Constructor. More...
 
virtual ~SubVector ()
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream. More...
 

Protected Attributes

uint dim_
 Dimension of the function (or of the space the function is defined) More...
 

Private Attributes

const Set< IndexRangeindices_
 Index sets of sub vector. More...
 
Vector< F > * v_
 Vector. More...
 
const Vector< F > * vc_
 Constant vector. More...
 

Detailed Description

template<class F>
class concepts::SubVector< F >

A sub vector, defined by another vector and an index set.

The class SubVector is not a Vector itself, as the data may be not together as in a C array (data structure behind Vector).

For a connected index set you use instead

Vector(uint dim, F* data)

.

Author
, Kersten Schmidt, 2005

Definition at line 28 of file subVector.hh.

Constructor & Destructor Documentation

◆ SubVector() [1/2]

template<class F >
concepts::SubVector< F >::SubVector ( Vector< F > &  f,
const Set< IndexRange > &  indices 
)

Constructor.

◆ SubVector() [2/2]

template<class F >
concepts::SubVector< F >::SubVector ( const Vector< F > &  f,
const Set< IndexRange > &  indices 
)

◆ ~SubVector()

template<class F >
virtual concepts::SubVector< F >::~SubVector ( )
inlinevirtual

Definition at line 34 of file subVector.hh.

Member Function Documentation

◆ add()

template<class F >
virtual Function<F>& concepts::SubVector< F >::add ( const Function< F > &  fnc,
a 
)
virtual

Adds a times fnc to this function.

Reimplemented from concepts::Function< F >.

◆ dim()

template<class F >
uint concepts::Function< F >::dim ( ) const
inlineinherited

Returns the dimension of the function.

Definition at line 53 of file basis.hh.

◆ info()

template<class F >
virtual std::ostream& concepts::SubVector< F >::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from concepts::Function< F >.

◆ n()

template<class F >
uint concepts::SubVector< F >::n ( ) const
inline

Elements in the vector.

Definition at line 76 of file subVector.hh.

◆ operator()() [1/2]

template<class F >
virtual F& concepts::SubVector< F >::operator() ( uint  i)
inlinevirtual

Index operator.

Implements concepts::Function< F >.

Definition at line 52 of file subVector.hh.

◆ operator()() [2/2]

template<class F >
virtual F concepts::SubVector< F >::operator() ( uint  i) const
inlinevirtual

Index operator.

Implements concepts::Function< F >.

Definition at line 56 of file subVector.hh.

◆ operator*=()

template<class F >
virtual Function<F>& concepts::SubVector< F >::operator*= ( a)
virtual

Scaling operator.

Reimplemented from concepts::Function< F >.

◆ operator+=() [1/2]

template<class F >
virtual Function<F>& concepts::SubVector< F >::operator+= ( const Function< F > &  fnc)
virtual

Addition operator.

Reimplemented from concepts::Function< F >.

◆ operator+=() [2/2]

template<class F >
virtual Function<F>& concepts::SubVector< F >::operator+= ( c)
virtual

Addition operator.

Reimplemented from concepts::Function< F >.

◆ operator-=() [1/2]

template<class F >
virtual Function<F>& concepts::SubVector< F >::operator-= ( const Function< F > &  fnc)
virtual

Subtraction operator.

Reimplemented from concepts::Function< F >.

◆ operator-=() [2/2]

template<class F >
virtual Function<F>& concepts::SubVector< F >::operator-= ( c)
virtual

Subtraction operator.

Reimplemented from concepts::Function< F >.

◆ operator=() [1/3]

template<class F >
virtual Function<F>& concepts::SubVector< F >::operator= ( const Function< F > &  fnc)
virtual

Assignment operator.

Implements concepts::Function< F >.

◆ operator=() [2/3]

template<class F >
template<class H >
Function< F > & concepts::SubVector< F >::operator= ( const Function< H > &  fnc)

Definition at line 90 of file subVector.hh.

◆ operator=() [3/3]

template<class F >
SubVector<F>& concepts::SubVector< F >::operator= ( c)

Assignement operator.

Member Data Documentation

◆ dim_

template<class F >
uint concepts::Function< F >::dim_
protectedinherited

Dimension of the function (or of the space the function is defined)

Definition at line 57 of file basis.hh.

◆ indices_

template<class F >
const Set<IndexRange> concepts::SubVector< F >::indices_
private

Index sets of sub vector.

Definition at line 85 of file subVector.hh.

◆ v_

template<class F >
Vector<F>* concepts::SubVector< F >::v_
private

Vector.

Definition at line 81 of file subVector.hh.

◆ vc_

template<class F >
const Vector<F>* concepts::SubVector< F >::vc_
private

Constant vector.

Definition at line 83 of file subVector.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich