ExampleTridiagSerialLinearOp< Scalar > Class Template Reference
[Templated Serial Implementation of the Power MethodTemplated Serial Implementation of the CG Method]

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

#include <ExampleTridiagSerialLinearOp.hpp>

Inheritance diagram for ExampleTridiagSerialLinearOp< Scalar >:

[legend]
List of all members.

Public Member Functions

 ExampleTridiagSerialLinearOp ()
 Construct to uninitialized.
 ExampleTridiagSerialLinearOp (const Thyra::Index dim, const Scalar lower[], const Scalar diag[], const Scalar upper[])
 Calls initialize().
void initialize (const Thyra::Index dim, const Scalar lower[], const Scalar diag[], const Scalar upper[])

Detailed Description

template<class Scalar>
class ExampleTridiagSerialLinearOp< Scalar >

Simple example subclass for serial tridiagonal matrices.

This subclass form a linear operator for tridiagonal matrices of the 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] \]

given the arrays lower[], diag[], and upper[] of dimension dim-1, dim and dim-1 respectively (see initialize()).

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:

ExampleTridiagSerialLinearOp.hpp, sillyCgSolve_serial.cpp, and sillyPowerMethod_serial.cpp.

Definition at line 69 of file ExampleTridiagSerialLinearOp.hpp.


Constructor & Destructor Documentation

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

Construct to uninitialized.

Definition at line 83 of file ExampleTridiagSerialLinearOp.hpp.

template<class Scalar>
ExampleTridiagSerialLinearOp< Scalar >::ExampleTridiagSerialLinearOp const Thyra::Index  dim,
const Scalar  lower[],
const Scalar  diag[],
const Scalar  upper[]
[inline]
 

Calls initialize().

Definition at line 86 of file ExampleTridiagSerialLinearOp.hpp.


Member Function Documentation

template<class Scalar>
void ExampleTridiagSerialLinearOp< Scalar >::initialize const Thyra::Index  dim,
const Scalar  lower[],
const Scalar  diag[],
const Scalar  upper[]
[inline]
 

Initialize given lower, diagonal and upper arrays of data.

Parameters:
dim [in] Dimension of this matrix (must be >= 2).
lower [in] Array (length dim-1) of the lower diagonal elements
diag [in] Array (length dim) of the central diagonal elements
upper [in] Array (length dim-1) of the upper diagonal elements
Preconditions:
  • dim >= 2

Postconditions:

  • Should be obvious!
  • See setDimensions()

Definition at line 105 of file ExampleTridiagSerialLinearOp.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