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. More... | |
#define | THYRA_ASSERT_VEC_SPACES_NAMES(FUNC_NAME, VS1, VS1_NAME, VS2, VS2_NAME) |
Helper assertion macro. More... | |
#define | THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2) THYRA_ASSERT_VEC_SPACES_NAMES(FUNC_NAME,VS1,#VS1,VS2,#VS2) |
This is a very useful macro that should be used to validate that two vector spaces are compatible. More... | |
#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. More... | |
#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). More... | |
#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). More... | |
#define | THYRA_ASSERT_LINEAR_OP_PLUS_LINEAR_OP_SPACES_NAMES(FUNC_NAME, M1, M1_T, M1_N, M2, M2_T, M2_N) ::Thyra::assertLinearOpPlusLinearOpNames(FUNC_NAME,M1,M1_T,M1_N,M2,M2_T,M2_N) |
Assert that a linear operator addition matches up. More... | |
#define | THYRA_ASSERT_LINEAR_OP_TIMES_LINEAR_OP_SPACES_NAMES(FUNC_NAME, M1, M1_T, M1_N, M2, M2_T, M2_N) ::Thyra::assertLinearOpTimesLinearOpNames(FUNC_NAME,M1,M1_T,M1_N,M2,M2_T,M2_N) |
Assert that a linear operator multiplication matches up. More... | |
#define | THYRA_ASSERT_MAT_MAT_SPACES(FUNC_NAME, M1, M1_T, M1_VS, M2, M2_T, M2_VS) |
Helper assertion macro. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
template<class Scalar > | |
std::ostream & | Thyra::operator<< (std::ostream &o, const VectorBase< Scalar > &v) |
Output operator to pretty print any Thyra::VectorBase object. More... | |
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. More... | |
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.
There are several different types of helper classes and functions that simplify the use of Thyra for the development of ANAs.
"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 rabar if you need a new vector or multi-vector operation that is not already supported). tl@s andia .gov
Implicit vector space, vector, multi-vector and linear operator subclasses
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).
Implicit product vector spaces, vectors and multi-vectors
One particularly useful category of composite linear algebra objects is the product vector space where , for , are different constituent vector spaces. Product vector spaces give rise to product vectors
(where ) and product multi-vectors
(where and 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:
Thyra::DefaultProductVectorSpace
is a general concrete implementation of Thyra::ProductVectorSpaceBase
that should be sufficient for most use cases. Thyra::DefaultProductVector
is a general concrete implementation of Thyra::ProductVectorBase
that should be sufficient for most use cases. Thyra::DefaultProductMultiVector
is a general concrete implementation of Thyra::ProductMultiVectorBase
that should be sufficient for most use cases. 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::DefaultProductVectorSpace
object is first created and then Thyra::DefaultProductVector
and Thyra::DefaultProductMultiVector
objects are created by the functions Thyra::DefaultProductVectorSpace::createMember()
and Thyra::DefaultProductVectorSpace::createMembers()
. See this example of how product vector spaces are used.
Miscellaneous implicit linear operators
These are several different types of useful implicit composite/decorator Thyra::LinearOpBase
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:
Thyra::DefaultZeroLinearOp
is used to define a zero linear operator of the form:
defined in terms of two vector spaces (a range and a domain).
Thyra::DefaultIdentityLinearOp
is used to define an identity linear operator of the form:
defined in terms of a single vector space.
Thyra::DefaultDiagonalLinearOp
is a simple concrete subclass that defines a diagonal linear operator
out of any Thyra::VectorBase
object for the diagonal .
Thyra::DefaultScaledAdjointLinearOp
is a simple concrete decorator subclass that defines an implicit scaled and/or adjoined (or transposed) linear operator
.
Thyra::DefaultAddedLinearOp
is a simple concrete composite subclass that represent the implicit addition of two or more constituent Thyra::LinearOpBase
objects of the form
composed out of one or more constituent linear operators .
Thyra::DefaultMultipliedLinearOp
is a simple concrete composite subclass that defines a composite multiplicative Thyra::LinearOpBase
of the form
composed out of one or more constituent linear operators .
Thyra::DefaultBlockedLinearOp
is a simple concrete composite subclass that defines a composite blocking of Thyra::LinearOpBase
objects of the form
composed out of one or more constituent linear operators.
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.
Thyra::ConstDetachedVectorView
creates a (const
) non-mutable explicit view of a const Thyra::VectorBase
object, allows direct access to vector elements and then frees the view in the destructor. Thyra::DetachedVectorView
creates a (non-const
) mutable explicit view of a Thyra::VectorBase
object, allows direct access to vector elements and then frees the view in the destructor. Thyra::ConstDetachedMultiVectorView
creates a (const
) non-mutable explicit view of a const Thyra::MultiVectorBase
object, allows direct access to multi-vector elements and then frees the view in the destructor. Thyra::DetachedMultiVectorView
creates a (non-const
) mutable explicit view of a Thyra::MultiVectorBase
object, allows direct access to multi-vector elements and then frees the view in the destructor. 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.
Basic default implementation node subclasses
The following subclasses directly derive from Thyra operator/vector fundamental interfaces and provide general default implementations for as many virtual functions as reasonable:
Thyra::VectorSpaceDefaultBase
should be a direct or indirect base class of almost every concrete Thyra::VectorSpaceBase
adapter subclass. This node subclass provides the default implementation Thyra::VectorSpaceDefaultBase::createMembers()
using the Thyra::DefaultColumnwiseMultiVector
subclass. Therefore, a subclass need only provide a VectorBase
implementation and override the Thyra::VectorSpaceBase::createMember()
and related functions.
Thyra::LinearOpDefaultBase
should be a direct or indirect base class of almost every concrete Thyra::MultiVectorBase
adpater subclass. This node subclass provides just the default implementation override Thyra::LinearOpDefaultBase::describe()
Thyra::MultiVectorDefaultBase
should be a direct or indirect base class of almost every concrete Thyra::MultiVectorBase
adpater subclass. This node subclass provides a default of every inherited virtual function from the base class Thyra::MultiVectorBase
in terms of just Thyra::MultiVectorBase::col()
. While many of these default function implementations are highly non-optimal, however, they allow for rapid prototyping of new Thyra::MultiVectorBase
subclasses.
Thyra::VectorDefaultBase
should be a direct or indirect base class of almost every concrete Thyra::VectorBase
adpater subclass. This node subclass provides full general and efficient implementations of all of the inherited virtual functions from the base class Thyra::MultiVectorBase
.
Unit testing software
This is basic testing software for Thyra:
Thyra::LinearOpTester
is a unit testing class that validates the implementation of a Thyra::LinearOpBase
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.
Thyra::MultiVectorTester
is a unit testing class that validates the implementation of a Thyra::MultiVectorBase
object. This class exposes a Thyra::LinearOpTester
object for testing the LinearOpBase
base interface of Thyra::MultiVectorBase
.
Thyra::VectorTester
is a unit testing class that validates the implementation of a Thyra::VectorBase
object. This class exposes a Thyra::MultiVectorTester
object for testing the MultiVectorBase
base interface of Thyra::VectorBase
.
Thyra::VectorSpaceTester
is a unit testing class that accepts any Thyra::VectorSpaceBase
object and then proceeds to create a number of Thyra::VectorBase
and Thyra::MultiVectorBase
objects and then and validates all of these objects. This class class, therefore, is a unit testing class for all three interfaces Thyra::VectorSpaceBase
, Thyra::VectorBase
, and Thyra::MultiVectorBase
.
Thyra::VectorStdOpsTester
is a unit testing class that accepts any Thyra::VectorSpaceBase
object and then tests all of the standard vector RTOp wrappers documented here. Thyra::MultiVectorStdOpsTester
is a unit testing class that accepts any Thyra::VectorSpaceBase
object and then tests all of the standard multi-vector RTOp wrappers documented 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:
Thyra::operator<<(std::ostream& o, const Thyra::VectorBase<Scalar>& v)
is an output stream operator for printing Thyra::VectorBase
objects. Thyra::operator<<(std::ostream& o, const Thyra::LinearOpBase<Scalar>& M)
is an output stream operator for printing Thyra::LinearOpBase
(and therefore also Thyra::MultiVectorBase
) objects. Miscellaneous software
Here is software that does not neatly fall into any of the above categories but is still considered ANA software.
Thyra::ParameterDrivenMultiVectorInput
is a simple concrete utility class that derives from Teuchos::ParameterListAcceptor
that defines a parameter sublist that specifies how to read (multi)vectors for a file(s) or directly from the parameter list. 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 | |||
) | THYRA_ASSERT_VEC_SPACES_NAMES(FUNC_NAME,VS1,#VS1,VS2,#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 | |||
) | ::Thyra::assertLinearOpPlusLinearOpNames(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 | |||
) | ::Thyra::assertLinearOpTimesLinearOpNames(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.
v1 | [in] Array (length num_scalars ). |
v2 | [in] Array (length num_scalars ). |
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.