10#ifndef TLAPACK_EXCEPTION_HH
11#define TLAPACK_EXCEPTION_HH
23#ifndef TLAPACK_DEFAULT_INFCHECK
24 #define TLAPACK_DEFAULT_INFCHECK true
34#ifndef TLAPACK_DEFAULT_NANCHECK
35 #define TLAPACK_DEFAULT_NANCHECK true
86#if defined(TLAPACK_CHECK_INPUT) && !defined(TLAPACK_NDEBUG)
98 #define tlapack_check(cond) \
100 if (!static_cast<bool>(cond)) throw std::domain_error(#cond); \
113 #define tlapack_check_false(cond) \
115 if (static_cast<bool>(cond)) throw std::domain_error(#cond); \
122 #define tlapack_check_false(cond) ((void)0)
123 #define tlapack_check(cond) ((void)0)
130#ifndef TLAPACK_NDEBUG
142 #define tlapack_error(info, detailedInfo) \
143 throw std::runtime_error( \
144 tlapack::internal::error_msg(info, detailedInfo))
156 #define tlapack_warning(info, detailedInfo) \
157 std::cerr << tlapack::internal::error_msg(info, detailedInfo) \
171 #define tlapack_error_if(cond, info, detailedInfo) \
173 if (static_cast<bool>(cond)) tlapack_error(info, detailedInfo); \
180 #define tlapack_error(info, detailedInfo) ((void)0)
181 #define tlapack_warning(info, detailedInfo) ((void)0)
182 #define tlapack_error_if(cond, info, detailedInfo) ((void)0)
constexpr ErrorCheck NO_ERROR_CHECK
Options to disable error checking.
Definition exceptionHandling.hpp:70
#define TLAPACK_DEFAULT_INFCHECK
Default behavior of checks for Infs.
Definition exceptionHandling.hpp:24
std::string error_msg(int info, const std::string &detailedInfo)
Create a string with the error message.
Definition exceptionHandling.hpp:50
#define TLAPACK_DEFAULT_NANCHECK
Default behavior of checks for NaNs.
Definition exceptionHandling.hpp:35
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113
Options for error checking.
Definition exceptionHandling.hpp:76
Descriptor for Exception Handling.
Definition exceptionHandling.hpp:60
bool nan
Default behavior of nan check.
Definition exceptionHandling.hpp:62
bool internal
Used to enable / disable internal checks.
Definition exceptionHandling.hpp:63
bool inf
Default behavior of inf check.
Definition exceptionHandling.hpp:61