RTOpPack::SubVectorT< Scalar > Class Template Reference

Class for a non-mutable sub-vector. More...

#include <RTOpPack_Types.hpp>

Inheritance diagram for RTOpPack::SubVectorT< Scalar >:

[legend]
List of all members.

Public Member Functions

 SubVectorT ()
 
 SubVectorT (RTOp_index_type globalOffset, RTOp_index_type subDim, const Scalar *values, ptrdiff_t stride)
 
 SubVectorT (const SubVectorT< Scalar > &sv)
 
void initialize (RTOp_index_type globalOffset, RTOp_index_type subDim, const Scalar *values, ptrdiff_t stride)
 
void set_uninitialized ()
 
void setGlobalOffset (RTOp_index_type globalOffset)
 
RTOp_index_type globalOffset () const
 
RTOp_index_type subDim () const
 
const Scalar * values () const
 
ptrdiff_t stride () const
 
const Scalar & operator[] (RTOp_index_type i) const
 Zero-based indexing (Preconditions: values()!=NULL && (0 <= i <= subDim()-1)).
const Scalar & operator() (RTOp_index_type i) const
 One-based indexing (Preconditions: values()!=NULL && (1 <= i <= subDim())).

Detailed Description

template<class Scalar>
class RTOpPack::SubVectorT< Scalar >

Class for a non-mutable sub-vector.

For a sub-vector vec, the corresponding entries in the global vector x(j) (one based) are as follows:


  x( vec.globalOffset() + k ) = v.(k), for k = 1,...,vec.subDim()
  
The stride vec.stride() may be positive (>0), negative (<0) or even zero (0). A negative stride vec.stride() < 0 allows a reverse traversal of the elements. A zero stride vec.stride() allows a sub-vector with all the elements the same.

The raw pointer to the start of the memory can be obtained as &vec(1).

Warning! the default copy constructor and assignment operators are allowed which results in only pointer copy, not deep copy! You have been warned!

Definition at line 95 of file RTOpPack_Types.hpp.


Constructor & Destructor Documentation

template<class Scalar>
RTOpPack::SubVectorT< Scalar >::SubVectorT  )  [inline]
 

Definition at line 98 of file RTOpPack_Types.hpp.

template<class Scalar>
RTOpPack::SubVectorT< Scalar >::SubVectorT RTOp_index_type  globalOffset,
RTOp_index_type  subDim,
const Scalar *  values,
ptrdiff_t  stride
[inline]
 

Definition at line 100 of file RTOpPack_Types.hpp.

template<class Scalar>
RTOpPack::SubVectorT< Scalar >::SubVectorT const SubVectorT< Scalar > &  sv  )  [inline]
 

Definition at line 104 of file RTOpPack_Types.hpp.


Member Function Documentation

template<class Scalar>
void RTOpPack::SubVectorT< Scalar >::initialize RTOp_index_type  globalOffset,
RTOp_index_type  subDim,
const Scalar *  values,
ptrdiff_t  stride
[inline]
 

Definition at line 108 of file RTOpPack_Types.hpp.

template<class Scalar>
void RTOpPack::SubVectorT< Scalar >::set_uninitialized  )  [inline]
 

Reimplemented in RTOpPack::MutableSubVectorT< Scalar >.

Definition at line 111 of file RTOpPack_Types.hpp.

template<class Scalar>
void RTOpPack::SubVectorT< Scalar >::setGlobalOffset RTOp_index_type  globalOffset  )  [inline]
 

Definition at line 114 of file RTOpPack_Types.hpp.

template<class Scalar>
RTOp_index_type RTOpPack::SubVectorT< Scalar >::globalOffset  )  const [inline]
 

Definition at line 116 of file RTOpPack_Types.hpp.

template<class Scalar>
RTOp_index_type RTOpPack::SubVectorT< Scalar >::subDim  )  const [inline]
 

Definition at line 118 of file RTOpPack_Types.hpp.

template<class Scalar>
const Scalar* RTOpPack::SubVectorT< Scalar >::values  )  const [inline]
 

Reimplemented in RTOpPack::MutableSubVectorT< Scalar >.

Definition at line 120 of file RTOpPack_Types.hpp.

template<class Scalar>
ptrdiff_t RTOpPack::SubVectorT< Scalar >::stride  )  const [inline]
 

Definition at line 122 of file RTOpPack_Types.hpp.

template<class Scalar>
const Scalar& RTOpPack::SubVectorT< Scalar >::operator[] RTOp_index_type  i  )  const [inline]
 

Zero-based indexing (Preconditions: values()!=NULL && (0 <= i <= subDim()-1)).

Reimplemented in RTOpPack::MutableSubVectorT< Scalar >.

Definition at line 124 of file RTOpPack_Types.hpp.

template<class Scalar>
const Scalar& RTOpPack::SubVectorT< Scalar >::operator() RTOp_index_type  i  )  const [inline]
 

One-based indexing (Preconditions: values()!=NULL && (1 <= i <= subDim())).

Reimplemented in RTOpPack::MutableSubVectorT< Scalar >.

Definition at line 126 of file RTOpPack_Types.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:39:44 2008 for RTOp : Vector Reduction/Transformation Operators by doxygen 1.3.9.1