itpp_sci  4
Macros
Errorhandlingfunc

Macros

#define itpp_sci_assert(t, s)
 Abort if t is not true. More...
 
#define itpp_sci_assert_debug(t, s)   itpp_sci_assert(t,s)
 Abort if t is not true and NDEBUG is not defined. More...
 
#define itpp_sci_assert0(t, s)   itpp_sci_assert_debug(t,s)
 Deprecated macro. Please use itpp_sci_assert_debug() instead. More...
 
#define itpp_sci_assert1(t, s)   itpp_sci_assert_debug(t,s)
 Deprecated macro. Please use itpp_sci_assert_debug() instead. More...
 
#define itpp_sci_error_if(t, s)
 Abort if t is true. More...
 
#define itpp_sci_error(s)
 Abort unconditionally. More...
 
#define itpp_sci_info(s)
 Print information message. More...
 
#define itpp_sci_info_no_endl(s)
 Print information message withot std::endl at the end. More...
 
#define itpp_sci_info_debug(s)   itpp_sci_info(s)
 Print information message if NDEBUG is not defined. More...
 
#define itpp_sci_info_no_endl_debug(s)   itpp_sci_info_no_endl(s)
 Print information message withot std::endl at the end if NDEBUG is not defined. More...
 
#define itpp_sci_warning(s)
 Display a warning message. More...
 

Detailed Description

For the following macros, the argument s is a string that is displayed.

itpp_sci_assert(t,s); // Abort if t is not true
itpp_sci_assert_debug(t,s); // Abort if t is not true and NDEBUG is not defined
itpp_sci_error_if(t,s); // Abort if t is true
itpp_sci_error(s); // Abort
itpp_sci_info(s); // Display a message
itpp_sci_info_debug(s); // Display a message if NDEBUG is not defined
itpp_sci_info_no_endl(s); // Display a message without appended "std::endl"
itpp_sci_info_no_endl_debug(s); // Display a message without appended "std::endl" if NDEBUG is not defined
itpp_sci_warning(s); // Display a warning

itpp_sci_assert(), itpp_sci_error(), itpp_sci_error_if(), itpp_sci_info(), itpp_sci_info_no_endl() and itpp_sci_warning() are always active, whereas itpp_sci_assert_debug(), itpp_sci_info_debug() and itpp_sci_info_no_endl_debug() depends on the NDEBUG compile time definition. If NDEBUG is defined, then none of these macros is executed.

Note
itpp_sci_assert0() and itpp_sci_assert1() macros are still defined for backward compatibility, but itpp_sci_assert_debug() should be used instead of them.

Macro Definition Documentation

#define itpp_sci_assert (   t,
 
)
Value:
if (!(t)) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::itpp_sci_assert_f(#t,m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
string s
Definition: scipy_dbg.py:27
tuple t
Definition: scipy_dbg.py:33

Abort if t is not true.

#define itpp_sci_assert0 (   t,
 
)    itpp_sci_assert_debug(t,s)

Deprecated macro. Please use itpp_sci_assert_debug() instead.

#define itpp_sci_assert1 (   t,
 
)    itpp_sci_assert_debug(t,s)

Deprecated macro. Please use itpp_sci_assert_debug() instead.

#define itpp_sci_assert_debug (   t,
 
)    itpp_sci_assert(t,s)

Abort if t is not true and NDEBUG is not defined.

#define itpp_sci_error (   s)
Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::itpp_sci_error_f(m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
string s
Definition: scipy_dbg.py:27

Abort unconditionally.

#define itpp_sci_error_if (   t,
 
)
Value:
if((t)) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::itpp_sci_error_f(m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
string s
Definition: scipy_dbg.py:27
tuple t
Definition: scipy_dbg.py:33

Abort if t is true.

#define itpp_sci_info (   s)
Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s << std::endl; \
itpp::itpp_sci_info_f(m_sout.str()); \
} else \
((void) 0)
string s
Definition: scipy_dbg.py:27

Print information message.

#define itpp_sci_info_debug (   s)    itpp_sci_info(s)

Print information message if NDEBUG is not defined.

#define itpp_sci_info_no_endl (   s)
Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::itpp_sci_info_f(m_sout.str()); \
} else \
((void) 0)
string s
Definition: scipy_dbg.py:27

Print information message withot std::endl at the end.

#define itpp_sci_info_no_endl_debug (   s)    itpp_sci_info_no_endl(s)

Print information message withot std::endl at the end if NDEBUG is not defined.

#define itpp_sci_warning (   s)
Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::itpp_sci_warning_f(m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
string s
Definition: scipy_dbg.py:27

Display a warning message.