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