Tpetra Matrix/Vector Services  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions
Tpetra::Experimental::LittleVector< Scalar, LO > Class Template Reference

Nonowning view of a set of degrees of freedom corresponding to a mesh point in a block vector or multivector. More...

#include <Tpetra_Experimental_BlockView.hpp>

List of all members.

Public Member Functions

 LittleVector (Scalar *const A, const LO blockSize, const LO stride)
 Constructor.
Scalar * getRawPtr () const
 Pointer to the block's entries.
LO getBlockSize () const
 The block size (number of degrees of freedom per mesh point).
LO getStride () const
 Stride between consecutive entries.
Scalar & operator() (const LO i) const
 Reference to entry (i) of the vector.
template<class LittleVectorType >
void update (const Scalar &alpha, const LittleVectorType &X) const
 *this := *this + alpha * X.
template<class LittleVectorType >
void assign (const LittleVectorType &X) const
 *this := X.
void scale (const Scalar &alpha) const
 (*this)(i,j) := alpha * (*this)(i,j) for all (i,j).
void fill (const Scalar &alpha) const
 (*this)(i,j) := alpha for all (i,j).
template<class LittleVectorType >
void absmax (const LittleVectorType &X) const
 (*this)(i,j) := max(abs((*this)(i,j)), abs(X(i,j))) for all (i,j).
template<class LittleVectorType >
bool equal (const LittleVectorType &X) const
 true if and only if all entries of this equal all entries of X.
template<class LittleBlockType , class LittleVectorType >
void matvecUpdate (const Scalar &alpha, const LittleBlockType &A, const LittleVectorType &X) const
 (*this) := (*this) + alpha * A * X (matrix-vector multiply).

Detailed Description

template<class Scalar, class LO>
class Tpetra::Experimental::LittleVector< Scalar, LO >

Nonowning view of a set of degrees of freedom corresponding to a mesh point in a block vector or multivector.

Template Parameters:
ScalarThe type of entries.
LOThe type of local indices. See the documentation of the first template parameter of Map for requirements.

"Little" means local (not distributed over multiple MPI processes; stored to maximize locality) and small (think length 3, not length 1000).

The Scalar template parameter may be const or nonconst. This is one reason why instance methods below that take a LittleVector accept it as a template parameter: that lets you add a const LittleVector (e.g., LittleVector<const double, int>) to a nonconst LittleVector (e.g., LittleVector<double, int>).

Definition at line 214 of file Tpetra_Experimental_BlockView.hpp.


Constructor & Destructor Documentation

template<class Scalar , class LO >
Tpetra::Experimental::LittleVector< Scalar, LO >::LittleVector ( Scalar *const  A,
const LO  blockSize,
const LO  stride 
) [inline]

Constructor.

Parameters:
A[in] Pointer to the vector's entries
blockSize[in] Dimension of the vector
stride[in] Stride between consecutive entries

Definition at line 223 of file Tpetra_Experimental_BlockView.hpp.


Member Function Documentation

template<class Scalar , class LO >
Scalar* Tpetra::Experimental::LittleVector< Scalar, LO >::getRawPtr ( ) const [inline]

Pointer to the block's entries.

Definition at line 228 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
LO Tpetra::Experimental::LittleVector< Scalar, LO >::getBlockSize ( ) const [inline]

The block size (number of degrees of freedom per mesh point).

Definition at line 233 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
LO Tpetra::Experimental::LittleVector< Scalar, LO >::getStride ( ) const [inline]

Stride between consecutive entries.

Definition at line 238 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
Scalar& Tpetra::Experimental::LittleVector< Scalar, LO >::operator() ( const LO  i) const [inline]

Reference to entry (i) of the vector.

Definition at line 243 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
template<class LittleVectorType >
void Tpetra::Experimental::LittleVector< Scalar, LO >::update ( const Scalar &  alpha,
const LittleVectorType &  X 
) const [inline]

*this := *this + alpha * X.

Definition at line 249 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
template<class LittleVectorType >
void Tpetra::Experimental::LittleVector< Scalar, LO >::assign ( const LittleVectorType &  X) const [inline]

*this := X.

Definition at line 257 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
void Tpetra::Experimental::LittleVector< Scalar, LO >::scale ( const Scalar &  alpha) const [inline]

(*this)(i,j) := alpha * (*this)(i,j) for all (i,j).

Definition at line 264 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
void Tpetra::Experimental::LittleVector< Scalar, LO >::fill ( const Scalar &  alpha) const [inline]

(*this)(i,j) := alpha for all (i,j).

Definition at line 271 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
template<class LittleVectorType >
void Tpetra::Experimental::LittleVector< Scalar, LO >::absmax ( const LittleVectorType &  X) const [inline]

(*this)(i,j) := max(abs((*this)(i,j)), abs(X(i,j))) for all (i,j).

Tpetra uses this operation to implement the ABSMAX CombineMode.

Definition at line 282 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
template<class LittleVectorType >
bool Tpetra::Experimental::LittleVector< Scalar, LO >::equal ( const LittleVectorType &  X) const [inline]

true if and only if all entries of this equal all entries of X.

Definition at line 291 of file Tpetra_Experimental_BlockView.hpp.

template<class Scalar , class LO >
template<class LittleBlockType , class LittleVectorType >
void Tpetra::Experimental::LittleVector< Scalar, LO >::matvecUpdate ( const Scalar &  alpha,
const LittleBlockType &  A,
const LittleVectorType &  X 
) const [inline]

(*this) := (*this) + alpha * A * X (matrix-vector multiply).

Definition at line 306 of file Tpetra_Experimental_BlockView.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines