Debugging and Errors

The makefile delivered with the code allows for setting one of two modes

It is recommended to develop the program in DEBU(G) mode, which differs in comparison to OPTI in that DEBUG is defined and asserts are included during compile time. In particular, this setting includes numerous range checks and tests on compatibility of matrix dimensions as well as on initialization.

Because the first versions of this code were developed before exceptions were part of standard C++, a much weaker mechanism for locating errors was implemented. Upon detections of some error condition, the corresponding matrix routine constructs an error message and outputs this via the routine CH_Matrix_Classes::MEmessage(), implemented as the first routine in the file (within the subdirectory Matrix). For debugging, it is convenient to place a breakpoint within this routine on the line with the exit() statement. The Messages themselves are often not as helpful as one might hope; they are documented in Classes and Functions used for Debugging.

Once you have made sure, that your code no longer needs the safeguards against range and dimension violations, compile in OPTI mode in order to speed up computation.