ExampleTridiagSpmdLinearOp< Scalar > Class Template Reference
[Templated SPMD Implementation of the CG Method]

Simple example subclass for Spmd tridiagonal matrices. More...

#include <ExampleTridiagSpmdLinearOp.hpp>

Inheritance diagram for ExampleTridiagSpmdLinearOp< Scalar >:

[legend]
List of all members.

Public Member Functions

 ExampleTridiagSpmdLinearOp ()
 Construct to uninitialized.
 ExampleTridiagSpmdLinearOp (const Teuchos::RefCountPtr< const Teuchos::Comm< Thyra::Index > > &comm, const Thyra::Index localDim, const Scalar lower[], const Scalar diag[], const Scalar upper[])
 Calls initialize().
void initialize (const Teuchos::RefCountPtr< const Teuchos::Comm< Thyra::Index > > &comm, const Thyra::Index localDim, const Scalar lower[], const Scalar diag[], const Scalar upper[])

Detailed Description

template<class Scalar>
class ExampleTridiagSpmdLinearOp< Scalar >

Simple example subclass for Spmd tridiagonal matrices.

This subclass represents a linear operator for tridiagonal matrices of the global form:

\[ M= \left[\begin{array}{ccccc} d_{(1)} & u_{(1)} \\ l_{(1)} & d_{(2)} & u_{(2)} \\ & \ddots & \ddots & \ddots \\ & & l_{(n-2)} & d_{(n-1)} & u_{(n-1)} \\ & & & l_{(n-1)} & d_{(n)} \end{array}\right]. \]

If there is only $N = 1$ processes then the arrays lower[], diag[], and upper[] of dimension localDim-1, localDim and localDim-1 respectively are stored (see initialize()).

If there $N > 1$ processes then locally this class stores slightly different arrays of data depending on which process this is and process-to-process communication is required.

Note, this is just an example class and for the sake of simplified presentation the private members are listed first and in-class declarations are used which are not a good idea in production code. However, in this case, they make the example code easier to read and maintaining encapsulation and a well defined interface are unnecessary here.

See the source code for this simple example by clicking on the link to the definition below.

Examples:

ExampleTridiagSpmdLinearOp.hpp, and sillyCgSolve_mpi.cpp.

Definition at line 133 of file ExampleTridiagSpmdLinearOp.hpp.


Constructor & Destructor Documentation

template<class Scalar>
ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp  )  [inline]
 

Construct to uninitialized.

Definition at line 152 of file ExampleTridiagSpmdLinearOp.hpp.

template<class Scalar>
ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp const Teuchos::RefCountPtr< const Teuchos::Comm< Thyra::Index > > &  comm,
const Thyra::Index  localDim,
const Scalar  lower[],
const Scalar  diag[],
const Scalar  upper[]
[inline]
 

Calls initialize().

Definition at line 155 of file ExampleTridiagSpmdLinearOp.hpp.


Member Function Documentation

template<class Scalar>
void ExampleTridiagSpmdLinearOp< Scalar >::initialize const Teuchos::RefCountPtr< const Teuchos::Comm< Thyra::Index > > &  comm,
const Thyra::Index  localDim,
const Scalar  lower[],
const Scalar  diag[],
const Scalar  upper[]
[inline]
 

Initialize given lower, diagonal and upper arrays of data.

Parameters:
comm [in] Communicator (allowed to be Teuchos::null)
localDim [in] Dimension of this matrix (must be >= 2).
lower [in] Array (length ( procRank == 0 ? localDim - 1 : localDim )) of the lower diagonal elements
diag [in] Array (length localDim) of the central diagonal elements
upper [in] Array (length ( procRank == numProc-1 ? localDim - 1 : localDim )) of the upper diagonal elements
Preconditions:
  • localDim >= 2

Postconditions:

Definition at line 179 of file ExampleTridiagSpmdLinearOp.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:32:32 2008 for Thyra Operator/Vector Support by doxygen 1.3.9.1