| [3bfd78] | 1 | /*
 | 
|---|
 | 2 |  * Exceptions.hpp
 | 
|---|
 | 3 |  *
 | 
|---|
 | 4 |  *  Created on: Apr 1, 2011
 | 
|---|
 | 5 |  *      Author: heber
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #ifndef EXCEPTIONS_HPP_
 | 
|---|
 | 9 | #define EXCEPTIONS_HPP_
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 | // include config.h
 | 
|---|
 | 12 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 13 | #include <config.h>
 | 
|---|
 | 14 | #endif
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | #include <exception>
 | 
|---|
 | 17 | #include <boost/exception.hpp>
 | 
|---|
 | 18 | 
 | 
|---|
 | 19 | class MatrixContent;
 | 
|---|
| [8b9c43] | 20 | class Vector;
 | 
|---|
| [3bfd78] | 21 | 
 | 
|---|
 | 22 | struct LinearAlgebraException : virtual std::exception, virtual boost::exception { };
 | 
|---|
 | 23 | 
 | 
|---|
 | 24 | /** ========================== General error information ================== */
 | 
|---|
 | 25 | 
 | 
|---|
| [a700c4] | 26 | /** Exception information for LinearAlgebraException: determinant.
 | 
|---|
| [3bfd78] | 27 |  */
 | 
|---|
| [a700c4] | 28 | typedef boost::error_info<struct tag_LinearAlgebraDeterminant, const double> LinearAlgebraDeterminant;
 | 
|---|
 | 29 | 
 | 
|---|
 | 30 | /** Exception information for LinearAlgebraException: matrix.
 | 
|---|
| [3bfd78] | 31 |  */
 | 
|---|
| [8b9c43] | 32 | typedef boost::error_info<struct tag_LinearAlgebraMatrixContent, const MatrixContent* const> LinearAlgebraMatrixContent;
 | 
|---|
 | 33 | 
 | 
|---|
 | 34 | /** Exception information for LinearAlgebraException: vector.
 | 
|---|
 | 35 |  */
 | 
|---|
 | 36 | typedef boost::error_info<struct tag_LinearAlgebraVector, const Vector* const> LinearAlgebraVector;
 | 
|---|
| [3bfd78] | 37 | 
 | 
|---|
| [783e88] | 38 | /** Exception information for LinearAlgebraException: vector.
 | 
|---|
 | 39 |  */
 | 
|---|
 | 40 | typedef boost::error_info<
 | 
|---|
 | 41 |     struct tag_LinearAlgebraVectorPair,
 | 
|---|
 | 42 |     const std::pair<const Vector* const, const Vector* const> > LinearAlgebraVectorPair;
 | 
|---|
 | 43 | 
 | 
|---|
| [3bfd78] | 44 | /** ============================ Specific exceptions ====================== */
 | 
|---|
 | 45 | 
 | 
|---|
| [783e88] | 46 | /** Exception thrown when two vectors are parallel, i.e. linear dependent.
 | 
|---|
| [3bfd78] | 47 |  */
 | 
|---|
| [783e88] | 48 | struct LinearDependenceException : virtual LinearAlgebraException { };
 | 
|---|
 | 49 | 
 | 
|---|
 | 50 | /** Exception thrown when are matrix is not invertiable, i.e. its determinant is NULL.
 | 
|---|
 | 51 |  */
 | 
|---|
 | 52 | struct MultipleSolutionsException : virtual LinearAlgebraException { };
 | 
|---|
| [3bfd78] | 53 | 
 | 
|---|
| [a700c4] | 54 | /** Exception thrown when are matrix is not invertiable, i.e. its determinant is NULL.
 | 
|---|
 | 55 |  */
 | 
|---|
 | 56 | struct NotInvertibleException : virtual LinearAlgebraException { };
 | 
|---|
 | 57 | 
 | 
|---|
| [783e88] | 58 | /** Exception thrown when two lines are skew, i.e. do not intersect.
 | 
|---|
 | 59 |  */
 | 
|---|
 | 60 | struct SkewException : virtual LinearAlgebraException { };
 | 
|---|
 | 61 | 
 | 
|---|
| [8b9c43] | 62 | /** Exception thrown when a vector with only zero components is invalidly encountered.
 | 
|---|
 | 63 |  */
 | 
|---|
 | 64 | struct ZeroVectorException : virtual LinearAlgebraException { };
 | 
|---|
 | 65 | 
 | 
|---|
| [3bfd78] | 66 | #endif /* EXCEPTIONS_HPP_ */
 | 
|---|