Thyra Operator/Vector Interfaces as an API for the Development of Abstract Numerical Algorithms (ANAs)
[Use Cases for the Foundational Thyra Operator/Vector Interfaces]

While the Foundational Thyra Operator/Vector Interfaces were not principally designed to provide a direct API for the development of ANA software, with some minimal helper functions and classes, directly writing even sophisticated ANA implementations directly in terms of Thyra objects is quite straightforward. More...

Modules

group  Collection of standard multi-vector operations.
group  Collection of all vector operations
group  Helper functions for creating MultiplicativeLinearOp objects.
group  Helper functions for creating scaled/adjoint linear operators.
group  Miscellaneous C++ utility code for testing and debugging.

Classes

class  Thyra::DiagonalLinearOp< Scalar >
 Concrete LinearOpBase subclass for diagonal linear operators. More...
class  Thyra::ExplicitMultiVectorView< Scalar >
 Create an explicit non-mutable (const) view of a MultiVectorBase object. More...
class  Thyra::ExplicitMutableMultiVectorView< Scalar >
 Create an explicit mutable (non-const) view of a MultiVectorBase object. More...
class  Thyra::ExplicitVectorView< Scalar >
 Create an explicit non-mutable (const) view of a VectorBase object. More...
class  Thyra::ExplicitMutableVectorView< Scalar >
 Create an explicit mutable (non-const) view of a VectorBase object. More...
class  Thyra::LinearOpTester< RangeScalar, DomainScalar >
 Testing class for LinearOpBase. More...
class  Thyra::LinearOpWithSolveTester< RangeScalar, DomainScalar >
 Testing class for LinearOpWithSolveBase. More...
class  Thyra::ListedMultiVectorRandomizer< Scalar >
 MultiVectorRandomizerBase subclass that returns a revolving list of preset MultiVectorBase objects. More...
class  Thyra::MultiplicativeLinearOp< Scalar >
 Concrete composite LinearOpBase subclass that creates a multiplicative linear operator out of one or more constituent LinearOpBase objects. More...
class  Thyra::MultiVectorTester< Scalar >
 Unit testing class for a MultiVectorBase object. More...
class  Thyra::ProductVector< Scalar >
 Concrete implementation of a product vector. More...
class  Thyra::ProductVectorSpace< Scalar >
 Standard concrete implementation of a product vector space. More...
class  Thyra::ScaledAdjointLinearOp< Scalar >
 Concrete decorator LinearOpBase subclass that wraps a LinearOpBase object and adds on an extra scaling factor and/or a transpose enum. More...
class  Thyra::UniversalMultiVectorRandomizer< Scalar >
 Univeral MultiVectorRandomizerBase subclass that is compatible with all MultiVectorBase objects. More...
class  Thyra::VectorSpaceTester< Scalar >
 Testing class for VectorSpace and the VectorBase and MultiVectorBase objects that it creates. More...
class  Thyra::VectorTester< Scalar >
 Unit testing class for a VectorBase object. More...

Detailed Description

While the Foundational Thyra Operator/Vector Interfaces were not principally designed to provide a direct API for the development of ANA software, with some minimal helper functions and classes, directly writing even sophisticated ANA implementations directly in terms of Thyra objects is quite straightforward.

It turns out that using Thyra for the development of simple ANAs, as described below, really does not require any deep understanding of the foundational Thyra operator/vector interfaces.

Overview of Using Thyra Software for Development of ANA Software

There are several different types of helper classes and functions that simplify the use of Thyra for the development of ANAs.

  1. "Standard" non-member wrapper functions for vector (and multi-vector) reduction/transformation operations

    While the use of the RTOpPack::RTOpT interface class and the single Thyra::VectorBase::applyOp() function provide an elegant and efficient solution for the interoperability of vector interfaces, it is not the easiest API for developing ANAs. However, a number of easy to use C++ wrapper functions for many different vector and multi-vector operations is already provided:

    These C++ wrapper functions rely on pre-implemented RTOpPack::RTOpT subclasses. Adding new RTOpPack::RTOpT subclasses and new wrapper functions for new vector and multi-vector reduction/transformation operations is an easy matter for an experienced C++ developer who understands RTOpPack::RTOpT (please contact rabartl@sandia.gov if you need a new vector or multi-vector operation that is not already supported).

  2. Creating explicit views of vector and multi-vector elements

    Warning! using the utility classes below it is very easy to obtain direct access to vector and multi-vector elements but in general, this is a very bad idea. However, as described in this report, there are some types of ANAs that require direct element access to certain kinds of vectors and multi-vectors (for example, vectors and multi-vectors that lie is the domain space of a multi-vector). The following utility classes streamline creating and using explicit views.

    One of the big advantages of using the above utility classes in addition to their convenience is that views are freed in destructors and these view will be freed even in the event that an exception is thrown. The use of these view classes is quite straightforward.

  3. Aggregate vector space, vector, multi-vector and linear operator objects

    One of the big advantages of having a set of abstract interfaces to operators and vectors is that it is quite easy to define some very useful aggregate subclasses that allow one or more individual objects be treated as a single object (see the "Composite" and "Decorator" design patterns in the GoF's "Design Patterns" book).

    1. Product vector spaces, vectors and multi-vectors

      One particularly useful category of composite linear algebra objects is the product vector space $\mathcal{X} = \mathcal{V}_1 {}\times \mathcal{V}_2 {}\times {}\ldots {}\times \mathcal{V}_m$ where $\mathcal{V}_k$, for $k = 1 {}\ldots m$, are different constituent vector spaces. Product vector spaces give rise to product vectors

      \[ x = \left[\begin{array}{c} v_1 \\ v_2 \\ \vdots \\ v_m \end{array}\right] \]

      (where $v_1 \in \mathcal{V}_1, v_2 \in \mathcal{V}_2, \ldots, v_m \in \mathcal{V}_m$) and product multi-vectors

      \[ X = \left[\begin{array}{c} V_1 \\ V_2 \\ \vdots \\ V_m \end{array}\right]. \]

      (where $V_1 \in \mathcal{V}_1 | \mathcal{D}, V_2 \in \mathcal{V}_2 | \mathcal{D}, \ldots, V_m \in \mathcal{V}_m | \mathcal{D}$ and $\mathcal{D}$ is the domain space for the multi-vectors).

      Very general concrete implementations of the product vector space, vector and multi-vector interfaces described here are provided and are shown below:

      Note that the above concrete subclasses are very efficient for must, but not all, possible use cases for such composite objects.

      When using product vector spaces, product vectors and product multi-vectors it is generally the case where a concrete Thyra::ProductVectorSpace object is first created and then Thyra::ProductVector and Thyra::ProductMultiVector objects are created by the functions Thyra::ProductVectorSpace::createMember() and Thyra::ProductVectorSpace::createMembers(). See this example of how product vector spaces are used.

    2. Miscellaneous aggregate linear operators

      There are several different types of useful composite Thyra::LinearOpBase subclasses that one can define. A few useful composite linear operator subclasses are shown below:

      • Thyra::DiagonalLinearOp is a simple concrete subclass that defines a diagonal Thyra::LinearOpBase $M = \gamma \; \mbox{diag}(d) \in \Re^{n \times n}$ out of any Thyra::VectorBase object for the diagonal $d \in \Re^n$.
      • Thyra::ScaledAdjointLinearOp is a simple concrete decorator subclass that defines an implicit scaled and/or adjoined (or transposed) linear operator $M = \gamma \; op(A)$.
      • Thyra::MultiplicativeLinearOp is a simple concrete composite subclass that defines a composite multiplicative Thyra::LinearOpBase of the form $M = \gamma \; A_1 A_2 \ldots A_m}$ composed out of one or more constituent linear operators $A_1, A_2 \ldots A_m$.

  4. Unit testing software

    This is basic testing software for Thyra:

  5. Miscellaneous Tools for testing and debugging

    There is software included in the Thyra package to support basic testing and debugging.

    First, 100/% general output stream operators for any Thyra::VectorBase or Thyra::LinearOpBase object are provided in the following operator functions:

Examples of Abstract Numerical Algorithms

There are several code examples that one can study to see how to use the code described here as an API for developing ANAs.

Other Use Cases


Generated on Thu Sep 18 12:39:53 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1