| 1 | 1 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
| 2 | 2 |
|
| 3 | 3 |
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
| 4 | 4 |
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
| 5 | 5 |
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
| 6 | 6 |
SET(PROJECT_NAME "LEMON") |
| 7 | 7 |
SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.") |
| 8 | 8 |
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
| 9 | 9 |
|
| 10 | 10 |
PROJECT(${PROJECT_NAME})
|
| 11 | 11 |
|
| 12 | 12 |
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
| 13 | 13 |
|
| 14 | 14 |
INCLUDE(FindDoxygen) |
| 15 | 15 |
INCLUDE(FindGhostscript) |
| 16 | 16 |
FIND_PACKAGE(GLPK 4.33) |
| 17 | 17 |
FIND_PACKAGE(CPLEX) |
| 18 | 18 |
FIND_PACKAGE(COIN) |
| 19 | 19 |
|
| 20 |
IF(MSVC) |
|
| 21 |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
|
|
| 22 |
# Suppressed warnings: |
|
| 23 |
# C4250: 'class1' : inherits 'class2::member' via dominance |
|
| 24 |
# C4355: 'this' : used in base member initializer list |
|
| 25 |
# C4503: 'function' : decorated name length exceeded, name was truncated |
|
| 26 |
# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) |
|
| 27 |
# C4996: 'function': was declared deprecated |
|
| 28 |
ENDIF(MSVC) |
|
| 29 |
|
|
| 30 | 20 |
INCLUDE(CheckTypeSize) |
| 31 | 21 |
CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
|
| 32 | 22 |
|
| 33 | 23 |
ENABLE_TESTING() |
| 34 | 24 |
|
| 35 | 25 |
ADD_SUBDIRECTORY(lemon) |
| 36 | 26 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
| 37 | 27 |
ADD_SUBDIRECTORY(demo) |
| 38 | 28 |
ADD_SUBDIRECTORY(tools) |
| 39 | 29 |
ADD_SUBDIRECTORY(doc) |
| 40 | 30 |
ADD_SUBDIRECTORY(test) |
| 41 | 31 |
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
| 42 | 32 |
|
| 43 | 33 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
| 44 | 34 |
IF(WIN32) |
| 45 | 35 |
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
|
| 46 | 36 |
SET(CPACK_PACKAGE_VENDOR "EGRES") |
| 47 | 37 |
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
| 48 | 38 |
"LEMON - Library for Efficient Modeling and Optimization in Networks") |
| 49 | 39 |
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
| 50 | 40 |
|
| 51 | 41 |
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
| 52 | 42 |
|
| 53 | 43 |
SET(CPACK_PACKAGE_INSTALL_DIRECTORY |
| ... | ... |
@@ -6,48 +6,58 @@ |
| 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 | 25 |
#include <lemon/config.h> |
| 26 | 26 |
#include <lemon/bits/enable_if.h> |
| 27 | 27 |
#include <lemon/bits/traits.h> |
| 28 | 28 |
#include <lemon/assert.h> |
| 29 | 29 |
|
| 30 |
// Disable the following warnings when compiling with MSVC: |
|
| 31 |
// C4250: 'class1' : inherits 'class2::member' via dominance |
|
| 32 |
// C4355: 'this' : used in base member initializer list |
|
| 33 |
// C4503: 'function' : decorated name length exceeded, name was truncated |
|
| 34 |
// C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) |
|
| 35 |
// C4996: 'function': was declared deprecated |
|
| 36 |
#ifdef _MSC_VER |
|
| 37 |
#pragma warning( disable : 4250 4355 4503 4800 4996 ) |
|
| 38 |
#endif |
|
| 39 |
|
|
| 30 | 40 |
///\file |
| 31 | 41 |
///\brief LEMON core utilities. |
| 32 | 42 |
/// |
| 33 | 43 |
///This header file contains core utilities for LEMON. |
| 34 | 44 |
///It is automatically included by all graph types, therefore it usually |
| 35 | 45 |
///do not have to be included directly. |
| 36 | 46 |
|
| 37 | 47 |
namespace lemon {
|
| 38 | 48 |
|
| 39 | 49 |
/// \brief Dummy type to make it easier to create invalid iterators. |
| 40 | 50 |
/// |
| 41 | 51 |
/// Dummy type to make it easier to create invalid iterators. |
| 42 | 52 |
/// See \ref INVALID for the usage. |
| 43 | 53 |
struct Invalid {
|
| 44 | 54 |
public: |
| 45 | 55 |
bool operator==(Invalid) { return true; }
|
| 46 | 56 |
bool operator!=(Invalid) { return false; }
|
| 47 | 57 |
bool operator< (Invalid) { return false; }
|
| 48 | 58 |
}; |
| 49 | 59 |
|
| 50 | 60 |
/// \brief Invalid iterators. |
| 51 | 61 |
/// |
| 52 | 62 |
/// \ref Invalid is a global type that converts to each iterator |
| 53 | 63 |
/// in such a way that the value of the target iterator will be invalid. |
0 comments (0 inline)