Stratimikos Package Browser (Single Doxygen Collection)  Version of the Day
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>".

Warning
This class is almost certainly broken; Tpetra::Operator has a different interface now.

Definition at line 63 of file MyOperator.hpp.

Member Typedef Documentation

◆ STIter

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

Definition at line 126 of file MyOperator.hpp.

◆ IntIter

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

Definition at line 133 of file MyOperator.hpp.

Constructor & Destructor Documentation

◆ MyOperator()

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 69 of file MyOperator.hpp.

◆ ~MyOperator()

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

Deconstructor.

Definition at line 80 of file MyOperator.hpp.

Member Function Documentation

◆ getDomainDist()

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 88 of file MyOperator.hpp.

◆ getRangeDist()

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 91 of file MyOperator.hpp.

◆ apply()

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 94 of file MyOperator.hpp.

Member Data Documentation

◆ _vs

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

Tpetra std::vector space.

Definition at line 136 of file MyOperator.hpp.

◆ _nr

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

Number of rows and columns.

Definition at line 139 of file MyOperator.hpp.

◆ _nnz

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

Definition at line 139 of file MyOperator.hpp.

◆ _cptr

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

Column pointers.

Definition at line 141 of file MyOperator.hpp.

◆ _rind

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

Row indices.

Definition at line 143 of file MyOperator.hpp.

◆ _vals

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

Values.

Definition at line 145 of file MyOperator.hpp.


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