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

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

#include <MyOperator.hpp>

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

Public Member Functions

 MyOperator (const int NumRows)
 
 MyOperator (const int NumRows, std::vector< ScalarType > ldu)
 
 MyOperator (std::vector< ScalarType > diag)
 
 ~MyOperator ()
 Dtor. More...
 
void Apply (const Belos::MultiVec< ScalarType > &X, Belos::MultiVec< ScalarType > &Y, Belos::ETrans trans=Belos::NOTRANS) const
 Applies the tridiagonal or diagonal matrix to a multivector. More...
 
- 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 Attributes

int NumRows_
 Number of rows and columns. More...
 
ScalarType l_
 Elements on subdiagonal, diagonal, and superdiagonal. More...
 
ScalarType d_
 
ScalarType u_
 
std::vector< ScalarType > diag_
 Elements on diagonal (for variable-diagonal case). More...
 

Detailed Description

template<class ScalarType>
class MyOperator< 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 file can be easily extended to tackle more interesting cases.

Author
Oscar Chinallato (ETHZ/ICOS) and Marzio Sala (ETHZ/COLAB)
Date
Last modified on 01-Nov-05

Definition at line 65 of file MyOperator.hpp.

Constructor & Destructor Documentation

template<class ScalarType >
MyOperator< ScalarType >::MyOperator ( const int  NumRows)
inline

Definition at line 74 of file MyOperator.hpp.

template<class ScalarType >
MyOperator< ScalarType >::MyOperator ( const int  NumRows,
std::vector< ScalarType >  ldu 
)
inline

Definition at line 83 of file MyOperator.hpp.

template<class ScalarType >
MyOperator< ScalarType >::MyOperator ( std::vector< ScalarType >  diag)
inline

Definition at line 92 of file MyOperator.hpp.

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

Dtor.

Definition at line 101 of file MyOperator.hpp.

Member Function Documentation

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

Applies the tridiagonal or diagonal matrix to a multivector.

Implements Belos::Operator< ScalarType >.

Definition at line 105 of file MyOperator.hpp.

Member Data Documentation

template<class ScalarType >
int MyOperator< ScalarType >::NumRows_
private

Number of rows and columns.

Definition at line 157 of file MyOperator.hpp.

template<class ScalarType >
ScalarType MyOperator< ScalarType >::l_
private

Elements on subdiagonal, diagonal, and superdiagonal.

Definition at line 159 of file MyOperator.hpp.

template<class ScalarType >
ScalarType MyOperator< ScalarType >::d_
private

Definition at line 159 of file MyOperator.hpp.

template<class ScalarType >
ScalarType MyOperator< ScalarType >::u_
private

Definition at line 159 of file MyOperator.hpp.

template<class ScalarType >
std::vector<ScalarType> MyOperator< ScalarType >::diag_
private

Elements on diagonal (for variable-diagonal case).

Definition at line 161 of file MyOperator.hpp.


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