lemon/attic/debug.h
author kpeter
Mon, 18 Feb 2008 03:32:06 +0000
changeset 2575 e866e288cba6
parent 2391 14a343be7a5a
permissions -rw-r--r--
Major improvements in NetworkSimplex.

Main changes:
- Use -potenital[] instead of potential[] to conform to the usual
terminology.
- Use function parameter instead of #define commands to select pivot rule.
- Use much faster implementation for the candidate list pivot rule.
It is about 5-20 times faster now.
- Add a new pivot rule called "Limited Search" that is a modified
version of "Block Search". It is about 25 percent faster on rather
sparse graphs.
- By default "Limited Search" is used for sparse graphs and
"Block Search" is used otherwise. This combined method is the most
efficient on every input class.
- Change the name of private members to start with "_".
- Change the name of function parameters not to start with "_".
- Remove unnecessary documentation for private members.
- Many doc improvements.
     1 /* -*- C++ -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library
     4  *
     5  * Copyright (C) 2003-2008
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 #ifndef LEMON_DEBUG_H
    20 #define LEMON_DEBUG_H
    21 
    22 //! \file
    23 //! \brief Basic definitions for debug control.
    24 
    25 namespace lemon {
    26 
    27   //! Debug mode for testing/debugging
    28 
    29   //! Use this debug mode if you want exhaustive range and consistency checks.
    30   //! It also produces verbose debug messages.
    31   struct DebugOn {
    32     //! Example: check whether the edges added to a path are adjacent
    33     static const bool consistensy_check = true;
    34 
    35     static const bool range_check = true;
    36 
    37     //! Examples: initialize maps with some value;
    38     //! after deleting an item from UnionFindEnum set its value in the
    39     //! corresponding map to NULL...
    40     static const bool ensure_safe_state = true;
    41 
    42     static const int verbose = 5;
    43   };
    44 
    45   //! Debug mode for turning off debug aids.
    46 
    47   //! This debud mode switches off all range and consistency checks,
    48   //! as well as the debug messages.
    49   //!
    50   struct DebugOff {
    51     static const bool consistensy_check = false;
    52     static const bool range_check = false;
    53     static const bool ensure_safe_state = false;
    54     static const int verbose = 0;
    55   };
    56 
    57 #ifdef DEBUG
    58   //! The default debug mode.
    59 
    60   //! The default debug mode.
    61   //!
    62   typedef DebugOn DefaultDebugMode;
    63 #else
    64   //! The default debug mode. 
    65 
    66   //! The default debug mode. 
    67   //!
    68   typedef DebugOff DefaultDebugMode;
    69 #endif
    70 
    71 }
    72 #endif // LEMON_DEBUG_H