|
Thyra Version of the Day
|
While the Thyra operator/vector fundamental 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...

Classes | |
| class | Thyra::DefaultAddedLinearOp< Scalar > |
| Concrete composite LinearOpBase subclass that creates an implicitly added linear operator out of one or more constituent LinearOpBase objects. More... | |
| class | Thyra::DefaultBlockedLinearOp< Scalar > |
| Concrete composite LinearOpBase subclass that creates single linear operator object out of a set of constituent LinearOpBase blocks. More... | |
| class | Thyra::DefaultDiagonalLinearOp< Scalar > |
| Default concrete LinearOpBase subclass for diagonal linear operators. More... | |
| class | Thyra::DefaultIdentityLinearOp< Scalar > |
| Represents a identity linear operator M = I. More... | |
| class | Thyra::DefaultMultipliedLinearOp< Scalar > |
| Concrete composite LinearOpBase subclass that creates an implicitly multiplied linear operator out of one or more constituent LinearOpBase objects. More... | |
| class | Thyra::DefaultMultiVectorProductVector< Scalar > |
| Concrete implementation of a product vector which is really composed out of the columns of a multi-vector. More... | |
| class | Thyra::DefaultMultiVectorProductVectorSpace< Scalar > |
| Standard concrete implementation of a product vector space that creates product vectors fromed implicitly from the columns of a multi-vector. More... | |
| class | Thyra::DefaultProductMultiVector< Scalar > |
| Concrete implementation of a product multi-vector. More... | |
| class | Thyra::DefaultProductVector< Scalar > |
| Concrete implementation of a product vector. More... | |
| class | Thyra::DefaultProductVectorSpace< Scalar > |
| class | Thyra::DefaultScaledAdjointLinearOp< 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::DefaultZeroLinearOp< Scalar > |
| Represents a zero linear operator M = 0. More... | |
| class | Thyra::ConstDetachedMultiVectorView< Scalar > |
| Create an explicit non-mutable (const) view of a MultiVectorBase object. More... | |
| class | Thyra::DetachedMultiVectorView< Scalar > |
| Create an explicit mutable (non-const) view of a MultiVectorBase object. More... | |
| class | Thyra::ConstDetachedVectorView< Scalar > |
| Create an explicit non-mutable (const) view of a VectorBase object. More... | |
| class | Thyra::DetachedVectorView< Scalar > |
| Create an explicit mutable (non-const) view of a VectorBase object. More... | |
| class | Thyra::LinearOpDefaultBase< Scalar > |
| Node subclass that provides a good default implementation for the describe() function. More... | |
| class | Thyra::LinearOpTester< Scalar > |
| Testing class for LinearOpBase. More... | |
| class | Thyra::ListedMultiVectorRandomizer< Scalar > |
| MultiVectorRandomizerBase subclass that returns a revolving list of preset MultiVectorBase objects. More... | |
| class | Thyra::MultiVectorDefaultBase< Scalar > |
| Node subclass that uses a default MultiVectorBase implementation to provide default implementations for as many other functions in MultiVectorBase interface the as is reasonable. More... | |
| class | Thyra::MultiVectorTester< Scalar > |
| Unit testing class for a MultiVectorBase object. More... | |
| class | Thyra::ParameterDrivenMultiVectorInput< Scalar > |
| Concrete utility class that an ANA can use for reading in a (multi)vector as directed by a parameter sublist. More... | |
| class | Thyra::UniversalMultiVectorRandomizer< Scalar > |
| Univeral MultiVectorRandomizerBase subclass that is compatible with all MultiVectorBase objects. More... | |
| class | Thyra::VectorDefaultBase< Scalar > |
| Convenient node subclass for concrete VectorBase subclasses that relies on a default MultiVectorBase implementation. More... | |
| class | Thyra::VectorSpaceDefaultBase< Scalar > |
| Node VectorSpaceBase subclass that provides default implementations for many functions using a default multi-vectors implementation. 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... | |
| class | Thyra::DefaultBlockedTriangularLinearOpWithSolve< Scalar > |
| Concrete composite LinearOpWithSolveBase subclass that creates single upper or lower block triangular LOWSB object out of a set of LOWSB objects along the diagonal with LOB objects off diagonal. More... | |
| class | Thyra::DefaultInverseLinearOp< Scalar > |
| Concrete LinearOpBase subclass that creates an implicit LinearOpBase object using the inverse action of a LinearOpWithSolveBase object. More... | |
| class | Thyra::LinearOpWithSolveTester< Scalar > |
| Testing class for LinearOpWithSolveBase. More... | |
Macros | |
| #define | THYRA_ASSERT_LHS_ARG(FUNC_NAME, LHS_ARG) |
| This macro just asserts that a LHS argument is set. | |
| #define | THYRA_ASSERT_VEC_SPACES_NAMES(FUNC_NAME, VS1, VS1_NAME, VS2, VS2_NAME) |
| Helper assertion macro. | |
| #define | THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2) |
| This is a very useful macro that should be used to validate that two vector spaces are compatible. | |
| #define | THYRA_ASSERT_MAT_VEC_SPACES(FUNC_NAME, M, M_T, M_VS, VS) |
| This macro validates that a linear operator and a vector space for the domain vector are compatible. | |
| #define | THYRA_ASSERT_LINEAR_OP_VEC_APPLY_SPACES(FUNC_NAME, M, M_T, X, Y) |
| This is a very useful macro that should be used to validate that the spaces for the vector version of the LinearOpBase::apply() function (or related operations). | |
| #define | THYRA_ASSERT_LINEAR_OP_MULTIVEC_APPLY_SPACES(FUNC_NAME, M, M_T, X, Y) |
| This is a very useful macro that should be used to validate that the spaces for the multi-vector version of the LinearOpBase::apply() function (or related operations). | |
| #define | THYRA_ASSERT_LINEAR_OP_PLUS_LINEAR_OP_SPACES_NAMES(FUNC_NAME, M1, M1_T, M1_N, M2, M2_T, M2_N) |
| Assert that a linear operator addition matches up. | |
| #define | THYRA_ASSERT_LINEAR_OP_TIMES_LINEAR_OP_SPACES_NAMES(FUNC_NAME, M1, M1_T, M1_N, M2, M2_T, M2_N) |
| Assert that a linear operator multiplication matches up. | |
| #define | THYRA_ASSERT_MAT_MAT_SPACES(FUNC_NAME, M1, M1_T, M1_VS, M2, M2_T, M2_VS) |
| Helper assertion macro. | |
Enumerations | |
| enum | Thyra::EThrowOnSolveFailure { Thyra::THROW_ON_SOLVE_FAILURE =1 , Thyra::IGNORE_SOLVE_FAILURE =0 } |
| Determines what to do if inverse solve fails. More... | |
Functions | |
| template<class Scalar> | |
| const Thyra::VectorSpaceBase< Scalar > & | Thyra::linear_op_op (const Thyra::LinearOpBase< Scalar > &M, Thyra::EOpTransp M_trans, EM_VS M_VS) |
| Utility function for selecting domain or range spaces. | |
| const std::string | Thyra::passfail (const bool result) |
| template<class Scalar> | |
| Teuchos::ScalarTraits< Scalar >::magnitudeType | Thyra::relErr (const Scalar &s1, const Scalar &s2) |
| template<class Scalar> | |
| Teuchos::ScalarTraits< Scalar >::magnitudeType | Thyra::relVectorErr (const VectorBase< Scalar > &v1, const VectorBase< Scalar > &v2) |
| Return relative error of two vectors. | |
| template<class Scalar1, class Scalar2, class ScalarMag> | |
| bool | Thyra::testRelErrors (const std::string &v1_name, const ArrayView< const Scalar1 > &v1, const std::string &v2_name, const ArrayView< const Scalar2 > &v2, const std::string &maxRelErr_error_name, const ScalarMag &maxRelErr_error, const std::string &maxRelErr_warning_name, const ScalarMag &maxRelErr_warning, const Ptr< std::ostream > &out, const std::string &leadingIndent=std::string("")) |
| Compute, check and optionally print the relative errors in two scalar arays. | |
| template<class Scalar> | |
| bool | Thyra::testRelNormDiffErr (const std::string &v1_name, const VectorBase< Scalar > &v1, const std::string &v2_name, const VectorBase< Scalar > &v2, const std::string &maxRelErr_error_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &maxRelErr_error, const std::string &maxRelErr_warning_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &maxRelErr_warning, std::ostream *out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_LOW, const std::string &leadingIndent=std::string("")) |
| Compute, check and optionally print the relative errors in two vectors. | |
| template<class Scalar> | |
| bool | Thyra::testMaxErr (const std::string &error_name, const Scalar &error, const std::string &max_error_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &max_error, const std::string &max_warning_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &max_warning, std::ostream *out, const std::string &leadingIndent=std::string("")) |
| Check that an error is less than some error tolerence. | |
| template<class Scalar> | |
| bool | Thyra::testMaxErrors (const std::string &error_name, const ArrayView< const typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &errors, const std::string &max_error_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &max_error, const std::string &max_warning_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &max_warning, const Ptr< std::ostream > &out, const std::string &leadingIndent=std::string("")) |
| Check that an array of errors is less than some error tolerence. | |
| bool | Thyra::testBoolExpr (const std::string &boolExprName, const bool &boolExpr, const bool &boolExpected, const Ptr< std::ostream > &out, const std::string &leadingIndent=std::string("")) |
| Check a boolean result against expected result. | |
| template<class Scalar> | |
| std::ostream & | Thyra::operator<< (std::ostream &o, const VectorBase< Scalar > &v) |
| Output operator to pretty print any Thyra::VectorBase object. | |
| template<class Scalar> | |
| std::ostream & | Thyra::operator<< (std::ostream &o, const LinearOpBase< Scalar > &M) |
| Output operator to pretty print any Thyra::LinearOpBase (and therefore MultiVectorBase) object. | |
While the Thyra operator/vector fundamental 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.@section Thyra_Op_Vec_ANA_Development_overview_sec Overview of Using Thyra Software for Development of ANA SoftwareThere are several different types of helper classes and functions thatsimplify the use of %Thyra for the development of ANAs. Standard" non-member wrapper functions for vector (and multi-vector) reduction/transformation operations</b> While the use of the <tt>RTOpPack::RTOpT</tt> interface class and the single <tt>Thyra::VectorBase::applyOp()</tt> 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: <ul> <li> \ref Thyra_Op_Vec_VectorStdOps_grp <li> \ref Thyra_Op_Vec_MultiVectorStdOps_grp </ul> These C++ wrapper functions rely on pre-implemented <tt>RTOpPack::RTOpT</tt> subclasses. Adding new <tt>RTOpPack::RTOpT</tt> 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 <tt>RTOpPack::RTOpT</tt> (please contact rabartl@sandia.gov if you need a new vector or multi-vector operation that is not already supported). <li> <b>Implicit vector space, vector, multi-vector and linear operator subclasses</b> 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). <ol> <li> <b>Implicit product vector spaces, vectors and multi-vectors</b> One particularly useful category of composite linear algebra objects is the product vector space \iline 198 \_form#1@_fakenl where \_form#2, for \_form#3, are different constituent vector spaces. Product vector spaces give rise to product vectors \iline 203 \iline 204 \_form#4@_fakenl@_fakenl (where \iline 207 \_form#5@_fakenl) and product multi-vectors \iline 210 \iline 211 \_form#6@_fakenl@_fakenl (where \iline 214 \_form#7@_fakenl and \_form#8 is the domain space for the multi-vectors). Very general concrete implementations of the product vector space, vector and multi-vector interfaces described \ref Thyra_Op_Vec_Interoperability_Extended_Interfaces_sec "here" are provided and are shown below: <ul> <li><tt>Thyra::DefaultProductVectorSpace</tt> is a general concrete implementation of <tt>Thyra::ProductVectorSpaceBase</tt> that should be sufficient for most use cases. <li><tt>Thyra::DefaultProductVector</tt> is a general concrete implementation of <tt>Thyra::ProductVectorBase</tt> that should be sufficient for most use cases. <li><tt>Thyra::DefaultProductMultiVector</tt> is a general concrete implementation of <tt>Thyra::ProductMultiVectorBase</tt> that should be sufficient for most use cases. </ul> 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 <tt>Thyra::DefaultProductVectorSpace</tt> object is first created and then <tt>Thyra::DefaultProductVector</tt> and <tt>Thyra::DefaultProductMultiVector</tt> objects are created by the functions <tt>Thyra::DefaultProductVectorSpace::createMember()</tt> and <tt>Thyra::DefaultProductVectorSpace::createMembers()</tt>. See \ref Thyra_Op_Vec_product_vec_spc_prg_grp "this example" of how product vector spaces are used. <li> <b>Miscellaneous implicit linear operators</b>@anchor thyra_impicit_linear_operators_tag These are several different types of useful implicit composite/decorator <tt>Thyra::LinearOpBase</tt> subclasses. These concrete subclasses provide the building blocks for arbitararly complex implicitly composed linear operators. Default implementations for these implicit linear operator subclasses are shown below: <ul> <li><tt>Thyra::DefaultZeroLinearOp</tt> is used to define a zero linear operator of the form: \_form#9 defined in terms of two vector spaces (a range and a domain). <li><tt>Thyra::DefaultIdentityLinearOp</tt> is used to define an identity linear operator of the form: \_form#10 defined in terms of a single vector space. <li><tt>Thyra::DefaultDiagonalLinearOp</tt> is a simple concrete subclass that defines a diagonal linear operator \_form#11 out of any <tt>Thyra::VectorBase</tt> object for the diagonal \_form#12. <li><tt>Thyra::DefaultScaledAdjointLinearOp</tt> is a simple concrete decorator subclass that defines an implicit scaled and/or adjoined (or transposed) linear operator \_form#13. <li><tt>Thyra::DefaultAddedLinearOp</tt> is a simple concrete composite subclass that represent the implicit addition of two or more constituent <tt>Thyra::LinearOpBase</tt> objects of the form \_form#14 composed out of one or more constituent linear operators \_form#15. <li><tt>Thyra::DefaultMultipliedLinearOp</tt> is a simple concrete composite subclass that defines a composite multiplicative <tt>Thyra::LinearOpBase</tt> of the form \_form#16 composed out of one or more constituent linear operators \_form#15. <li><tt>Thyra::DefaultBlockedLinearOp</tt> is a simple concrete composite subclass that defines a composite blocking of <tt>Thyra::LinearOpBase</tt> objects of the form \iline 304 \iline 305 \iline 306 \iline 307 \iline 308 \_form#17@_fakenl@_fakenl@_fakenl@_fakenl@_fakenl composed out of one or more constituent linear operators. </ul> </ol> <li> <b>Creating explicit views of vector and multi-vector elements</b> <b>Warning!</b> 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 <a href="http://trilinos.sandia.gov/packages/tsfcore/TSFCoreSAND.pdf">this report</a>, 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. <ul> <li><tt>Thyra::ConstDetachedVectorView</tt> creates a (<tt>const</tt>) non-mutable explicit view of a <tt>const %Thyra::%VectorBase</tt> object, allows direct access to vector elements and then frees the view in the destructor. <li><tt>Thyra::DetachedVectorView</tt> creates a (non-<tt>const</tt>) mutable explicit view of a <tt>%Thyra::%VectorBase</tt> object, allows direct access to vector elements and then frees the view in the destructor. <li><tt>Thyra::ConstDetachedMultiVectorView</tt> creates a (<tt>const</tt>) non-mutable explicit view of a <tt>const %Thyra::%MultiVectorBase</tt> object, allows direct access to multi-vector elements and then frees the view in the destructor. <li><tt>Thyra::DetachedMultiVectorView</tt> creates a (non-<tt>const</tt>) mutable explicit view of a <tt>%Thyra::%MultiVectorBase</tt> object, allows direct access to multi-vector elements and then frees the view in the destructor. </ul> 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. <li><b>Basic default implementation node subclasses</b> The following subclasses directly derive from \ref Thyra_Op_Vec_fundamental_interfaces_code_grp and provide general default implementations for as many virtual functions as reasonable: <ul> <li><tt>Thyra::VectorSpaceDefaultBase</tt> should be a direct or indirect base class of almost every concrete <tt>Thyra::VectorSpaceBase</tt> adapter subclass. This node subclass provides the default implementation <tt>Thyra::VectorSpaceDefaultBase::createMembers()</tt> using the <tt>Thyra::DefaultColumnwiseMultiVector</tt> subclass. Therefore, a subclass need only provide a <tt>VectorBase</tt> implementation and override the <tt>Thyra::VectorSpaceBase::createMember()</tt> and related functions. <li><tt>Thyra::LinearOpDefaultBase</tt> should be a direct or indirect base class of almost every concrete <tt>Thyra::MultiVectorBase</tt> adpater subclass. This node subclass provides just the default implementation override <tt>Thyra::LinearOpDefaultBase::describe()</tt> <li><tt>Thyra::MultiVectorDefaultBase</tt> should be a direct or indirect base class of almost every concrete <tt>Thyra::MultiVectorBase</tt> adpater subclass. This node subclass provides a default of every inherited virtual function from the base class <tt>Thyra::MultiVectorBase</tt> in terms of just <tt>Thyra::MultiVectorBase::col()</tt>. While many of these default function implementations are highly non-optimal, however, they allow for rapid prototyping of new <tt>Thyra::MultiVectorBase</tt> subclasses. <li><tt>Thyra::VectorDefaultBase</tt> should be a direct or indirect base class of almost every concrete <tt>Thyra::VectorBase</tt> adpater subclass. This node subclass provides full general and efficient implementations of all of the inherited virtual functions from the base class <tt>Thyra::MultiVectorBase</tt>. </ul> <li> <b>Unit testing software</b> This is basic testing software for %Thyra: <ul> <li><tt>Thyra::LinearOpTester</tt> is a unit testing class that validates the implementation of a <tt>Thyra::LinearOpBase</tt> object by checking its linear properties, and/or its adjoint, and/or symmetry. In addition, it can check if two linear operators are the same. <li><tt>Thyra::MultiVectorTester</tt> is a unit testing class that validates the implementation of a <tt>Thyra::MultiVectorBase</tt> object. This class exposes a <tt>Thyra::LinearOpTester</tt> object for testing the <tt>LinearOpBase</tt> base interface of <tt>Thyra::MultiVectorBase</tt>. <li><tt>Thyra::VectorTester</tt> is a unit testing class that validates the implementation of a <tt>Thyra::VectorBase</tt> object. This class exposes a <tt>Thyra::MultiVectorTester</tt> object for testing the <tt>MultiVectorBase</tt> base interface of <tt>Thyra::VectorBase</tt>. <li><tt>Thyra::VectorSpaceTester</tt> is a unit testing class that accepts any <tt>Thyra::VectorSpaceBase</tt> object and then proceeds to create a number of <tt>Thyra::VectorBase</tt> and <tt>Thyra::MultiVectorBase</tt> objects and then and validates all of these objects. This class class, therefore, is a unit testing class for all three interfaces <tt>%Thyra::VectorSpaceBase</tt>, <tt>%Thyra::VectorBase</tt>, and <tt>Thyra::MultiVectorBase</tt>. <li><tt>Thyra::VectorStdOpsTester</tt> is a unit testing class that accepts any <tt>Thyra::VectorSpaceBase</tt> object and then tests all of the standard vector RTOp wrappers documented \ref Thyra_Op_Vec_VectorStdOps_grp "here". <li><tt>Thyra::MultiVectorStdOpsTester</tt> is a unit testing class that accepts any <tt>Thyra::VectorSpaceBase</tt> object and then tests all of the standard multi-vector RTOp wrappers documented \ref Thyra_Op_Vec_MultiVectorStdOps_grp "here".
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:
Miscellaneous software
Here is software that does not neatly fall into any of the above categories but is still considered ANA software.
There are several code examples that one can study to see how to use the code described here as an API for developing ANAs.
sillyPowerMethod() is a simple example ANA that implements the power method for estimating the dominate eigenvalue of a linear operator.
sillyCgSolve() is a simple example ANA that implements the conjugate gradient method for solving a symmetric positive definite linear system.
Thyra::LinearOpTester::check() shows how to access a Thyra::LinearOpBase objects domain and range spaces, how to use these spaces to create vectors and multi-vectors and how to perform various types of operations involving vectors, multi-vectors and linear operators.
| #define THYRA_ASSERT_LHS_ARG | ( | FUNC_NAME, | |
| LHS_ARG ) |
This macro just asserts that a LHS argument is set.
Definition at line 118 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_VEC_SPACES_NAMES | ( | FUNC_NAME, | |
| VS1, | |||
| VS1_NAME, | |||
| VS2, | |||
| VS2_NAME ) |
Helper assertion macro.
Definition at line 134 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_VEC_SPACES | ( | FUNC_NAME, | |
| VS1, | |||
| VS2 ) |
This is a very useful macro that should be used to validate that two vector spaces are compatible.
If the vector spaces are not compatible then a very helpful error message is generated (in the std::exception class) along with the file name and line number where this macro is called. The error message string embedded in the thrown exception gives the concrete types of the two vector spaces involved as well as their dimensions.
Definition at line 156 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_MAT_VEC_SPACES | ( | FUNC_NAME, | |
| M, | |||
| M_T, | |||
| M_VS, | |||
| VS ) |
This macro validates that a linear operator and a vector space for the domain vector are compatible.
This macro is not recommended for casual users.
Definition at line 167 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_LINEAR_OP_VEC_APPLY_SPACES | ( | FUNC_NAME, | |
| M, | |||
| M_T, | |||
| X, | |||
| Y ) |
This is a very useful macro that should be used to validate that the spaces for the vector version of the LinearOpBase::apply() function (or related operations).
If the vector spaces are not compatible then a very helpful error message is generated (in the std::exception class) along with the file name and line number where this macro is called. The error message string embedded in the thrown exception gives the concrete types of the vector spaces involved as well as their dimensions.
Definition at line 192 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_LINEAR_OP_MULTIVEC_APPLY_SPACES | ( | FUNC_NAME, | |
| M, | |||
| M_T, | |||
| X, | |||
| Y ) |
This is a very useful macro that should be used to validate that the spaces for the multi-vector version of the LinearOpBase::apply() function (or related operations).
If the vector spaces are not compatible then a very helpful error message is generated (in the std::exception class) along with the file name and line number where this macro is called. The error message string embedded in the thrown exception gives the concrete types of the vector spaces involved as well as their dimensions.
Definition at line 218 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_LINEAR_OP_PLUS_LINEAR_OP_SPACES_NAMES | ( | FUNC_NAME, | |
| M1, | |||
| M1_T, | |||
| M1_N, | |||
| M2, | |||
| M2_T, | |||
| M2_N ) |
Assert that a linear operator addition matches up.
Definition at line 329 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_LINEAR_OP_TIMES_LINEAR_OP_SPACES_NAMES | ( | FUNC_NAME, | |
| M1, | |||
| M1_T, | |||
| M1_N, | |||
| M2, | |||
| M2_T, | |||
| M2_N ) |
Assert that a linear operator multiplication matches up.
Definition at line 337 of file Thyra_AssertOp.hpp.
| #define THYRA_ASSERT_MAT_MAT_SPACES | ( | FUNC_NAME, | |
| M1, | |||
| M1_T, | |||
| M1_VS, | |||
| M2, | |||
| M2_T, | |||
| M2_VS ) |
Helper assertion macro.
This macro is not recommended for casual users.
Definition at line 347 of file Thyra_AssertOp.hpp.
Determines what to do if inverse solve fails.
| Enumerator | |
|---|---|
| THROW_ON_SOLVE_FAILURE | Throw an exception if a solve fails to converge. |
| IGNORE_SOLVE_FAILURE | Don't throw an exception if a solve fails to converge. |
Definition at line 24 of file Thyra_DefaultInverseLinearOp_decl.hpp.
| const Thyra::VectorSpaceBase< Scalar > & Thyra::linear_op_op | ( | const Thyra::LinearOpBase< Scalar > & | M, |
| Thyra::EOpTransp | M_trans, | ||
| EM_VS | M_VS ) |
Utility function for selecting domain or range spaces.
Definition at line 94 of file Thyra_AssertOp.hpp.
|
inline |
Definition at line 24 of file Thyra_TestingToolsDecl.hpp.
|
inline |
Definition at line 37 of file Thyra_TestingToolsDecl.hpp.
| Teuchos::ScalarTraits< Scalar >::magnitudeType Thyra::relVectorErr | ( | const VectorBase< Scalar > & | v1, |
| const VectorBase< Scalar > & | v2 ) |
Return relative error of two vectors.
ToDo: Finish documentation!
Definition at line 23 of file Thyra_TestingTools.hpp.
| bool Thyra::testRelErrors | ( | const std::string & | v1_name, |
| const ArrayView< const Scalar1 > & | v1, | ||
| const std::string & | v2_name, | ||
| const ArrayView< const Scalar2 > & | v2, | ||
| const std::string & | maxRelErr_error_name, | ||
| const ScalarMag & | maxRelErr_error, | ||
| const std::string & | maxRelErr_warning_name, | ||
| const ScalarMag & | maxRelErr_warning, | ||
| const Ptr< std::ostream > & | out, | ||
| const std::string & | leadingIndent = std::string("") ) |
Compute, check and optionally print the relative errors in two scalar arays.
ToDo: Finish documentation!
Definition at line 50 of file Thyra_TestingTools.hpp.
| bool Thyra::testRelNormDiffErr | ( | const std::string & | v1_name, |
| const VectorBase< Scalar > & | v1, | ||
| const std::string & | v2_name, | ||
| const VectorBase< Scalar > & | v2, | ||
| const std::string & | maxRelErr_error_name, | ||
| const typename Teuchos::ScalarTraits< Scalar >::magnitudeType & | maxRelErr_error, | ||
| const std::string & | maxRelErr_warning_name, | ||
| const typename Teuchos::ScalarTraits< Scalar >::magnitudeType & | maxRelErr_warning, | ||
| std::ostream * | out, | ||
| const Teuchos::EVerbosityLevel | verbLevel = Teuchos::VERB_LOW, | ||
| const std::string & | leadingIndent = std::string("") ) |
Compute, check and optionally print the relative errors in two vectors.
This function only looks at the difference in the relative errors in the natural norm of the difference between two vectors. This does not perform a component-by-component check.
ToDo: Finish documentation!
Definition at line 106 of file Thyra_TestingTools.hpp.
| bool Thyra::testMaxErr | ( | const std::string & | error_name, |
| const Scalar & | error, | ||
| const std::string & | max_error_name, | ||
| const typename Teuchos::ScalarTraits< Scalar >::magnitudeType & | max_error, | ||
| const std::string & | max_warning_name, | ||
| const typename Teuchos::ScalarTraits< Scalar >::magnitudeType & | max_warning, | ||
| std::ostream * | out, | ||
| const std::string & | leadingIndent = std::string("") ) |
Check that an error is less than some error tolerence.
ToDo: Finish documentation!
Definition at line 171 of file Thyra_TestingTools.hpp.
| bool Thyra::testMaxErrors | ( | const std::string & | error_name, |
| const ArrayView< const typename Teuchos::ScalarTraits< Scalar >::magnitudeType > & | errors, | ||
| const std::string & | max_error_name, | ||
| const typename Teuchos::ScalarTraits< Scalar >::magnitudeType & | max_error, | ||
| const std::string & | max_warning_name, | ||
| const typename Teuchos::ScalarTraits< Scalar >::magnitudeType & | max_warning, | ||
| const Ptr< std::ostream > & | out, | ||
| const std::string & | leadingIndent = std::string("") ) |
Check that an array of errors is less than some error tolerence.
| error | [in] Array (length num_scalars). |
ToDo: Finish documentation!
Definition at line 207 of file Thyra_TestingTools.hpp.
| bool Thyra::testBoolExpr | ( | const std::string & | boolExprName, |
| const bool & | boolExpr, | ||
| const bool & | boolExpected, | ||
| const Ptr< std::ostream > & | out, | ||
| const std::string & | leadingIndent = std::string("") ) |
Check a boolean result against expected result.
ToDo: Finish documentation!
Definition at line 13 of file Thyra_TestingTools.cpp.
| std::ostream & Thyra::operator<< | ( | std::ostream & | o, |
| const VectorBase< Scalar > & | v ) |
Output operator to pretty print any Thyra::VectorBase object.
Calls v.describe(o, Teuchos::VERB_EXTREME);
Definition at line 261 of file Thyra_TestingTools.hpp.
| std::ostream & Thyra::operator<< | ( | std::ostream & | o, |
| const LinearOpBase< Scalar > & | M ) |
Output operator to pretty print any Thyra::LinearOpBase (and therefore MultiVectorBase) object.
Calls M.describe(o, Teuchos::VERB_EXTREME);
Definition at line 268 of file Thyra_TestingTools.hpp.