[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 |
|
---|
[882678] | 22 | /** Base type for all exceptions regarding linear algebra.
|
---|
| 23 | *
|
---|
| 24 | */
|
---|
[3bfd78] | 25 | struct LinearAlgebraException : virtual std::exception, virtual boost::exception { };
|
---|
| 26 |
|
---|
| 27 | /** ========================== General error information ================== */
|
---|
| 28 |
|
---|
[a700c4] | 29 | /** Exception information for LinearAlgebraException: determinant.
|
---|
[3bfd78] | 30 | */
|
---|
[a700c4] | 31 | typedef boost::error_info<struct tag_LinearAlgebraDeterminant, const double> LinearAlgebraDeterminant;
|
---|
| 32 |
|
---|
| 33 | /** Exception information for LinearAlgebraException: matrix.
|
---|
[3bfd78] | 34 | */
|
---|
[8b9c43] | 35 | typedef boost::error_info<struct tag_LinearAlgebraMatrixContent, const MatrixContent* const> LinearAlgebraMatrixContent;
|
---|
| 36 |
|
---|
| 37 | /** Exception information for LinearAlgebraException: vector.
|
---|
| 38 | */
|
---|
| 39 | typedef boost::error_info<struct tag_LinearAlgebraVector, const Vector* const> LinearAlgebraVector;
|
---|
[3bfd78] | 40 |
|
---|
[783e88] | 41 | /** Exception information for LinearAlgebraException: vector.
|
---|
| 42 | */
|
---|
| 43 | typedef boost::error_info<
|
---|
| 44 | struct tag_LinearAlgebraVectorPair,
|
---|
| 45 | const std::pair<const Vector* const, const Vector* const> > LinearAlgebraVectorPair;
|
---|
| 46 |
|
---|
[3bfd78] | 47 | /** ============================ Specific exceptions ====================== */
|
---|
| 48 |
|
---|
[783e88] | 49 | /** Exception thrown when two vectors are parallel, i.e. linear dependent.
|
---|
[3bfd78] | 50 | */
|
---|
[783e88] | 51 | struct LinearDependenceException : virtual LinearAlgebraException { };
|
---|
| 52 |
|
---|
| 53 | /** Exception thrown when are matrix is not invertiable, i.e. its determinant is NULL.
|
---|
| 54 | */
|
---|
| 55 | struct MultipleSolutionsException : virtual LinearAlgebraException { };
|
---|
[3bfd78] | 56 |
|
---|
[a700c4] | 57 | /** Exception thrown when are matrix is not invertiable, i.e. its determinant is NULL.
|
---|
| 58 | */
|
---|
| 59 | struct NotInvertibleException : virtual LinearAlgebraException { };
|
---|
| 60 |
|
---|
[783e88] | 61 | /** Exception thrown when two lines are skew, i.e. do not intersect.
|
---|
| 62 | */
|
---|
| 63 | struct SkewException : virtual LinearAlgebraException { };
|
---|
| 64 |
|
---|
[8b9c43] | 65 | /** Exception thrown when a vector with only zero components is invalidly encountered.
|
---|
| 66 | */
|
---|
| 67 | struct ZeroVectorException : virtual LinearAlgebraException { };
|
---|
| 68 |
|
---|
[3bfd78] | 69 | #endif /* EXCEPTIONS_HPP_ */
|
---|