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