Stratimikos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Attributes | List of all members
MyOperator< OrdinalType, ScalarType > Class Template Reference

Simple example of a user's defined Tpetra::Operator class. More...

#include <MyOperator.hpp>

Inherits Operator< OrdinalType, ScalarType >.

Public Member Functions

 MyOperator (const Tpetra::VectorSpace< OrdinalType, ScalarType > &vs, const int nrows, const int *colptr, const int nnz, const int *rowin, const ScalarType *vals)
 Constructor. More...
 
 ~MyOperator ()
 Deconstructor. More...
 

Private Types

typedef std::vector
< ScalarType >::iterator 
STIter
 
typedef std::vector< int >
::iterator 
IntIter
 

Private Attributes

Tpetra::VectorSpace
< OrdinalType, ScalarType > 
_vs
 Tpetra std::vector space. More...
 
int _nr
 Number of rows and columns. More...
 
int _nnz
 
std::vector< int > _cptr
 Column pointers. More...
 
std::vector< int > _rind
 Row indices. More...
 
std::vector< ScalarType > _vals
 Values. More...
 

Functions Overridden from Tpetra::Operator.

Tpetra::VectorSpace
< OrdinalType, ScalarType >
const & 
getDomainDist () const
 Returns the VectorSpace associated with the domain of this linear operator. More...
 
Tpetra::VectorSpace
< OrdinalType, ScalarType >
const & 
getRangeDist () const
 Returns the VectorSpace associated with the range of this linear operator. More...
 
void apply (Tpetra::Vector< OrdinalType, ScalarType > const &x, Tpetra::Vector< OrdinalType, ScalarType > &y, bool transpose=false) const
 Computes the matrix-std::vector multiplication y = Ax. More...
 

Detailed Description

template<class OrdinalType, class ScalarType>
class MyOperator< OrdinalType, ScalarType >

Simple example of a user's defined Tpetra::Operator class.

This is a simple, single processor example of user's defined Tpetra::Operator-derived class. The class is templated on OrdinalType and ScalarType; possible choices are, for example, "float", "double", or "std::complex<double>".

Definition at line 61 of file MyOperator.hpp.

Member Typedef Documentation

template<class OrdinalType , class ScalarType >
typedef std::vector<ScalarType>::iterator MyOperator< OrdinalType, ScalarType >::STIter
private

Definition at line 124 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
typedef std::vector<int>::iterator MyOperator< OrdinalType, ScalarType >::IntIter
private

Definition at line 131 of file MyOperator.hpp.

Constructor & Destructor Documentation

template<class OrdinalType , class ScalarType >
MyOperator< OrdinalType, ScalarType >::MyOperator ( const Tpetra::VectorSpace< OrdinalType, ScalarType > &  vs,
const int  nrows,
const int *  colptr,
const int  nnz,
const int *  rowin,
const ScalarType *  vals 
)
inline

Constructor.

Definition at line 67 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
MyOperator< OrdinalType, ScalarType >::~MyOperator ( )
inline

Deconstructor.

Definition at line 78 of file MyOperator.hpp.

Member Function Documentation

template<class OrdinalType , class ScalarType >
Tpetra::VectorSpace<OrdinalType,ScalarType> const& MyOperator< OrdinalType, ScalarType >::getDomainDist ( ) const
inline

Returns the VectorSpace associated with the domain of this linear operator.

Definition at line 86 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
Tpetra::VectorSpace<OrdinalType,ScalarType> const& MyOperator< OrdinalType, ScalarType >::getRangeDist ( ) const
inline

Returns the VectorSpace associated with the range of this linear operator.

Definition at line 89 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
void MyOperator< OrdinalType, ScalarType >::apply ( Tpetra::Vector< OrdinalType, ScalarType > const &  x,
Tpetra::Vector< OrdinalType, ScalarType > &  y,
bool  transpose = false 
) const
inline

Computes the matrix-std::vector multiplication y = Ax.

Definition at line 92 of file MyOperator.hpp.

Member Data Documentation

template<class OrdinalType , class ScalarType >
Tpetra::VectorSpace<OrdinalType,ScalarType> MyOperator< OrdinalType, ScalarType >::_vs
private

Tpetra std::vector space.

Definition at line 134 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
int MyOperator< OrdinalType, ScalarType >::_nr
private

Number of rows and columns.

Definition at line 137 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
int MyOperator< OrdinalType, ScalarType >::_nnz
private

Definition at line 137 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
std::vector<int> MyOperator< OrdinalType, ScalarType >::_cptr
private

Column pointers.

Definition at line 139 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
std::vector<int> MyOperator< OrdinalType, ScalarType >::_rind
private

Row indices.

Definition at line 141 of file MyOperator.hpp.

template<class OrdinalType , class ScalarType >
std::vector<ScalarType> MyOperator< OrdinalType, ScalarType >::_vals
private

Values.

Definition at line 143 of file MyOperator.hpp.


The documentation for this class was generated from the following file: