1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/lemon/attic/debug.h Wed Sep 29 15:30:04 2004 +0000
1.3 @@ -0,0 +1,70 @@
1.4 +/* -*- C++ -*-
1.5 + * src/lemon/debug.h - Part of LEMON, a generic C++ optimization library
1.6 + *
1.7 + * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.8 + * (Egervary Combinatorial Optimization Research Group, EGRES).
1.9 + *
1.10 + * Permission to use, modify and distribute this software is granted
1.11 + * provided that this copyright notice appears in all copies. For
1.12 + * precise terms see the accompanying LICENSE file.
1.13 + *
1.14 + * This software is provided "AS IS" with no warranty of any kind,
1.15 + * express or implied, and with no claim as to its suitability for any
1.16 + * purpose.
1.17 + *
1.18 + */
1.19 +
1.20 +#ifndef LEMON_DEBUG_H
1.21 +#define LEMON_DEBUG_H
1.22 +
1.23 +//! \file
1.24 +//! \brief Basic definitions for debug control.
1.25 +
1.26 +namespace lemon {
1.27 +
1.28 + //! Debug mode for testing/debugging
1.29 +
1.30 + //! Use this debug mode if you want exhaustive range and consistency checks.
1.31 + //! It also produces verbose debug messages.
1.32 + struct DebugOn {
1.33 + //! Example: check whether the edges added to a path are adjacent
1.34 + static const bool consistensy_check = true;
1.35 +
1.36 + static const bool range_check = true;
1.37 +
1.38 + //! Examples: initialize maps with some value;
1.39 + //! after deleting an item from UnionFindEnum set its value in the
1.40 + //! corresponding map to NULL...
1.41 + static const bool ensure_safe_state = true;
1.42 +
1.43 + static const int verbose = 5;
1.44 + };
1.45 +
1.46 + //! Debug mode for turning off debug aids.
1.47 +
1.48 + //! This debud mode switches off all range and consistency checks,
1.49 + //! as well as the debug messages.
1.50 + //!
1.51 + struct DebugOff {
1.52 + static const bool consistensy_check = false;
1.53 + static const bool range_check = false;
1.54 + static const bool ensure_safe_state = false;
1.55 + static const int verbose = 0;
1.56 + };
1.57 +
1.58 +#ifdef DEBUG
1.59 + //! The default debug mode.
1.60 +
1.61 + //! The default debug mode.
1.62 + //!
1.63 + typedef DebugOn DefaultDebugMode;
1.64 +#else
1.65 + //! The default debug mode.
1.66 +
1.67 + //! The default debug mode.
1.68 + //!
1.69 + typedef DebugOff DefaultDebugMode;
1.70 +#endif
1.71 +
1.72 +}
1.73 +#endif // LEMON_DEBUG_H