src/work/peter/path/debug.h
author alpar
Wed, 22 Sep 2004 09:55:41 +0000
changeset 899 f485b3008cf5
child 921 818510fa3d99
permissions -rw-r--r--
Classes (and corresponting file names) renamed:
- MinLengthPaths -> Suurballe
- MinCostFlows -> MinCostFlow
hegyi@815
     1
// -*- C++ -*- //
hegyi@815
     2
hegyi@815
     3
#ifndef HUGO_DEBUG_H
hegyi@815
     4
#define HUGO_DEBUG_H
hegyi@815
     5
hegyi@815
     6
//! \file
hegyi@815
     7
//! \brief Basic definitions for debug control.
hegyi@815
     8
hegyi@815
     9
namespace hugo {
hegyi@815
    10
hegyi@815
    11
  //! Debug mode for testing/debugging
hegyi@815
    12
hegyi@815
    13
  //! Use this debug mode if you want exhaustive range and consistency checks.
hegyi@815
    14
  //! It also produces verbose debug messages.
hegyi@815
    15
  struct DebugOn {
hegyi@815
    16
    //! Example: check whether the edges added to a path are adjacent
hegyi@815
    17
    static const bool consistensy_check = true;
hegyi@815
    18
hegyi@815
    19
    static const bool range_check = true;
hegyi@815
    20
hegyi@815
    21
    //! Examples: initialize maps with some value;
hegyi@815
    22
    //! after deleting an item from UnionFindEnum set its value in the
hegyi@815
    23
    //! corresponding map to NULL...
hegyi@815
    24
    static const bool ensure_safe_state = true;
hegyi@815
    25
hegyi@815
    26
    static const int verbose = 5;
hegyi@815
    27
  };
hegyi@815
    28
hegyi@815
    29
  //! Debug mode for turning off debug aids.
hegyi@815
    30
hegyi@815
    31
  //! This debud mode switches off all range and consistency checks,
hegyi@815
    32
  //! as well as the debug messages.
hegyi@815
    33
  //!
hegyi@815
    34
  struct DebugOff {
hegyi@815
    35
    static const bool consistensy_check = false;
hegyi@815
    36
    static const bool range_check = false;
hegyi@815
    37
    static const bool ensure_safe_state = false;
hegyi@815
    38
    static const int verbose = 0;
hegyi@815
    39
  };
hegyi@815
    40
hegyi@815
    41
#ifdef DEBUG
hegyi@815
    42
  //! The default debug mode.
hegyi@815
    43
hegyi@815
    44
  //! The default debug mode.
hegyi@815
    45
  //!
hegyi@815
    46
  typedef DebugOn DefaultDebugMode;
hegyi@815
    47
#else
hegyi@815
    48
  //! The default debug mode. 
hegyi@815
    49
hegyi@815
    50
  //! The default debug mode. 
hegyi@815
    51
  //!
hegyi@815
    52
  typedef DebugOff DefaultDebugMode;
hegyi@815
    53
#endif
hegyi@815
    54
hegyi@815
    55
}
hegyi@815
    56
#endif // HUGO_DEBUG_H