alpar@906: /* -*- C++ -*- ladanyi@1435: * lemon/debug.h - Part of LEMON, a generic C++ optimization library alpar@906: * alpar@1164: * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1359: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@906: * alpar@906: * Permission to use, modify and distribute this software is granted alpar@906: * provided that this copyright notice appears in all copies. For alpar@906: * precise terms see the accompanying LICENSE file. alpar@906: * alpar@906: * This software is provided "AS IS" with no warranty of any kind, alpar@906: * express or implied, and with no claim as to its suitability for any alpar@906: * purpose. alpar@906: * alpar@906: */ alpar@883: alpar@921: #ifndef LEMON_DEBUG_H alpar@921: #define LEMON_DEBUG_H alpar@883: alpar@883: //! \file alpar@883: //! \brief Basic definitions for debug control. alpar@883: alpar@921: namespace lemon { alpar@883: alpar@883: //! Debug mode for testing/debugging alpar@883: alpar@883: //! Use this debug mode if you want exhaustive range and consistency checks. alpar@883: //! It also produces verbose debug messages. alpar@883: struct DebugOn { alpar@883: //! Example: check whether the edges added to a path are adjacent alpar@883: static const bool consistensy_check = true; alpar@883: alpar@883: static const bool range_check = true; alpar@883: alpar@883: //! Examples: initialize maps with some value; alpar@883: //! after deleting an item from UnionFindEnum set its value in the alpar@883: //! corresponding map to NULL... alpar@883: static const bool ensure_safe_state = true; alpar@883: alpar@883: static const int verbose = 5; alpar@883: }; alpar@883: alpar@883: //! Debug mode for turning off debug aids. alpar@883: alpar@883: //! This debud mode switches off all range and consistency checks, alpar@883: //! as well as the debug messages. alpar@883: //! alpar@883: struct DebugOff { alpar@883: static const bool consistensy_check = false; alpar@883: static const bool range_check = false; alpar@883: static const bool ensure_safe_state = false; alpar@883: static const int verbose = 0; alpar@883: }; alpar@883: alpar@883: #ifdef DEBUG alpar@883: //! The default debug mode. alpar@883: alpar@883: //! The default debug mode. alpar@883: //! alpar@883: typedef DebugOn DefaultDebugMode; alpar@883: #else alpar@883: //! The default debug mode. alpar@883: alpar@883: //! The default debug mode. alpar@883: //! alpar@883: typedef DebugOff DefaultDebugMode; alpar@883: #endif alpar@883: alpar@883: } alpar@921: #endif // LEMON_DEBUG_H