Tpetra Matrix/Vector Services Version of the Day
Namespaces | Defines | Functions
Tpetra_Util.hpp File Reference

Stand-alone utility functions. More...

#include "Tpetra_ConfigDefs.hpp"
#include <iterator>
#include <Teuchos_Utils.hpp>
#include <Teuchos_TestForException.hpp>

Go to the source code of this file.

Namespaces

namespace  Tpetra
 

Namespace Tpetra contains the class and methods constituting the Tpetra library.


Defines

#define TPETRA_EFFICIENCY_WARNING(throw_exception_test, Exception, msg)
 Handle an efficiency warning, according to HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS and HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS.
#define TPETRA_ABUSE_WARNING(throw_exception_test, Exception, msg)
 Handle an efficiency warning, according to HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS and HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS.
#define SHARED_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg, comm)
#define SWITCHED_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg, comm)
 If TEUCHOS_DEBUG is defined, then it calls SHARED_TEST_FOR_EXCEPTION. Otherwise, it calls TEST_FOR_EXCEPTION.

Functions

template<typename MapType , typename KeyArgType , typename ValueArgType >
MapType::iterator Tpetra::efficientAddOrUpdate (MapType &m, const KeyArgType &k, const ValueArgType &v)
template<class IT1 , class IT2 >
void Tpetra::sort2 (const IT1 &first1, const IT1 &last1, const IT2 &first2)
template<class IT1 , class IT2 , class IT3 >
void Tpetra::sort3 (const IT1 &first1, const IT1 &last1, const IT2 &first2, const IT3 &first3)

Detailed Description

Stand-alone utility functions.

Tpetra_Util contains utility functions that are used throughout Tpetra, by many classes and functions. They are placed here so that they can be updated and maintained in a single spot.

Utility functions housed here:

Definition in file Tpetra_Util.hpp.


Define Documentation

#define TPETRA_EFFICIENCY_WARNING (   throw_exception_test,
  Exception,
  msg 
)

Handle an efficiency warning, according to HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS and HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS.

Definition at line 49 of file Tpetra_Util.hpp.

#define TPETRA_ABUSE_WARNING (   throw_exception_test,
  Exception,
  msg 
)

Handle an efficiency warning, according to HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS and HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS.

Definition at line 65 of file Tpetra_Util.hpp.

#define SHARED_TEST_FOR_EXCEPTION (   throw_exception_test,
  Exception,
  msg,
  comm 
)
Value:
{ \
    using Teuchos::outArg; \
    const int lcl_throw_exception = (throw_exception_test) ? Teuchos::rank(comm)+1 : 0; \
    int gbl_throw; \
    Teuchos::reduceAll(comm,Teuchos::REDUCE_MAX,lcl_throw_exception,outArg(gbl_throw)); \
    TEST_FOR_EXCEPTION(gbl_throw,Exception,  \
                       msg << " Failure on node " << gbl_throw-1 << "." << std::endl); \
}

Shared test for exception Just like Teuchos TEST_FOR_EXCEPTION, but with the assurance that all nodes test and throw the exception together.

Definition at line 72 of file Tpetra_Util.hpp.

#define SWITCHED_TEST_FOR_EXCEPTION (   throw_exception_test,
  Exception,
  msg,
  comm 
)
Value:
{ \
    TEST_FOR_EXCEPTION(throw_exception_test,Exception,msg); \
}

If TEUCHOS_DEBUG is defined, then it calls SHARED_TEST_FOR_EXCEPTION. Otherwise, it calls TEST_FOR_EXCEPTION.

Definition at line 90 of file Tpetra_Util.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines