Many algorithms in the Polymake Template Library contain various plausibility checks which help to discover some common programming errors such as array boundaries violation etc. When an error condition is recognized, an exception std::logical_error is thrown. The exception object contains a short message describing the location and the nature of the error.

If you want to investigate the cause of such an error using some debugger program such as gdb, you can set a breakpoint at an empty function break_on_throw, which is called immediately before the throw statement is executed.

However, the plausibility checks are expensive, in general, and program's performance usually suffers badly. Therefore, they should be disabled as soon as the program being developed is considered to be correct. The disabling is made by means of C++ preprocessor directives, which implies that you must recompile your program with additional compiler options as described below.

The plausibility checks performed in the library are divided into a few categories. Each of them can be enabled or disabled separately. To enable a category, add a compiler option -Dname=1 . To disable, supply -Dname=0 .

INDEX_CHECKS
This category includes index range checks in random access operations to array elements, matrix rows and columns, graph nodes, and similar. These checks are performed only in the methods of the container classes, but not in the context of random-access iterators, since the latter are unable to retrieve any information about the size of the container they are running along.
DIMENSION_CHECKS
These checks assert that vector and matrix operations are well-defined. For example, two vectors to be added have the same dimension, a matrix to be inverted is square etc.
AVL_CHECKS
These checks are performed in the access methods of the containers represented with binary search (AVL) trees. They assure that the keys of elements being successively inserted into the container, build a strictly ascending sequence.
ALL_PLAUSIBLE_CHECKS
It covers all the checks listed above. The value assigned to this symbol applies to all categories that are not enabled or disabled explicitly.

The default behavior, when no category is mentioned at all, is to enable all plausibility checks. It is announced with a preprocessor warning.

See also various compilation modi useful for client debugging.