| 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;
 | 
|---|
| 20 | class Vector;
 | 
|---|
| 21 | 
 | 
|---|
| 22 | struct LinearAlgebraException : virtual std::exception, virtual boost::exception { };
 | 
|---|
| 23 | 
 | 
|---|
| 24 | /** ========================== General error information ================== */
 | 
|---|
| 25 | 
 | 
|---|
| 26 | /** Exception information for LinearAlgebraException: determinant.
 | 
|---|
| 27 |  */
 | 
|---|
| 28 | typedef boost::error_info<struct tag_LinearAlgebraDeterminant, const double> LinearAlgebraDeterminant;
 | 
|---|
| 29 | 
 | 
|---|
| 30 | /** Exception information for LinearAlgebraException: matrix.
 | 
|---|
| 31 |  */
 | 
|---|
| 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;
 | 
|---|
| 37 | 
 | 
|---|
| 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 | 
 | 
|---|
| 44 | /** ============================ Specific exceptions ====================== */
 | 
|---|
| 45 | 
 | 
|---|
| 46 | /** Exception thrown when two vectors are parallel, i.e. linear dependent.
 | 
|---|
| 47 |  */
 | 
|---|
| 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 { };
 | 
|---|
| 53 | 
 | 
|---|
| 54 | /** Exception thrown when are matrix is not invertiable, i.e. its determinant is NULL.
 | 
|---|
| 55 |  */
 | 
|---|
| 56 | struct NotInvertibleException : virtual LinearAlgebraException { };
 | 
|---|
| 57 | 
 | 
|---|
| 58 | /** Exception thrown when two lines are skew, i.e. do not intersect.
 | 
|---|
| 59 |  */
 | 
|---|
| 60 | struct SkewException : virtual LinearAlgebraException { };
 | 
|---|
| 61 | 
 | 
|---|
| 62 | /** Exception thrown when a vector with only zero components is invalidly encountered.
 | 
|---|
| 63 |  */
 | 
|---|
| 64 | struct ZeroVectorException : virtual LinearAlgebraException { };
 | 
|---|
| 65 | 
 | 
|---|
| 66 | #endif /* EXCEPTIONS_HPP_ */
 | 
|---|