00001
00002
00003 #ifndef JMATH_JMATH_EXCEPTION_HPP
00004 #define JMATH_JMATH_EXCEPTION_HPP
00005
00006 #include "kernel/jafarException.hpp"
00007
00008 namespace jafar {
00009
00010 namespace jmath {
00011
00017 class JmathException : public jafar::kernel::Exception {
00018
00019 public:
00020
00024 enum ExceptionId {
00025 LAPACK_ERROR,
00026 SYSTEM_FULL,
00027 WRONG_SIZE,
00028 RESIZE_FAIL,
00029 WRONG_TYPE
00030 };
00031
00041 JmathException(ExceptionId id_,
00042 const std::string& message_,
00043 const std::string& file_, int line_) throw();
00044
00045 virtual ~JmathException() throw();
00046
00047 ExceptionId getExceptionId() const throw();
00048
00049 protected:
00050
00051 ExceptionId id;
00052
00053 static std::string exceptionIdToString(ExceptionId id_) throw();
00054
00055 };
00056
00082 class LapackException : public JmathException {
00083
00084 public:
00085
00086 int info;
00087
00088 LapackException(int info_,
00089 const std::string& message_,
00090 const std::string& file_, int line_) throw() :
00091 JmathException(LAPACK_ERROR, message_, file_, line_),
00092 info(info_)
00093 {}
00094
00095 virtual ~LapackException() throw() {}
00096
00097 };
00098
00099 }
00100 }
00101
00102 #endif // JMATH_JMATH_EXCEPTION_HPP
00103