Teuchos Namespace Reference


Classes

class  Teuchos::any
 Modified boost::any class, which is a container for a templated value. More...
class  Teuchos::bad_any_cast
 Thrown if any_cast is attempted between two incompatable types. More...
class  Teuchos::Array< T >
 Array is a templated array class derived from the STL vector, but with index boundschecking and an extended interface. More...
class  Teuchos::ArrayArg< N, T >
 Utility class that allows arrays to be passed into argument list. More...
class  Teuchos::basic_oblackholestream< _CharT, _Traits >
class  Teuchos::BLAS< OrdinalType, ScalarType >
 The Templated BLAS Wrapper Class. More...
class  Teuchos::CommandLineProcessor
 Class that helps parse command line input arguments from (argc,argv[]) and set options. More...
class  Teuchos::CommandLineProcessor::ParseError
 Thrown if a parse exception occurs and throwExceptions==true. More...
class  Teuchos::CommandLineProcessor::HelpPrinted
 Thrown if --help was specified and throwExceptions==true. More...
class  Teuchos::CommandLineProcessor::UnrecognizedOption
 Thrown if an unrecognized option was found and throwExceptions==true. More...
struct  Teuchos::CommandLineProcessor::opt_val_val_t
struct  Teuchos::CommandLineProcessor::opt_doc_t
struct  Teuchos::CommandLineProcessor::enum_opt_data_t
class  Teuchos::CompileTimeAssert< Test >
 If instantiated (for Test!=0) then this should not compile! More...
class  Teuchos::CompileTimeAssert< 0 >
 If instantiated (i.e. Test==0) then this will compile! More...
class  Teuchos::CompObject
 Functionality and data that is common to all computational classes. More...
class  Teuchos::m_bad_cast
 We create this class so that we may throw a bad_cast when appropriate and still use the TEST_FOR_EXCEPTION macro. More...
class  Teuchos::FileInputSource
 Instantiation of XMLInputSource class for reading XML from a file. More...
class  Teuchos::FileInputStream
 Instantiation of XMLInputStream class for reading an entire document from a file. More...
class  Teuchos::Flops
 The Teuchos Floating Point Operations Class. More...
class  Teuchos::HashSet< Key >
 Templated hashtable-based set. More...
class  Teuchos::HashPair< Key, Value >
 Helper class for Teuchos::Hashtable, representing a single <key, value> pair. More...
class  Teuchos::Hashtable< Key, Value >
 Templated hashtable class. More...
class  Teuchos::HashUtils
 Utilities for generating hashcodes. More...
struct  Teuchos::UndefinedLAPACKRoutine< T >
class  Teuchos::LAPACK< OrdinalType, ScalarType >
 The Templated LAPACK Wrapper Class. More...
class  Teuchos::MPIComm
 Object representation of an MPI communicator. More...
class  Teuchos::MPIContainerComm< T >
 Object representation of an MPI communicator for templated containers. More...
class  Teuchos::MPISession
 This class provides methods for initializing, finalizing, and querying the global MPI session. More...
class  Teuchos::MPITraits< T >
 Templated traits class that binds MPI types to C++ types. More...
class  Teuchos::Object
 The base Teuchos class. More...
struct  Teuchos::UndefinedOrdinalTraits< T >
 This is the default structure used by OrdinalTraits<T> to produce a compile time error when the specialization does not exist for type T. More...
struct  Teuchos::OrdinalTraits< T >
 This structure defines some basic traits for the ordinal field type. More...
class  Teuchos::ParameterEntry
 This object is held as the "value" in the Teuchos::ParameterList map. More...
class  Teuchos::ParameterList
 The Teuchos::ParameterList class provides a templated parameter list. More...
class  Teuchos::ParameterXMLFileReader
 Reader for getting parameter lists from XML files. More...
class  Teuchos::PrimitiveTypeTraits< T >
 A templated traits class for decomposing object into an array of primitive objects. More...
class  Teuchos::RawMPITraits< T >
 Templated class that returns raw MPI data types. More...
class  Teuchos::DeallocDelete< T >
 Deallocator for new which calls delete. More...
class  Teuchos::DeallocArrayDelete< T >
 Deallocator for new [] which calls delete []. More...
class  Teuchos::RefCountPtr< T >
 Templated class for reference counted smart pointers (see description). More...
struct  Teuchos::UndefinedScalarTraits< T >
 This is the default structure used by ScalarTraits<T> to produce a compile time error when the specialization does not exist for type T. More...
struct  Teuchos::ScalarTraits< T >
 This structure defines some basic traits for a scalar field type. More...
class  Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >
 This class creates and provides basic support for dense rectangular matrix of templated type. More...
class  Teuchos::SerialDenseVector< OrdinalType, ScalarType >
 This class creates and provides basic support for dense vectors of templated type as a specialization of Teuchos::SerialDenseMatrix. Additional methods for the SerialDenseVector class, like mathematical methods, can be found documented in SerialDenseMatrix. More...
class  Teuchos::StringInputSource
 Instantiation of XMLInputSource class for reading XML from a string. More...
class  Teuchos::StringInputStream
 Instantiation of XMLInputStream for reading an entire document from a string. More...
class  Teuchos::StrUtils
 Provides string manipulation utilities that are not provided in the standard C++ string class. More...
class  Teuchos::Time
 Basic wall-clock timer class. More...
class  Teuchos::TimeMonitor
 A timer class that starts when constructed and stops when the destructor is called. More...
class  Teuchos::TreeBuildingXMLHandler
 TreeBuildingXMLHandler assembles a XMLObject from your XML input. More...
class  Teuchos::Utils
 This class provides some basic string and floating-point utilities for Teuchos. More...
class  Teuchos::RawWorkspace
 Encapulsation object for raw temporary workspace that has been allocated. More...
class  Teuchos::Workspace< T >
 Templated class for workspace creation. More...
class  Teuchos::WorkspaceStore
 Workspace encapsulation class. More...
class  Teuchos::WorkspaceStoreInitializeable
 WorkspaceStore class that can be used to actually reinitialize memory. More...
class  Teuchos::XMLInputSource
 XMLInputSource represents a source of XML input that can be parsed to produce an XMLObject. More...
class  Teuchos::XMLInputStream
 XMLInputStream represents an XML input stream that can be used by a XMLInputSource. More...
class  Teuchos::XMLObject
 Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object, allowing storage by reference. More...
class  Teuchos::XMLObjectImplem
 The XMLObjectImplem class takes care of the low-level implementation details of XMLObject. More...
class  Teuchos::XMLParameterListReader
 Writes an XML object to a parameter list. More...
class  Teuchos::XMLParameterListWriter
 Writes a ParameterList to an XML object. More...
class  Teuchos::map
 This class creates a basic map object for platforms where the std::map is deficient, otherwise the std::map is injected into the Teuchos namespace. More...

Typedefs

typedef basic_oblackholestream<
char, std::char_traits< char > > 
oblackholestream

Enumerations

enum  ESide { LEFT_SIDE, RIGHT_SIDE }
enum  ETransp { NO_TRANS, TRANS, CONJ_TRANS }
enum  EUplo { UPPER_TRI, LOWER_TRI }
enum  EDiag { UNIT_DIAG, NON_UNIT_DIAG }
enum  DataAccess { Copy, View }
enum  ENull { null }
 Used to initialize a RefCountPtr object to NULL using an implicit conversion! More...
enum  EPrePostDestruction { PRE_DESTROY, POST_DESTROY }
 Used to specify a pre or post destruction of extra data. More...

Functions

template<class T>
ostream & operator<< (ostream &os, const Array< T > &array)
template<class T>
int hashCode (const Array< T > &array)
template<class T>
std::string toString (const Array< T > &array)
template<class T>
ArrayArg< 1, T > arrayArg (T t1)
 Return an array with 1 member.
template<class T>
ArrayArg< 2, T > arrayArg (T t1, T t2)
 Return an array with 2 members.
template<class T>
ArrayArg< 3, T > arrayArg (T t1, T t2, T t3)
 Return an array with 3 members.
template<class T>
ArrayArg< 4, T > arrayArg (T t1, T t2, T t3, T t4)
 Return an array with 4 members.
template<class T>
ArrayArg< 5, T > arrayArg (T t1, T t2, T t3, T t4, T t5)
 Return an array with 5 members.
template<class T>
ArrayArg< 6, T > arrayArg (T t1, T t2, T t3, T t4, T t5, T t6)
 Return an array with 6 members.
void dyn_cast_throw_exception (const char type_from_name[], const char type_from_concr_name[], const char type_to_name[])
 We throw a m_bad_cast, which is a subclass of bad_cast.
template<class T_To, class T_From>
T_To & dyn_cast (T_From &from)
 Dynamic casting utility function meant to replace dynamic_cast<T&> by throwing a better documented error message.
template<class T>
const T & getConst (T &t)
 Return a constant reference to an object given a non-const reference.
template<class Key>
string toString (const HashSet< Key > &h)
template<class Key>
ostream & operator<< (ostream &os, const HashSet< Key > &h)
template<class Key, class Value>
string toString (const Hashtable< Key, Value > &h)
template<class Key, class Value>
ostream & operator<< (ostream &os, const Hashtable< Key, Value > &h)
template<class T>
RefCountPtr< T > rcp (T *p, bool owns_mem=true)
 Create a RefCountPtr object properly typed.
template<class T, class Dealloc_T>
RefCountPtr< T > rcp (T *p, Dealloc_T dealloc, bool owns_mem)
 Initialize from a raw pointer with a deallocation policy.
template<class T2, class T1>
RefCountPtr< T2 > rcp_implicit_cast (const RefCountPtr< T1 > &p1)
 Implicit cast of underlying RefCountPtr type from T1* to T2*.
template<class T2, class T1>
RefCountPtr< T2 > rcp_static_cast (const RefCountPtr< T1 > &p1)
 Static cast of underlying RefCountPtr type from T1* to T2*.
template<class T2, class T1>
RefCountPtr< T2 > rcp_const_cast (const RefCountPtr< T1 > &p1)
 Constant cast of underlying RefCountPtr type from T1* to T2*.
template<class T2, class T1>
RefCountPtr< T2 > rcp_dynamic_cast (const RefCountPtr< T1 > &p1, bool throw_on_fail=false)
 Dynamic cast of underlying RefCountPtr type from T1* to T2*.
template<class T1, class T2>
void set_extra_data (const T1 &extra_data, const std::string &name, RefCountPtr< T2 > *p, bool force_unique=true, EPrePostDestruction destroy_when=POST_DESTROY)
 Set extra data associated with a RefCountPtr object.
template<class T1, class T2>
T1 & get_extra_data (RefCountPtr< T2 > &p, const std::string &name)
 Get a non-const reference to extra data associated with a RefCountPtr object.
template<class T1, class T2>
const T1 & get_extra_data (const RefCountPtr< T2 > &p, const std::string &name)
 Get a const reference to extra data associated with a RefCountPtr object.
template<class Dealloc_T, class T>
Dealloc_T & get_dealloc (RefCountPtr< T > &p)
 Return a non-const reference to the underlying deallocator object.
template<class Dealloc_T, class T>
const Dealloc_T & get_dealloc (const RefCountPtr< T > &p)
 Return a const reference to the underlying deallocator object.
string Teuchos_Version ()
void set_default_workspace_store (const Teuchos::RefCountPtr< WorkspaceStore > &default_workspace_store)
 Set pointer to global workspace object.
Teuchos::RefCountPtr< WorkspaceStoreget_default_workspace_store ()
 Get the global workspace object set by set_default_workspace_store().
void print_memory_usage_stats (const WorkspaceStore *workspace_store, std::ostream &out)
 Print statistics on memory usage.

Variables

const char ESideChar [] = {'L' , 'R' }
const char ETranspChar [] = {'N' , 'T' , 'C' }
const char EUploChar [] = {'U' , 'L' }
const char EDiagChar [] = {'U' , 'N' }
float flt_nan = +0.0/sin(0.0)
double dbl_nan = +0.0/sin(0.0)


Typedef Documentation

typedef basic_oblackholestream<char,std::char_traits<char> > Teuchos::oblackholestream
 

Definition at line 38 of file Teuchos_oblackholestream.hpp.


Enumeration Type Documentation

enum ESide
 

Enumeration values:
LEFT_SIDE  Left side
RIGHT_SIDE  Right side

Definition at line 45 of file Teuchos_BLAS_types.hpp.

enum ETransp
 

Enumeration values:
NO_TRANS  Not transposed
TRANS  Transposed
CONJ_TRANS  Conjugate transposed

Definition at line 50 of file Teuchos_BLAS_types.hpp.

enum EUplo
 

Enumeration values:
UPPER_TRI  Upper triangular
LOWER_TRI  Lower triangular

Definition at line 56 of file Teuchos_BLAS_types.hpp.

enum EDiag
 

Enumeration values:
UNIT_DIAG  Unit diagaonal
NON_UNIT_DIAG  Not unit diagonal

Definition at line 61 of file Teuchos_BLAS_types.hpp.

enum DataAccess
 

If set to Copy, user data will be copied at construction. If set to View, user data will be encapsulated and used throughout the life of the object.

Enumeration values:
Copy  User data will be copied at construction.
View  User data will be encapsulated and used throughout the life of the object.

Definition at line 47 of file Teuchos_DataAccess.hpp.


Function Documentation

template<class T>
ostream& operator<< ostream &  os,
const Array< T > &  array
[inline]
 

Definition at line 148 of file Teuchos_Array.hpp.

template<class T>
int hashCode const Array< T > &  array  )  [related]
 

Definition at line 153 of file Teuchos_Array.hpp.

template<class T>
std::string toString const Array< T > &  array  )  [related]
 

Definition at line 177 of file Teuchos_Array.hpp.

void Teuchos::dyn_cast_throw_exception const char  T_from[],
const char  T_from_concr[],
const char  T_to[]
 

We throw a m_bad_cast, which is a subclass of bad_cast.

This is necessary, since bad_cast lacks the appropriate constructor for use with the TEST_FOR_EXCEPTION macro.

Definition at line 36 of file Teuchos_dyn_cast.cpp.

template<class T_To, class T_From>
T_To& dyn_cast T_From &  from  )  [inline]
 

Dynamic casting utility function meant to replace dynamic_cast<T&> by throwing a better documented error message.

Existing uses of the built-in dynamic_cast<T&>() operator such as:

 C &c = dynamic_cast<C&>(a);

are easily replaced as:

 C &c = dyn_cast<C>(a);

and that is it. One could write a perl script to do this automatically.

This utility function is designed to cast an object reference of type T_From to type T_To and if the cast fails at runtime then an exception (derived from std::bad_cast) is thrown that contains a very good error message.

Consider the following class hierarchy:

 class A {};
 class B : public A {};
 class C : public A {};

Now consider the following program:

  int main( int argc, char* argv[] ) {
    B b;
    A &a = b;
    try {
      std::cout << "\nTrying: dynamic_cast<C&>(a);\n";
      dynamic_cast<C&>(a);
    }
    catch( const std::bad_cast &e ) {
      std::cout << "\nCaught std::bad_cast exception e where e.what() = \"" << e.what() << "\"\n";
    }
    try {
      std::cout << "\nTrying: Teuchos::dyn_cast<C>(a);\n";
      Teuchos::dyn_cast<C>(a);
    }
    catch( const std::bad_cast &e ) {
      std::cout << "\nCaught std::bad_cast exception e where e.what() = \"" << e.what() << "\"\n";
    }
    return 0;
  }

The above program will print something that looks like (compiled with g++ for example):


  Trying: dynamic_cast<C&>(a);

  Caught std::bad_cast exception e where e.what() = "St8bad_cast"

  Trying: Teuchos::dyn_cast<C>(a);

  Caught std::bad_cast exception e where e.what() = "../../../../packages/teuchos/src/Teuchos_dyn_cast.cpp:46: true:
  dyn_cast<1C>(1A) : Error, the object with the concrete type '1B' (passed in through the interface type '1A')  does
  not support the interface '1C' and the dynamic cast failed!"

 

The above program shows that the standard implementation of dynamic_cast<T&>() does not return any useful debugging information at all but the templated function Teuchos::dyn_cast<T>() returns all kinds of useful information. The generated error message gives the type of the interface that the object was passed in as (i.e. A), what the actual concrete type of the object is (i.e. B) and what type is trying to be dynamically casted to (i.e. C). This type of information is extremely valuable when trying to track down these type of runtime dynamic casting errors. In some cases (such as with gdb), debuggers do not even give the type of concrete object so this function is very important on these platforms. In many cases, a debugger does not even need to be opened to diagnose what the problem is and how to fix it.

Note that this function is inlined and does not incur any significant runtime performance penalty over the raw dynamic_cast<T&>() operator.

Definition at line 147 of file Teuchos_dyn_cast.hpp.

template<class T>
const T& getConst T &  t  )  [inline]
 

Return a constant reference to an object given a non-const reference.

This function just provides a shorthand notation for

 const_cast<const T&>(t) 
as
 getCost(t) 
so that one does not have to type in the name of the class which can be quite long in some cases.

Definition at line 47 of file Teuchos_getConst.hpp.

template<class Key>
string toString const HashSet< Key > &  h  )  [inline]
 

Definition at line 99 of file Teuchos_HashSet.hpp.

template<class Key>
ostream& operator<< ostream &  os,
const HashSet< Key > &  h
[related]
 

Definition at line 255 of file Teuchos_HashSet.hpp.

template<class Key, class Value>
string Teuchos::toString const Hashtable< Key, Value > &  h  )  [inline]
 

Definition at line 246 of file Teuchos_Hashtable.hpp.

template<class Key, class Value>
ostream& operator<< ostream &  os,
const Hashtable< Key, Value > &  h
[related]
 

Definition at line 324 of file Teuchos_Hashtable.hpp.

string Teuchos_Version  ) 
 

Examples:
BLAS/cxx_main.cpp, CommandLineProcessor/cxx_main.cpp, DenseMatrix/cxx_main.cpp, LAPACK/cxx_main.cpp, ParameterList/cxx_main.cpp, RefCountPtr/cxx_main.cpp, and TimeMonitor/cxx_main.cpp.

Definition at line 36 of file Teuchos_Version.hpp.


Variable Documentation

const char Teuchos::ESideChar = {'L' , 'R' }
 

Definition at line 31 of file Teuchos_BLAS.cpp.

const char Teuchos::ETranspChar = {'N' , 'T' , 'C' }
 

Definition at line 32 of file Teuchos_BLAS.cpp.

const char Teuchos::EUploChar = {'U' , 'L' }
 

Definition at line 33 of file Teuchos_BLAS.cpp.

const char Teuchos::EDiagChar = {'U' , 'N' }
 

Definition at line 34 of file Teuchos_BLAS.cpp.

float Teuchos::flt_nan = +0.0/sin(0.0)
 

Definition at line 38 of file Teuchos_ScalarTraits.cpp.

double Teuchos::dbl_nan = +0.0/sin(0.0)
 

Definition at line 39 of file Teuchos_ScalarTraits.cpp.


Generated on Thu Sep 18 12:41:20 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1