7 #ifndef __IPDEBUG_HPP__
8 #define __IPDEBUG_HPP__
13 #ifndef IPOPT_CHECKLEVEL
14 #define IPOPT_CHECKLEVEL 0
17 #if IPOPT_CHECKLEVEL > 0
22 # define DBG_ASSERT(test) assert(test)
23 # define DBG_ASSERT_EXCEPTION(__condition, __except_type, __msg) \
24 ASSERT_EXCEPTION( (__condition), __except_type, __msg);
25 # define DBG_DO(__cmd) __cmd
27 # define DBG_ASSERT(test)
28 # define DBG_ASSERT_EXCEPTION(__condition, __except_type, __msg)
29 # define DBG_DO(__cmd)
32 #ifndef IPOPT_VERBOSITY
33 #define IPOPT_VERBOSITY 0
36 #if IPOPT_VERBOSITY < 1
37 # define DBG_START_FUN(__func_name, __verbose_level)
38 # define DBG_START_METH(__func_name, __verbose_level)
39 # define DBG_PRINT(__printf_args)
40 # define DBG_PRINT_VECTOR(__verbose_level, __vec_name, __vec)
41 # define DBG_PRINT_MATRIX(__verbose_level, __mat_name, __mat)
42 # define DBG_EXEC(__verbosity, __cmd)
43 # define DBG_VERBOSITY() 0
64 DebugJournalistWrapper(
65 std::string func_name,
69 DebugJournalistWrapper(
70 std::string func_name,
72 const void*
const method_owner
74 ~DebugJournalistWrapper();
81 return verbose_level_;
83 const Journalist* Jnlst()
87 Index IndentationLevel()
89 return indentation_level_;
101 friend class IpoptApplication;
108 static void SetJournalist(
123 DebugJournalistWrapper();
126 DebugJournalistWrapper(
127 const DebugJournalistWrapper&
131 DebugJournalistWrapper& operator=(
132 const DebugJournalistWrapper&
136 static Index indentation_level_;
137 std::string func_name_;
138 Index verbose_level_;
139 const void* method_owner_;
141 static Journalist* jrnl_;
145 # define DBG_START_FUN(__func_name, __verbose_level) \
146 DebugJournalistWrapper dbg_jrnl((__func_name), (__verbose_level)); \
148 # define DBG_START_METH(__func_name, __verbose_level) \
149 DebugJournalistWrapper dbg_jrnl((__func_name), (__verbose_level), this);
151 # define DBG_PRINT(__args) \
152 dbg_jrnl.DebugPrintf __args;
154 # define DBG_EXEC(__verbose_level, __cmd) \
155 if (dbg_jrnl.Verbosity() >= (__verbose_level)) { \
159 # define DBG_VERBOSITY() \
int Index
Type for all indices.
This file contains a base class for all exceptions and a set of macros to help with exceptions.