|
|
@ -1,5 +1,5 @@ |
|
|
|
#ifndef MRMC_EXCEPTIONS_NO_CONVERGENCE_H_ |
|
|
|
#define MRMC_EXCEPTIONS_NO_CONVERGENCE_H_ |
|
|
|
#ifndef MRMC_EXCEPTIONS_NOCONVERGENCEEXCEPTION_H_ |
|
|
|
#define MRMC_EXCEPTIONS_NOCONVERGENCEEXCEPTION_H_ |
|
|
|
|
|
|
|
#include <exception> |
|
|
|
|
|
|
@ -7,7 +7,7 @@ namespace mrmc { |
|
|
|
namespace exceptions { |
|
|
|
|
|
|
|
//!This exception is thrown when an iterative solver failed to converge with the given maxIterations |
|
|
|
class NoConvergence : public std::exception |
|
|
|
class NoConvergenceException : public std::exception |
|
|
|
{ |
|
|
|
public: |
|
|
|
/* The Visual C++-Version of the exception class has constructors accepting |
|
|
@ -17,27 +17,27 @@ class NoConvergence : public std::exception |
|
|
|
* constructor is used under linux (which will ignore the parameter) |
|
|
|
*/ |
|
|
|
#ifdef _WIN32 |
|
|
|
NoConvergence() : exception("::mrmc::NoConvergence"){ |
|
|
|
NoConvergenceException() : exception("::mrmc::exceptions::NoConvergenceException"){ |
|
|
|
iterations = -1; |
|
|
|
maxIterations = -1; |
|
|
|
} |
|
|
|
NoConvergence(const char * const s, int iterations, int maxIterations): exception(s) { |
|
|
|
NoConvergenceException(const char * const s, int iterations, int maxIterations): exception(s) { |
|
|
|
this->iterations = iterations; |
|
|
|
this->maxIterations = maxIterations; |
|
|
|
} |
|
|
|
#else |
|
|
|
NoConvergence() : exception() { |
|
|
|
NoConvergenceException() : exception() { |
|
|
|
iterations = -1; |
|
|
|
maxIterations = -1; |
|
|
|
} |
|
|
|
NoConvergence(const char * const s, int iterations, int maxIterations): exception() { |
|
|
|
NoConvergenceException(const char * const s, int iterations, int maxIterations): exception() { |
|
|
|
this->iterations = iterations; |
|
|
|
this->maxIterations = maxIterations; |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
virtual const char* what() const throw() |
|
|
|
{ return "mrmc::NoConvergence"; } |
|
|
|
{ return "mrmc::exceptions::NoConvergenceException"; } |
|
|
|
|
|
|
|
int getIterationCount() const { |
|
|
|
return iterations; |
|
|
@ -53,4 +53,4 @@ class NoConvergence : public std::exception |
|
|
|
} // namespace exceptions |
|
|
|
} // namespace mrmc |
|
|
|
|
|
|
|
#endif // MRMC_EXCEPTIONS_NO_CONVERGENCE_H_ |
|
|
|
#endif // MRMC_EXCEPTIONS_NOCONVERGENCEEXCEPTION_H_ |
xxxxxxxxxx