Mercurial > hg > kwantix
comparison src/include/error.hpp @ 61:b3bf4ac981ec default tip
Update the doxygen documentation
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Sat, 29 May 2010 20:01:40 -0500 |
parents | 11395e64852f |
children |
comparison
equal
deleted
inserted
replaced
60:0288895c1071 | 61:b3bf4ac981ec |
---|---|
18 #include <string> | 18 #include <string> |
19 | 19 |
20 namespace kwantix{ | 20 namespace kwantix{ |
21 //Structs to be thrown as exceptions | 21 //Structs to be thrown as exceptions |
22 using std::string; | 22 using std::string; |
23 | |
24 /*! \defgroup error */ | |
25 /// \{ | |
23 | 26 |
24 /// generic error and base struct. /*GSL_FAILURE = -1,*/ | 27 /// generic error and base struct. /*GSL_FAILURE = -1,*/ |
25 class error{ | 28 class error{ |
26 public: | 29 public: |
27 std::string reason, file; | 30 std::string reason, file; |
65 struct cannotReachToleranceInF ; | 68 struct cannotReachToleranceInF ; |
66 struct cannotReachToleranceInX ; | 69 struct cannotReachToleranceInX ; |
67 struct cannotReachToleranceInGradient ; | 70 struct cannotReachToleranceInGradient ; |
68 struct endOfFile ; | 71 struct endOfFile ; |
69 | 72 |
73 | |
74 | |
70 /*! \brief Custom error handler to be used for GSL. | 75 /*! \brief Custom error handler to be used for GSL. |
71 * | 76 * |
72 * Throw exceptions instead of calling abort(). | 77 * Throw exceptions instead of calling abort(). |
73 * | 78 * |
74 * Remember to put `gsl_set_error_handler(&errorHandler);' in the | 79 * Remember to put `gsl_set_error_handler(&errorHandler);' in the |
75 * main() loops when including this header file; otherwise it's | 80 * main() loops when including this header file; otherwise it's |
76 * useless! | 81 * useless! |
77 */ | 82 */ |
78 void errorHandler(const char * reason, const char * file, | 83 void errorHandler(const char * reason, const char * file, |
79 int line, int gsl_errno); | 84 int line, int gsl_errno); |
80 } | |
81 | |
82 | 85 |
83 //A few more details about the structs we're throwing as exceptions. | 86 //A few more details about the structs we're throwing as exceptions. |
84 namespace kwantix{ | |
85 using std::string; | 87 using std::string; |
86 | 88 |
87 ///GSL_CONTINUE = -2, /* iteration has not converged */ | 89 ///GSL_CONTINUE = -2, /* iteration has not converged */ |
88 struct noConvergence : public error { | 90 struct noConvergence : public error { |
89 noConvergence() {}; | 91 noConvergence() {}; |
322 indexOutOfRange() {}; | 324 indexOutOfRange() {}; |
323 indexOutOfRange(string r, string f, int l) : | 325 indexOutOfRange(string r, string f, int l) : |
324 badArgument(r,f,l) {}; | 326 badArgument(r,f,l) {}; |
325 }; | 327 }; |
326 | 328 |
329 /// \} | |
330 | |
327 }//namespace kwantix | 331 }//namespace kwantix |