Teuchos - Trilinos Tools Package
Version of the Day
|
Classes | |
class | Teuchos::RelErrSmallNumber< hasMachineParameters, Scalar > |
class | Teuchos::RelErrSmallNumber< false, Scalar > |
class | Teuchos::RelErrSmallNumber< true, Scalar > |
Macros | |
#define | TEUCHOS_PASS_FAIL(RESULT) Teuchos::passfail_with_location((RESULT), __FILE__, __LINE__) |
Macro that prints "passed" or "failed" and optionally prints the file name and line number as well. More... | |
#define | TEUCHOS_ECHO(statement, out) |
Echo a statement and then invoke it. More... | |
#define | TEUCHOS_TEST_EQUALITY_CONST(v1, v2, out, success) |
Test that an object is equal to a given constant. More... | |
#define | TEUCHOS_TEST_ASSERT(v1, out, success) |
Assert that a give object is true. More... | |
#define | TEUCHOS_TEST_EQUALITY(v1, v2, out, success) |
Test that two values are equal. More... | |
#define | TEUCHOS_TEST_INEQUALITY_CONST(v1, v2, out, success) |
Test that an object is not equal to a given constant. More... | |
#define | TEUCHOS_TEST_INEQUALITY(v1, v2, out, success) |
Test that two values are not equal. More... | |
#define | TEUCHOS_TEST_FLOATING_EQUALITY(v1, v2, tol, out, success) |
Test if two floating point values are equal to a given tolerance. More... | |
#define | TEUCHOS_TEST_ITER_EQUALITY(iter1, iter2, out, success) |
Test if two iterators are equal. More... | |
#define | TEUCHOS_TEST_ITER_INEQUALITY(iter1, iter2, out, success) |
Test if two iterators are NOT equal. More... | |
#define | TEUCHOS_TEST_ARRAY_ELE_EQUALITY(a, i, val, printPass, out, success) |
Test that an array element value is equal to a given constant. More... | |
#define | TEUCHOS_TEST_ARRAY_ELE_INEQUALITY(a, i, val, printPass, out, success) |
Test that an array element value is not equal to a given constant. More... | |
#define | TEUCHOS_TEST_MATRIX_ELE_FLOATING_EQUALITY(a, i, j, val, tol, printPass, out, success) |
Test if a floating-point array element value is equal to a given constant for a given tolerance. More... | |
#define | TEUCHOS_TEST_MATRIX_ELE_EQUALITY(a, i, j, val, printPass, out, success) |
Test if a matrix element value is equal to a given constant. More... | |
#define | TEUCHOS_TEST_COMPARE(v1, comp, v2, out, success) |
Compare two objects using an input comparsion operator. More... | |
#define | TEUCHOS_TEST_COMPARE_CONST(v1, comp, v2, out, success) |
Compare an object and a constant using an input comparsion operator. More... | |
#define | TEUCHOS_TEST_THROW(code, ExceptType, out, success) |
Test that the chunk of code 'code' throws an expected exception. More... | |
#define | TEUCHOS_TEST_NOTHROW(code, out, success) |
Test that a chunk of code does not throw any exceptions. More... | |
Functions | |
void | Teuchos::updateSuccess (const bool result, bool &success) |
Update the success bool flag. More... | |
const std::string | Teuchos::passfail (const bool result) |
Return "passed" or "failed". More... | |
TEUCHOSCORE_LIB_DLL_EXPORT const std::string | Teuchos::passfail_with_location (const bool result, const std::string &file, const int lineNumber) |
Helper function for TEUCHOS_PASS_FAIL(...). More... | |
void | Teuchos::showTestFailureLocation (bool) |
Set if TEUCHOS_PASS_FAIL(...) should print test failure location. More... | |
bool | Teuchos::showTestFailureLocation () |
Return if TEUCHOS_PASS_FAIL(...) should print test failure location. More... | |
template<class Scalar > | |
Scalar | Teuchos::defaultSmallNumber () |
template<class Scalar > | |
ScalarTraits< Scalar > ::magnitudeType | Teuchos::relErr (const Scalar &s1, const Scalar &s2) |
Return relative error of two scalars. More... | |
template<class Array1 , class Array2 > | |
bool | Teuchos::compareArrays (const Array1 &a1, const std::string &a1_name, const Array2 &a2, const std::string &a2_name, Teuchos::FancyOStream &out) |
Compare if two array objects are the same or not. More... | |
template<class Array1 , class Array2 , class ScalarMag > | |
bool | Teuchos::compareFloatingArrays (const Array1 &a1, const std::string &a1_name, const Array2 &a2, const std::string &a2_name, const ScalarMag &tol, Teuchos::FancyOStream &out) |
Compare if two array objects are the same or not up to a relative floating point precision. More... | |
#define TEUCHOS_PASS_FAIL | ( | RESULT | ) | Teuchos::passfail_with_location((RESULT), __FILE__, __LINE__) |
Macro that prints "passed" or "failed" and optionally prints the file name and line number as well.
Only prints the file name and line number if Teuchos::showTestFailureLocation() == true.
Definition at line 230 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_ECHO | ( | statement, | |
out | |||
) |
Echo a statement and then invoke it.
This macro is not complicated so take a look for yourself!
Definition at line 240 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_EQUALITY_CONST | ( | v1, | |
v2, | |||
out, | |||
success | |||
) |
Test that an object is equal to a given constant.
This macro is not complicated so take a look for yourself!
Definition at line 250 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_ASSERT | ( | v1, | |
out, | |||
success | |||
) |
Assert that a give object is true.
This macro is not complicated so take a look for yourself!
Definition at line 264 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_EQUALITY | ( | v1, | |
v2, | |||
out, | |||
success | |||
) |
Test that two values are equal.
This macro is not complicated so take a look for yourself!
Definition at line 278 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_INEQUALITY_CONST | ( | v1, | |
v2, | |||
out, | |||
success | |||
) |
Test that an object is not equal to a given constant.
This macro is not complicated so take a look for yourself!
Definition at line 293 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_INEQUALITY | ( | v1, | |
v2, | |||
out, | |||
success | |||
) |
Test that two values are not equal.
This macro is not complicated so take a look for yourself!
Definition at line 308 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_FLOATING_EQUALITY | ( | v1, | |
v2, | |||
tol, | |||
out, | |||
success | |||
) |
Test if two floating point values are equal to a given tolerance.
This macro is not complicated so take a look for yourself!
Definition at line 323 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_ITER_EQUALITY | ( | iter1, | |
iter2, | |||
out, | |||
success | |||
) |
Test if two iterators are equal.
This macro does not try to print the iterators so it is more portable (in terms of types).
This macro is not complicated so take a look for yourself!
Definition at line 340 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_ITER_INEQUALITY | ( | iter1, | |
iter2, | |||
out, | |||
success | |||
) |
Test if two iterators are NOT equal.
This macro does not try to print the iterators so it is more portable (in terms of types).
This macro is not complicated so take a look for yourself!
Definition at line 358 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_ARRAY_ELE_EQUALITY | ( | a, | |
i, | |||
val, | |||
printPass, | |||
out, | |||
success | |||
) |
Test that an array element value is equal to a given constant.
This macro is not complicated so take a look for yourself!
Definition at line 373 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_ARRAY_ELE_INEQUALITY | ( | a, | |
i, | |||
val, | |||
printPass, | |||
out, | |||
success | |||
) |
Test that an array element value is not equal to a given constant.
This macro is not complicated so take a look for yourself!
Definition at line 390 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_MATRIX_ELE_FLOATING_EQUALITY | ( | a, | |
i, | |||
j, | |||
val, | |||
tol, | |||
printPass, | |||
out, | |||
success | |||
) |
Test if a floating-point array element value is equal to a given constant for a given tolerance.
This macro is not complicated so take a look for yourself!
Definition at line 408 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_MATRIX_ELE_EQUALITY | ( | a, | |
i, | |||
j, | |||
val, | |||
printPass, | |||
out, | |||
success | |||
) |
Test if a matrix element value is equal to a given constant.
This macro is not complicated so take a look for yourself!
Definition at line 425 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_COMPARE | ( | v1, | |
comp, | |||
v2, | |||
out, | |||
success | |||
) |
Compare two objects using an input comparsion operator.
The test succeeds (passes) if and only if "(v1) comp (v2)". For example, TEUCHOS_TEST_COMPARE( 2, <, 3, out, success ) succeeds, but TEUCHOS_TEST_COMPARE( 2, >, 3, out, success ) and TEUCHOS_TEST_COMPARE( 3, <, 2, out, success ) both fail.
Definition at line 445 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_COMPARE_CONST | ( | v1, | |
comp, | |||
v2, | |||
out, | |||
success | |||
) |
Compare an object and a constant using an input comparsion operator.
The test succeeds (passes) if and only if "(v1) comp (v2)". For example, TEUCHOS_TEST_COMPARE( 2, <, 3, out, success ) succeeds, but TEUCHOS_TEST_COMPARE( 2, >, 3, out, success ) and TEUCHOS_TEST_COMPARE( 3, <, 2, out, success ) both fail.
Definition at line 464 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_THROW | ( | code, | |
ExceptType, | |||
out, | |||
success | |||
) |
Test that the chunk of code 'code' throws an expected exception.
'code' is a chunk of code to execute. It will be executed exactly once. If it throws an exception of type ExceptType, this test passes (and prints "passed"). Otherwise, it prints "failed" with an informative message. The macro prints all messages to the given output stream (std::ostream&) out. Furthermore, if the test passes, it assigns true to success; if the test fails, it assigns false to success.
The macro's implementation does not evaluate 'out' more than once.
Definition at line 487 of file Teuchos_TestingHelpers.hpp.
#define TEUCHOS_TEST_NOTHROW | ( | code, | |
out, | |||
success | |||
) |
Test that a chunk of code does not throw any exceptions.
This macro is not complicated so take a look for yourself!
Definition at line 534 of file Teuchos_TestingHelpers.hpp.
|
inline |
Update the success bool flag.
Definition at line 570 of file Teuchos_TestingHelpers.hpp.
|
inline |
Return "passed" or "failed".
Definition at line 578 of file Teuchos_TestingHelpers.hpp.
const std::string Teuchos::passfail_with_location | ( | const bool | result, |
const std::string & | file, | ||
const int | lineNumber | ||
) |
Helper function for TEUCHOS_PASS_FAIL(...).
Definition at line 61 of file Teuchos_TestingHelpers.cpp.
void Teuchos::showTestFailureLocation | ( | bool | showTFL | ) |
Set if TEUCHOS_PASS_FAIL(...) should print test failure location.
Definition at line 72 of file Teuchos_TestingHelpers.cpp.
bool Teuchos::showTestFailureLocation | ( | ) |
Return if TEUCHOS_PASS_FAIL(...) should print test failure location.
Definition at line 78 of file Teuchos_TestingHelpers.cpp.
Scalar Teuchos::defaultSmallNumber | ( | ) |
Definition at line 141 of file Teuchos_TestingHelpers.hpp.
ScalarTraits<Scalar>::magnitudeType Teuchos::relErr | ( | const Scalar & | s1, |
const Scalar & | s2 | ||
) |
Return relative error of two scalars.
ToDo: Finish documentation!
bool Teuchos::compareArrays | ( | const Array1 & | a1, |
const std::string & | a1_name, | ||
const Array2 & | a2, | ||
const std::string & | a2_name, | ||
Teuchos::FancyOStream & | out | ||
) |
Compare if two array objects are the same or not.
This function works with any two array objects are the same size and have the same element value types. The funtion is templated on the container types and therefore can compare any two objects that have size() and operator[](i) defined.
true
if the compare and false
otherwise. Definition at line 644 of file Teuchos_TestingHelpers.hpp.
bool Teuchos::compareFloatingArrays | ( | const Array1 & | a1, |
const std::string & | a1_name, | ||
const Array2 & | a2, | ||
const std::string & | a2_name, | ||
const ScalarMag & | tol, | ||
Teuchos::FancyOStream & | out | ||
) |
Compare if two array objects are the same or not up to a relative floating point precision.
This function works with any two array objects are the same size and have the same element value types. The funtion is templated on the container types and therefore can compare any two objects that have size() and operator[](i) defined.
true
if the compare and false
otherwise. Definition at line 683 of file Teuchos_TestingHelpers.hpp.