Scythe-1.0.3
Classes | Namespaces | Defines | Functions
error.h File Reference

Definitions of Scythe exception classes. More...

#include <exception>
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <cstring>
Include dependency graph for error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scythe::scythe_exception
 The Scythe exception abstract base class. More...
class  scythe::scythe_alloc_error
 Memory allocation error. More...
class  scythe::scythe_invalid_arg
 Invalid function argument. More...
class  scythe::scythe_file_error
 File i/o error. More...
class  scythe::scythe_conformation_error
 Matrix conformation error. More...
class  scythe::scythe_dimension_error
 Matrix dimension error. More...
class  scythe::scythe_null_error
 Null Matrix error. More...
class  scythe::scythe_type_error
 Matrix type error. More...
class  scythe::scythe_bounds_error
 Element out of bounds error. More...
class  scythe::scythe_convergence_error
 Numerical convergence error. More...
class  scythe::scythe_range_error
 Numerical underflow or overflow error. More...
class  scythe::scythe_precision_error
 Numerical precision error. More...
class  scythe::scythe_randseed_error
 Random number seed error. More...
class  scythe::scythe_style_error
 Matrix style error. More...
class  scythe::scythe_lapack_internal_error
 LAPACK Internal Error. More...
class  scythe::scythe_unexpected_default_error
 Unexpected call to default error. More...

Namespaces

namespace  scythe
 

The Scythe library namespace.


Defines

#define SCYTHE_THROW(EXCEP, MSG)
#define SCYTHE_CHECK(CHECK, EXCEP, MSG)
#define SCYTHE_WARN_RPACK(MSG)
#define SCYTHE_WARN_STD(MSG)
#define SCYTHE_WARN   SCYTHE_WARN_STD
#define SCYTHE_CHECK_WARN(CHECK, MSG)
#define SCYTHE_CHECK_10(CHECK, EXCEP, MSG)   SCYTHE_CHECK(CHECK,EXCEP,MSG)
#define SCYTHE_CHECK_20(CHECK, EXCEP, MSG)   SCYTHE_CHECK(CHECK,EXCEP,MSG)
#define SCYTHE_CHECK_30(CHECK, EXCEP, MSG)   SCYTHE_CHECK(CHECK,EXCEP,MSG)
#define SCYTHE_THROW_10(EXCEP, MSG)   SCYTHE_THROW(EXCEP,MSG)
#define SCYTHE_THROW_20(EXCEP, MSG)   SCYTHE_THROW(EXCEP,MSG)
#define SCYTHE_THROW_30(EXCEP, MSG)   SCYTHE_THROW(EXCEP,MSG)

Functions

void scythe::scythe_terminate ()

Detailed Description

Definitions of Scythe exception classes.

This file contains the class definitions for scythe::scythe_exception and its children. These exception classes describe all of the error conditions generated by Scythe library routines.

Furthermore, error.h contains a series of macro definitions that regulate the inclusion of the library's error checking code in compiled code. These macros are controlled by the compiler flag SCYTHE_DEBUG and define four levels of scythe debug info, SCYTHE_DEBUG = 0, 1, 2, or 3. The library uses these macros to specify the debug level of thrown exceptions. If we are at level three, all throws are expanded into actual code, at level 2 only SCYTHE_THROW_10 AND SCYTHE_THROW_20 calls are expanded, and so on. Scythe developers should balance exception importance and efficiency costs when making exception level choices. For example, bounds checking in matrices is done at level three primarily because the added branch results in high performance penalties and out-of-bounds errors shouldn't occur in well-written code, while conformance checks in matrix multiplication are level 1 because the checks result in little overhead relative to the cost of matrix multiplication and conformation errors are easy to introduce by accident. At level 0, the library performs virtually no error checking.

While the various SCYTHE_THROW, SCYTHE_CHECK, and SCYTHE_WARN macros will only typically be used by library developers, users should make extensive use the tiered error reporting in Scythe by setting the compiler flag SCYTHE_DEBUG. If not explicitly set by the user, the SCYTHE_DEBUG level is automatically set to 3.