Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Attributes | List of all members
MyBetterOperator< ScalarType > Class Template Reference

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

#include <MyBetterOperator.hpp>

Inheritance diagram for MyBetterOperator< ScalarType >:
Inheritance graph
[legend]

Public Member Functions

 MyBetterOperator (const int nrows, const int *colptr, const int nnz, const int *rowin, const ScalarType *vals)
 Constructor. More...
 
 ~MyBetterOperator ()
 Deconstructor. More...
 
void Apply (const Belos::MultiVec< ScalarType > &X, Belos::MultiVec< ScalarType > &Y, Belos::ETrans trans=Belos::NOTRANS) const
 Applies the matrix to a multivector. More...
 
void Print (std::ostream &os)
 
- Public Member Functions inherited from Belos::Operator< ScalarType >
 Operator ()
 Default constructor (does nothing). More...
 
virtual ~Operator ()
 Virtual destructor, for memory safety of derived classes. More...
 
virtual bool HasApplyTranspose () const
 Whether this operator implements applying the transpose. More...
 

Private Types

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

Private Attributes

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...
 

Detailed Description

template<class ScalarType>
class MyBetterOperator< ScalarType >

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

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

This class is based on the MyOperator class written by Oscar Chinallato (ETHZ/ICOS) and Marzio Sala (ETHZ/COLAB)

Author
Christopher Baker (FSU/SCS,SNL/CSRI)

Definition at line 66 of file MyBetterOperator.hpp.

Member Typedef Documentation

template<class ScalarType >
typedef std::vector<ScalarType>::iterator MyBetterOperator< ScalarType >::STIter
private

Definition at line 134 of file MyBetterOperator.hpp.

template<class ScalarType >
typedef std::vector<int>::iterator MyBetterOperator< ScalarType >::IntIter
private

Definition at line 135 of file MyBetterOperator.hpp.

Constructor & Destructor Documentation

template<class ScalarType >
MyBetterOperator< ScalarType >::MyBetterOperator ( const int  nrows,
const int *  colptr,
const int  nnz,
const int *  rowin,
const ScalarType *  vals 
)
inline

Constructor.

Definition at line 72 of file MyBetterOperator.hpp.

template<class ScalarType >
MyBetterOperator< ScalarType >::~MyBetterOperator ( )
inline

Deconstructor.

Definition at line 82 of file MyBetterOperator.hpp.

Member Function Documentation

template<class ScalarType >
void MyBetterOperator< ScalarType >::Apply ( const Belos::MultiVec< ScalarType > &  X,
Belos::MultiVec< ScalarType > &  Y,
Belos::ETrans  trans = Belos::NOTRANS 
) const
inlinevirtual

Applies the matrix to a multivector.

Implements Belos::Operator< ScalarType >.

Definition at line 86 of file MyBetterOperator.hpp.

template<class ScalarType >
void MyBetterOperator< ScalarType >::Print ( std::ostream &  os)
inline

Definition at line 123 of file MyBetterOperator.hpp.

Member Data Documentation

template<class ScalarType >
int MyBetterOperator< ScalarType >::_nr
private

Number of rows and columns.

Definition at line 137 of file MyBetterOperator.hpp.

template<class ScalarType >
int MyBetterOperator< ScalarType >::_nnz
private

Definition at line 137 of file MyBetterOperator.hpp.

template<class ScalarType >
std::vector<int> MyBetterOperator< ScalarType >::_cptr
private

Column pointers.

Definition at line 139 of file MyBetterOperator.hpp.

template<class ScalarType >
std::vector<int> MyBetterOperator< ScalarType >::_rind
private

Row indices.

Definition at line 141 of file MyBetterOperator.hpp.

template<class ScalarType >
std::vector<ScalarType> MyBetterOperator< ScalarType >::_vals
private

Values.

Definition at line 143 of file MyBetterOperator.hpp.


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