lemon/attic/debug.h
author ladanyi
Wed, 17 Aug 2005 20:38:32 +0000
changeset 1638 4e50ed042394
parent 1359 1581f961cfaa
child 1875 98698b69a902
permissions -rw-r--r--
less stupid title
     1 /* -*- C++ -*-
     2  * lemon/debug.h - Part of LEMON, a generic C++ optimization library
     3  *
     4  * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6  *
     7  * Permission to use, modify and distribute this software is granted
     8  * provided that this copyright notice appears in all copies. For
     9  * precise terms see the accompanying LICENSE file.
    10  *
    11  * This software is provided "AS IS" with no warranty of any kind,
    12  * express or implied, and with no claim as to its suitability for any
    13  * purpose.
    14  *
    15  */
    16 
    17 #ifndef LEMON_DEBUG_H
    18 #define LEMON_DEBUG_H
    19 
    20 //! \file
    21 //! \brief Basic definitions for debug control.
    22 
    23 namespace lemon {
    24 
    25   //! Debug mode for testing/debugging
    26 
    27   //! Use this debug mode if you want exhaustive range and consistency checks.
    28   //! It also produces verbose debug messages.
    29   struct DebugOn {
    30     //! Example: check whether the edges added to a path are adjacent
    31     static const bool consistensy_check = true;
    32 
    33     static const bool range_check = true;
    34 
    35     //! Examples: initialize maps with some value;
    36     //! after deleting an item from UnionFindEnum set its value in the
    37     //! corresponding map to NULL...
    38     static const bool ensure_safe_state = true;
    39 
    40     static const int verbose = 5;
    41   };
    42 
    43   //! Debug mode for turning off debug aids.
    44 
    45   //! This debud mode switches off all range and consistency checks,
    46   //! as well as the debug messages.
    47   //!
    48   struct DebugOff {
    49     static const bool consistensy_check = false;
    50     static const bool range_check = false;
    51     static const bool ensure_safe_state = false;
    52     static const int verbose = 0;
    53   };
    54 
    55 #ifdef DEBUG
    56   //! The default debug mode.
    57 
    58   //! The default debug mode.
    59   //!
    60   typedef DebugOn DefaultDebugMode;
    61 #else
    62   //! The default debug mode. 
    63 
    64   //! The default debug mode. 
    65   //!
    66   typedef DebugOff DefaultDebugMode;
    67 #endif
    68 
    69 }
    70 #endif // LEMON_DEBUG_H