| 1 | 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
| 2 | 2 |
* |
| 3 | 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 |
* |
| 5 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_BITS_DEFAULT_MAP_H |
| 20 | 20 |
#define LEMON_BITS_DEFAULT_MAP_H |
| 21 | 21 |
|
| 22 |
#include <lemon/config.h> |
|
| 22 | 23 |
#include <lemon/bits/array_map.h> |
| 23 | 24 |
#include <lemon/bits/vector_map.h> |
| 24 | 25 |
//#include <lemon/bits/debug_map.h> |
| 25 | 26 |
|
| 26 | 27 |
//\ingroup graphbits |
| 27 | 28 |
//\file |
| 28 | 29 |
//\brief Graph maps that construct and destruct their elements dynamically. |
| 29 | 30 |
|
| 30 | 31 |
namespace lemon {
|
| 31 | 32 |
|
| 32 | 33 |
|
| 33 | 34 |
//#ifndef LEMON_USE_DEBUG_MAP |
| 34 | 35 |
|
| 35 | 36 |
template <typename _Graph, typename _Item, typename _Value> |
| 36 | 37 |
struct DefaultMapSelector {
|
| 37 | 38 |
typedef ArrayMap<_Graph, _Item, _Value> Map; |
| 38 | 39 |
}; |
| 39 | 40 |
|
| 40 | 41 |
// bool |
| 41 | 42 |
template <typename _Graph, typename _Item> |
| 42 | 43 |
struct DefaultMapSelector<_Graph, _Item, bool> {
|
| 43 | 44 |
typedef VectorMap<_Graph, _Item, bool> Map; |
| 44 | 45 |
}; |
| 45 | 46 |
| 1 | 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
| 2 | 2 |
* |
| 3 | 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 |
* |
| 5 | 5 |
* Copyright (C) 2003-2008 |
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 |
* |
| 9 | 9 |
* Permission to use, modify and distribute this software is granted |
| 10 | 10 |
* provided that this copyright notice appears in all copies. For |
| 11 | 11 |
* precise terms see the accompanying LICENSE file. |
| 12 | 12 |
* |
| 13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
| 14 | 14 |
* express or implied, and with no claim as to its suitability for any |
| 15 | 15 |
* purpose. |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_CORE_H |
| 20 | 20 |
#define LEMON_CORE_H |
| 21 | 21 |
|
| 22 | 22 |
#include <vector> |
| 23 | 23 |
#include <algorithm> |
| 24 | 24 |
|
| 25 |
#include <lemon/core.h> |
|
| 25 | 26 |
#include <lemon/bits/enable_if.h> |
| 26 | 27 |
#include <lemon/bits/traits.h> |
| 27 | 28 |
#include <lemon/assert.h> |
| 28 | 29 |
|
| 29 | 30 |
///\file |
| 30 | 31 |
///\brief LEMON core utilities. |
| 31 | 32 |
/// |
| 32 | 33 |
///This header file contains core utilities for LEMON. |
| 33 | 34 |
///It is automatically included by all graph types, therefore it usually |
| 34 | 35 |
///do not have to be included directly. |
| 35 | 36 |
|
| 36 | 37 |
namespace lemon {
|
| 37 | 38 |
|
| 38 | 39 |
/// \brief Dummy type to make it easier to create invalid iterators. |
| 39 | 40 |
/// |
| 40 | 41 |
/// Dummy type to make it easier to create invalid iterators. |
| 41 | 42 |
/// See \ref INVALID for the usage. |
| 42 | 43 |
struct Invalid {
|
| 43 | 44 |
public: |
| 44 | 45 |
bool operator==(Invalid) { return true; }
|
| 45 | 46 |
bool operator!=(Invalid) { return false; }
|
| 46 | 47 |
bool operator< (Invalid) { return false; }
|
| 47 | 48 |
}; |
| 48 | 49 |
|
0 comments (0 inline)