RTOpPack::ConstSubVectorView< Scalar > Class Template Reference

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

#include <RTOpPack_Types.hpp>

Inheritance diagram for RTOpPack::ConstSubVectorView< Scalar >:

[legend]
List of all members.

Public Member Functions

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

Detailed Description

template<class Scalar>
class RTOpPack::ConstSubVectorView< 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 = 0,...,vec.subDim()-1
  
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(0).

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::ConstSubVectorView< Scalar >::ConstSubVectorView (  )  [inline]

Definition at line 98 of file RTOpPack_Types.hpp.

template<class Scalar>
RTOpPack::ConstSubVectorView< Scalar >::ConstSubVectorView ( Teuchos_Index  globalOffset,
Teuchos_Index  subDim,
const Scalar *  values,
ptrdiff_t  stride 
) [inline]

Definition at line 100 of file RTOpPack_Types.hpp.

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

Definition at line 104 of file RTOpPack_Types.hpp.


Member Function Documentation

template<class Scalar>
void RTOpPack::ConstSubVectorView< Scalar >::initialize ( Teuchos_Index  globalOffset,
Teuchos_Index  subDim,
const Scalar *  values,
ptrdiff_t  stride 
) [inline]

Definition at line 108 of file RTOpPack_Types.hpp.

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

Reimplemented in RTOpPack::SubVectorView< Scalar >.

Definition at line 111 of file RTOpPack_Types.hpp.

template<class Scalar>
void RTOpPack::ConstSubVectorView< Scalar >::setGlobalOffset ( Teuchos_Index  globalOffset  )  [inline]

Definition at line 114 of file RTOpPack_Types.hpp.

template<class Scalar>
Teuchos_Index RTOpPack::ConstSubVectorView< Scalar >::globalOffset (  )  const [inline]

Definition at line 116 of file RTOpPack_Types.hpp.

template<class Scalar>
Teuchos_Index RTOpPack::ConstSubVectorView< Scalar >::subDim (  )  const [inline]

Definition at line 118 of file RTOpPack_Types.hpp.

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

Reimplemented in RTOpPack::SubVectorView< Scalar >.

Definition at line 120 of file RTOpPack_Types.hpp.

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

Definition at line 122 of file RTOpPack_Types.hpp.

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

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

Reimplemented in RTOpPack::SubVectorView< Scalar >.

Definition at line 124 of file RTOpPack_Types.hpp.

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

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

Reimplemented in RTOpPack::SubVectorView< Scalar >.

Definition at line 135 of file RTOpPack_Types.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Oct 20 12:46:12 2009 for Fundamental Vector Reduction/Transformation Operator (RTOp) Interfaces by doxygen 1.4.7