Merge
authorAlpar Juttner <alpar@cs.elte.hu>
Sun, 29 Mar 2009 22:19:14 +0100
changeset 55149a39bae067c
parent 550 c5fd2d996909
parent 549 f53d641aa967
child 552 6e0525ec5355
Merge
     1.1 --- a/CMakeLists.txt	Sun Mar 29 23:08:20 2009 +0200
     1.2 +++ b/CMakeLists.txt	Sun Mar 29 22:19:14 2009 +0100
     1.3 @@ -9,7 +9,7 @@
     1.4  
     1.5  PROJECT(${PROJECT_NAME})
     1.6  
     1.7 -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
     1.8 +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
     1.9  
    1.10  INCLUDE(FindDoxygen)
    1.11  INCLUDE(FindGhostscript)
    1.12 @@ -38,74 +38,78 @@
    1.13  ENABLE_TESTING()
    1.14  
    1.15  ADD_SUBDIRECTORY(lemon)
    1.16 -ADD_SUBDIRECTORY(demo)
    1.17 -ADD_SUBDIRECTORY(tools)
    1.18 -ADD_SUBDIRECTORY(doc)
    1.19 -ADD_SUBDIRECTORY(test)
    1.20 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.21 +  ADD_SUBDIRECTORY(demo)
    1.22 +  ADD_SUBDIRECTORY(tools)
    1.23 +  ADD_SUBDIRECTORY(doc)
    1.24 +  ADD_SUBDIRECTORY(test)
    1.25 +ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.26  
    1.27 -IF(WIN32)
    1.28 -  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
    1.29 -  SET(CPACK_PACKAGE_VENDOR "EGRES")
    1.30 -  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
    1.31 -    "LEMON - Library of Efficient Models and Optimization in Networks")
    1.32 -  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
    1.33 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.34 +  IF(WIN32)
    1.35 +    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
    1.36 +    SET(CPACK_PACKAGE_VENDOR "EGRES")
    1.37 +    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
    1.38 +      "LEMON - Library of Efficient Models and Optimization in Networks")
    1.39 +    SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
    1.40  
    1.41 -  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
    1.42 +    SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
    1.43  
    1.44 -  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
    1.45 -    "${PROJECT_NAME} ${PROJECT_VERSION}")
    1.46 -  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
    1.47 -    "${PROJECT_NAME} ${PROJECT_VERSION}")
    1.48 +    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
    1.49 +      "${PROJECT_NAME} ${PROJECT_VERSION}")
    1.50 +    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
    1.51 +      "${PROJECT_NAME} ${PROJECT_VERSION}")
    1.52  
    1.53 -  SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
    1.54 +    SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
    1.55  
    1.56 -  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
    1.57 -  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
    1.58 -  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
    1.59 -  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
    1.60 +    SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
    1.61 +    SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
    1.62 +    SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
    1.63 +    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
    1.64  
    1.65 -  SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
    1.66 -    "C++ header files")
    1.67 -  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
    1.68 -    "DLL and import library")
    1.69 -  SET(CPACK_COMPONENT_BIN_DESCRIPTION
    1.70 -    "Command line utilities")
    1.71 -  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
    1.72 -    "Doxygen generated documentation")
    1.73 +    SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
    1.74 +      "C++ header files")
    1.75 +    SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
    1.76 +      "DLL and import library")
    1.77 +    SET(CPACK_COMPONENT_BIN_DESCRIPTION
    1.78 +      "Command line utilities")
    1.79 +    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
    1.80 +      "Doxygen generated documentation")
    1.81  
    1.82 -  SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
    1.83 +    SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
    1.84  
    1.85 -  SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
    1.86 -  SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
    1.87 -  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
    1.88 +    SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
    1.89 +    SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
    1.90 +    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
    1.91  
    1.92 -  SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
    1.93 -    "Components needed to develop software using LEMON")
    1.94 -  SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
    1.95 -    "Documentation of LEMON")
    1.96 +    SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
    1.97 +      "Components needed to develop software using LEMON")
    1.98 +    SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
    1.99 +      "Documentation of LEMON")
   1.100  
   1.101 -  SET(CPACK_ALL_INSTALL_TYPES Full Developer)
   1.102 +    SET(CPACK_ALL_INSTALL_TYPES Full Developer)
   1.103  
   1.104 -  SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
   1.105 -  SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
   1.106 -  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
   1.107 +    SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
   1.108 +    SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
   1.109 +    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
   1.110  
   1.111 -  SET(CPACK_GENERATOR "NSIS")
   1.112 -  SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
   1.113 -  SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
   1.114 -  #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
   1.115 -  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
   1.116 -  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
   1.117 -  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
   1.118 -  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
   1.119 -  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
   1.120 -  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
   1.121 -    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
   1.122 -    ")
   1.123 -  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
   1.124 -    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
   1.125 -    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
   1.126 -    ")
   1.127 +    SET(CPACK_GENERATOR "NSIS")
   1.128 +    SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
   1.129 +    SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
   1.130 +    #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
   1.131 +    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
   1.132 +    SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
   1.133 +    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
   1.134 +    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
   1.135 +    SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
   1.136 +    SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
   1.137 +      CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
   1.138 +      ")
   1.139 +    SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
   1.140 +      !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
   1.141 +      Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
   1.142 +      ")
   1.143  
   1.144 -  INCLUDE(CPack)
   1.145 -ENDIF(WIN32)
   1.146 +    INCLUDE(CPack)
   1.147 +  ENDIF(WIN32)
   1.148 +ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
     2.1 --- a/LICENSE	Sun Mar 29 23:08:20 2009 +0200
     2.2 +++ b/LICENSE	Sun Mar 29 22:19:14 2009 +0100
     2.3 @@ -1,10 +1,14 @@
     2.4 -LEMON code without an explicit copyright is covered by the following
     2.5 +LEMON code without an explicit copyright notice is covered by the following
     2.6  copyright/license.
     2.7  
     2.8  Copyright (C) 2003-2009 Egervary Jeno Kombinatorikus Optimalizalasi
     2.9  Kutatocsoport (Egervary Combinatorial Optimization Research Group,
    2.10  EGRES).
    2.11  
    2.12 +===========================================================================
    2.13 +Boost Software License, Version 1.0
    2.14 +===========================================================================
    2.15 +
    2.16  Permission is hereby granted, free of charge, to any person or organization
    2.17  obtaining a copy of the software and accompanying documentation covered by
    2.18  this license (the "Software") to use, reproduce, display, distribute,
    2.19 @@ -26,8 +30,3 @@
    2.20  FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
    2.21  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    2.22  DEALINGS IN THE SOFTWARE.
    2.23 -
    2.24 -===========================================================================
    2.25 -This license is a verbatim copy of the Boost Software License, Version 1.0.
    2.26 -
    2.27 -
     3.1 --- a/NEWS	Sun Mar 29 23:08:20 2009 +0200
     3.2 +++ b/NEWS	Sun Mar 29 22:19:14 2009 +0100
     3.3 @@ -1,3 +1,10 @@
     3.4 +2009-03-27 LEMON joins to the COIN-OR initiative
     3.5 +
     3.6 +        COIN-OR (Computational Infrastructure for Operations Research,
     3.7 +        http://www.coin-or.org) project is an initiative to spur the
     3.8 +        development of open-source software for the operations research
     3.9 +        community.
    3.10 +
    3.11  2008-10-13 Version 1.0 released
    3.12  
    3.13  	This is the first stable release of LEMON. Compared to the 0.x
     4.1 --- a/demo/CMakeLists.txt	Sun Mar 29 23:08:20 2009 +0200
     4.2 +++ b/demo/CMakeLists.txt	Sun Mar 29 22:19:14 2009 +0100
     4.3 @@ -1,9 +1,9 @@
     4.4  INCLUDE_DIRECTORIES(
     4.5 -  ${CMAKE_SOURCE_DIR}
     4.6 -  ${CMAKE_BINARY_DIR}
     4.7 +  ${PROJECT_SOURCE_DIR}
     4.8 +  ${PROJECT_BINARY_DIR}
     4.9  )
    4.10  
    4.11 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
    4.12 +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
    4.13  
    4.14  SET(DEMOS
    4.15    arg_parser_demo
     5.1 --- a/doc/CMakeLists.txt	Sun Mar 29 23:08:20 2009 +0200
     5.2 +++ b/doc/CMakeLists.txt	Sun Mar 29 22:19:14 2009 +0100
     5.3 @@ -1,11 +1,11 @@
     5.4  SET(PACKAGE_NAME ${PROJECT_NAME})
     5.5  SET(PACKAGE_VERSION ${PROJECT_VERSION})
     5.6 -SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
     5.7 -SET(abs_top_builddir ${CMAKE_BINARY_DIR})
     5.8 +SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
     5.9 +SET(abs_top_builddir ${PROJECT_BINARY_DIR})
    5.10  
    5.11  CONFIGURE_FILE(
    5.12 -  ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
    5.13 -  ${CMAKE_BINARY_DIR}/doc/Doxyfile
    5.14 +  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
    5.15 +  ${PROJECT_BINARY_DIR}/doc/Doxyfile
    5.16    @ONLY)
    5.17  
    5.18  IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
     6.1 --- a/lemon/CMakeLists.txt	Sun Mar 29 23:08:20 2009 +0200
     6.2 +++ b/lemon/CMakeLists.txt	Sun Mar 29 22:19:14 2009 +0100
     6.3 @@ -1,6 +1,6 @@
     6.4  INCLUDE_DIRECTORIES(
     6.5 -  ${CMAKE_SOURCE_DIR}
     6.6 -  ${CMAKE_BINARY_DIR}
     6.7 +  ${PROJECT_SOURCE_DIR}
     6.8 +  ${PROJECT_BINARY_DIR}
     6.9  )
    6.10  
    6.11  CONFIGURE_FILE(
     7.1 --- a/lemon/Makefile.am	Sun Mar 29 23:08:20 2009 +0200
     7.2 +++ b/lemon/Makefile.am	Sun Mar 29 22:19:14 2009 +0100
     7.3 @@ -17,6 +17,7 @@
     7.4  
     7.5  
     7.6  lemon_libemon_la_CXXFLAGS = \
     7.7 +	$(AM_CXXFLAGS) \
     7.8  	$(GLPK_CFLAGS) \
     7.9  	$(CPLEX_CFLAGS) \
    7.10  	$(SOPLEX_CXXFLAGS) \
     8.1 --- a/lemon/cplex.cc	Sun Mar 29 23:08:20 2009 +0200
     8.2 +++ b/lemon/cplex.cc	Sun Mar 29 22:19:14 2009 +0100
     8.3 @@ -2,7 +2,7 @@
     8.4   *
     8.5   * This file is a part of LEMON, a generic C++ optimization library.
     8.6   *
     8.7 - * Copyright (C) 2003-2008
     8.8 + * Copyright (C) 2003-2009
     8.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    8.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    8.11   *
    8.12 @@ -441,13 +441,13 @@
    8.13    // CplexLp members
    8.14  
    8.15    CplexLp::CplexLp()
    8.16 -    : LpBase(), CplexBase(), LpSolver() {}
    8.17 +    : LpBase(), LpSolver(), CplexBase() {}
    8.18  
    8.19    CplexLp::CplexLp(const CplexEnv& env)
    8.20 -    : LpBase(), CplexBase(env), LpSolver() {}
    8.21 +    : LpBase(), LpSolver(), CplexBase(env) {}
    8.22  
    8.23    CplexLp::CplexLp(const CplexLp& other)
    8.24 -    : LpBase(), CplexBase(other), LpSolver() {}
    8.25 +    : LpBase(), LpSolver(), CplexBase(other) {}
    8.26  
    8.27    CplexLp::~CplexLp() {}
    8.28  
    8.29 @@ -798,7 +798,7 @@
    8.30    // CplexMip members
    8.31  
    8.32    CplexMip::CplexMip()
    8.33 -    : LpBase(), CplexBase(), MipSolver() {
    8.34 +    : LpBase(), MipSolver(), CplexBase() {
    8.35  
    8.36  #if CPX_VERSION < 800
    8.37      CPXchgprobtype(cplexEnv(),  _prob, CPXPROB_MIP);
    8.38 @@ -808,7 +808,7 @@
    8.39    }
    8.40  
    8.41    CplexMip::CplexMip(const CplexEnv& env)
    8.42 -    : LpBase(), CplexBase(env), MipSolver() {
    8.43 +    : LpBase(), MipSolver(), CplexBase(env) {
    8.44  
    8.45  #if CPX_VERSION < 800
    8.46      CPXchgprobtype(cplexEnv(),  _prob, CPXPROB_MIP);
    8.47 @@ -819,7 +819,7 @@
    8.48    }
    8.49  
    8.50    CplexMip::CplexMip(const CplexMip& other)
    8.51 -    : LpBase(), CplexBase(other), MipSolver() {}
    8.52 +    : LpBase(), MipSolver(), CplexBase(other) {}
    8.53  
    8.54    CplexMip::~CplexMip() {}
    8.55  
     9.1 --- a/lemon/cplex.h	Sun Mar 29 23:08:20 2009 +0200
     9.2 +++ b/lemon/cplex.h	Sun Mar 29 22:19:14 2009 +0100
     9.3 @@ -2,7 +2,7 @@
     9.4   *
     9.5   * This file is a part of LEMON, a generic C++ optimization library.
     9.6   *
     9.7 - * Copyright (C) 2003-2008
     9.8 + * Copyright (C) 2003-2009
     9.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    9.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    9.11   *
    9.12 @@ -78,7 +78,7 @@
    9.13    /// \brief Base interface for the CPLEX LP and MIP solver
    9.14    ///
    9.15    /// This class implements the common interface of the CPLEX LP and
    9.16 -  /// MIP solvers.  
    9.17 +  /// MIP solvers.
    9.18    /// \ingroup lp_group
    9.19    class CplexBase : virtual public LpBase {
    9.20    protected:
    9.21 @@ -235,10 +235,13 @@
    9.22      /// \e
    9.23      virtual ~CplexMip();
    9.24  
    9.25 +    /// \e
    9.26 +    virtual CplexMip* cloneSolver() const;
    9.27 +    /// \e
    9.28 +    virtual CplexMip* newSolver() const;
    9.29 +
    9.30    protected:
    9.31  
    9.32 -    virtual CplexMip* _cloneSolver() const;
    9.33 -    virtual CplexMip* _newSolver() const;
    9.34  
    9.35      virtual const char* _solverName() const;
    9.36  
    10.1 --- a/lemon/glpk.cc	Sun Mar 29 23:08:20 2009 +0200
    10.2 +++ b/lemon/glpk.cc	Sun Mar 29 22:19:14 2009 +0100
    10.3 @@ -2,7 +2,7 @@
    10.4   *
    10.5   * This file is a part of LEMON, a generic C++ optimization library.
    10.6   *
    10.7 - * Copyright (C) 2003-2008
    10.8 + * Copyright (C) 2003-2009
    10.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
   10.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
   10.11   *
   10.12 @@ -531,12 +531,12 @@
   10.13    // GlpkLp members
   10.14  
   10.15    GlpkLp::GlpkLp()
   10.16 -    : LpBase(), GlpkBase(), LpSolver() {
   10.17 +    : LpBase(), LpSolver(), GlpkBase() {
   10.18      messageLevel(MESSAGE_NO_OUTPUT);
   10.19    }
   10.20  
   10.21    GlpkLp::GlpkLp(const GlpkLp& other)
   10.22 -    : LpBase(other), GlpkBase(other), LpSolver(other) {
   10.23 +    : LpBase(other), LpSolver(other), GlpkBase(other) {
   10.24      messageLevel(MESSAGE_NO_OUTPUT);
   10.25    }
   10.26  
   10.27 @@ -830,12 +830,12 @@
   10.28    // GlpkMip members
   10.29  
   10.30    GlpkMip::GlpkMip()
   10.31 -    : LpBase(), GlpkBase(), MipSolver() {
   10.32 +    : LpBase(), MipSolver(), GlpkBase() {
   10.33      messageLevel(MESSAGE_NO_OUTPUT);
   10.34    }
   10.35  
   10.36    GlpkMip::GlpkMip(const GlpkMip& other)
   10.37 -    : LpBase(), GlpkBase(other), MipSolver() {
   10.38 +    : LpBase(), MipSolver(), GlpkBase(other) {
   10.39      messageLevel(MESSAGE_NO_OUTPUT);
   10.40    }
   10.41  
    11.1 --- a/scripts/unify-sources.sh	Sun Mar 29 23:08:20 2009 +0200
    11.2 +++ b/scripts/unify-sources.sh	Sun Mar 29 22:19:14 2009 +0100
    11.3 @@ -88,7 +88,12 @@
    11.4  function check_action() {
    11.5      if [ "$3" == 'tabs' ]
    11.6      then
    11.7 -        PATTERN=$(echo -e '\t')
    11.8 +        if echo $2 | grep -q -v -E 'Makefile\.am$'
    11.9 +        then
   11.10 +            PATTERN=$(echo -e '\t')
   11.11 +        else
   11.12 +            PATTERN='        '
   11.13 +        fi
   11.14      elif [ "$3" == 'trailing spaces' ]
   11.15      then
   11.16          PATTERN='\ +$'
    12.1 --- a/test/CMakeLists.txt	Sun Mar 29 23:08:20 2009 +0200
    12.2 +++ b/test/CMakeLists.txt	Sun Mar 29 22:19:14 2009 +0100
    12.3 @@ -1,13 +1,13 @@
    12.4  INCLUDE_DIRECTORIES(
    12.5 -  ${CMAKE_SOURCE_DIR}
    12.6 -  ${CMAKE_BINARY_DIR}
    12.7 +  ${PROJECT_SOURCE_DIR}
    12.8 +  ${PROJECT_BINARY_DIR}
    12.9  )
   12.10  
   12.11  IF(HAVE_GLPK)
   12.12    INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
   12.13  ENDIF(HAVE_GLPK)
   12.14  
   12.15 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
   12.16 +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
   12.17  
   12.18  SET(TESTS
   12.19    adaptors_test
    13.1 --- a/test/counter_test.cc	Sun Mar 29 23:08:20 2009 +0200
    13.2 +++ b/test/counter_test.cc	Sun Mar 29 22:19:14 2009 +0100
    13.3 @@ -18,59 +18,86 @@
    13.4  
    13.5  #include <lemon/counter.h>
    13.6  #include <vector>
    13.7 +#include <sstream>
    13.8 +
    13.9 +#include "test/test_tools.h"
   13.10  
   13.11  using namespace lemon;
   13.12  
   13.13  template <typename T>
   13.14  void bubbleSort(std::vector<T>& v) {
   13.15 -  Counter op("Bubble Sort - Operations: ");
   13.16 -  Counter::NoSubCounter as(op, "Assignments: ");
   13.17 -  Counter::NoSubCounter co(op, "Comparisons: ");
   13.18 -  for (int i = v.size()-1; i > 0; --i) {
   13.19 -    for (int j = 0; j < i; ++j) {
   13.20 -      if (v[j] > v[j+1]) {
   13.21 -        T tmp = v[j];
   13.22 -        v[j] = v[j+1];
   13.23 -        v[j+1] = tmp;
   13.24 -        as += 3;
   13.25 +  std::stringstream s1, s2, s3;
   13.26 +  {
   13.27 +    Counter op("Bubble Sort - Operations: ", s1);
   13.28 +    Counter::SubCounter as(op, "Assignments: ", s2);
   13.29 +    Counter::SubCounter co(op, "Comparisons: ", s3);
   13.30 +    for (int i = v.size()-1; i > 0; --i) {
   13.31 +      for (int j = 0; j < i; ++j) {
   13.32 +        if (v[j] > v[j+1]) {
   13.33 +          T tmp = v[j];
   13.34 +          v[j] = v[j+1];
   13.35 +          v[j+1] = tmp;
   13.36 +          as += 3;
   13.37 +        }
   13.38 +        ++co;
   13.39        }
   13.40 -      ++co;
   13.41      }
   13.42    }
   13.43 +  check(s1.str() == "Bubble Sort - Operations: 102\n", "Wrong counter");
   13.44 +  check(s2.str() == "Assignments: 57\n", "Wrong subcounter");
   13.45 +  check(s3.str() == "Comparisons: 45\n", "Wrong subcounter");
   13.46  }
   13.47  
   13.48  template <typename T>
   13.49  void insertionSort(std::vector<T>& v) {
   13.50 -  Counter op("Insertion Sort - Operations: ");
   13.51 -  Counter::NoSubCounter as(op, "Assignments: ");
   13.52 -  Counter::NoSubCounter co(op, "Comparisons: ");
   13.53 -  for (int i = 1; i < int(v.size()); ++i) {
   13.54 -    T value = v[i];
   13.55 -    ++as;
   13.56 -    int j = i;
   13.57 -    while (j > 0 && v[j-1] > value) {
   13.58 -      v[j] = v[j-1];
   13.59 -      --j;
   13.60 -      ++co; ++as;
   13.61 +  std::stringstream s1, s2, s3;
   13.62 +  {
   13.63 +    Counter op("Insertion Sort - Operations: ", s1);
   13.64 +    Counter::SubCounter as(op, "Assignments: ", s2);
   13.65 +    Counter::SubCounter co(op, "Comparisons: ", s3);
   13.66 +    for (int i = 1; i < int(v.size()); ++i) {
   13.67 +      T value = v[i];
   13.68 +      ++as;
   13.69 +      int j = i;
   13.70 +      while (j > 0 && v[j-1] > value) {
   13.71 +        v[j] = v[j-1];
   13.72 +        --j;
   13.73 +        ++co; ++as;
   13.74 +      }
   13.75 +      v[j] = value;
   13.76 +      ++as;
   13.77      }
   13.78 -    v[j] = value;
   13.79 -    ++as;
   13.80    }
   13.81 +  check(s1.str() == "Insertion Sort - Operations: 56\n", "Wrong counter");
   13.82 +  check(s2.str() == "Assignments: 37\n", "Wrong subcounter");
   13.83 +  check(s3.str() == "Comparisons: 19\n", "Wrong subcounter");
   13.84  }
   13.85  
   13.86  template <typename MyCounter>
   13.87 -void counterTest() {
   13.88 -  MyCounter c("Main Counter: ");
   13.89 -  c++;
   13.90 -  typename MyCounter::SubCounter d(c, "SubCounter: ");
   13.91 -  d++;
   13.92 -  typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ");
   13.93 -  e++;
   13.94 -  d+=3;
   13.95 -  c-=4;
   13.96 -  e-=2;
   13.97 -  c.reset(2);
   13.98 -  c.reset();
   13.99 +void counterTest(bool output) {
  13.100 +  std::stringstream s1, s2, s3;
  13.101 +  {
  13.102 +    MyCounter c("Main Counter: ", s1);
  13.103 +    c++;
  13.104 +    typename MyCounter::SubCounter d(c, "SubCounter: ", s2);
  13.105 +    d++;
  13.106 +    typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ", s3);
  13.107 +    e++;
  13.108 +    d+=3;
  13.109 +    c-=4;
  13.110 +    e-=2;
  13.111 +    c.reset(2);
  13.112 +    c.reset();
  13.113 +  }
  13.114 +  if (output) {
  13.115 +    check(s1.str() == "Main Counter: 3\n", "Wrong Counter");
  13.116 +    check(s2.str() == "SubCounter: 3\n", "Wrong SubCounter");
  13.117 +    check(s3.str() == "", "Wrong NoSubCounter");
  13.118 +  } else {
  13.119 +    check(s1.str() == "", "Wrong NoCounter");
  13.120 +    check(s2.str() == "", "Wrong SubCounter");
  13.121 +    check(s3.str() == "", "Wrong NoSubCounter");
  13.122 +  }
  13.123  }
  13.124  
  13.125  void init(std::vector<int>& v) {
  13.126 @@ -80,8 +107,8 @@
  13.127  
  13.128  int main()
  13.129  {
  13.130 -  counterTest<Counter>();
  13.131 -  counterTest<NoCounter>();
  13.132 +  counterTest<Counter>(true);
  13.133 +  counterTest<NoCounter>(false);
  13.134  
  13.135    std::vector<int> x(10);
  13.136    init(x); bubbleSort(x);
    14.1 --- a/test/lp_test.cc	Sun Mar 29 23:08:20 2009 +0200
    14.2 +++ b/test/lp_test.cc	Sun Mar 29 22:19:14 2009 +0100
    14.3 @@ -2,7 +2,7 @@
    14.4   *
    14.5   * This file is a part of LEMON, a generic C++ optimization library.
    14.6   *
    14.7 - * Copyright (C) 2003-2008
    14.8 + * Copyright (C) 2003-2009
    14.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
   14.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
   14.11   *
   14.12 @@ -365,7 +365,7 @@
   14.13  void cloneTest()
   14.14  {
   14.15    //Test for clone/new
   14.16 -  
   14.17 +
   14.18    LP* lp = new LP();
   14.19    LP* lpnew = lp->newSolver();
   14.20    LP* lpclone = lp->cloneSolver();
   14.21 @@ -393,6 +393,7 @@
   14.22      CplexLp lp_cplex1,lp_cplex2;
   14.23      lpTest(lp_cplex1);
   14.24      aTest(lp_cplex2);
   14.25 +    cloneTest<CplexLp>();
   14.26    } catch (CplexEnv::LicenseError& error) {
   14.27  #ifdef LEMON_FORCE_CPLEX_CHECK
   14.28      check(false, error.what());
   14.29 @@ -401,7 +402,6 @@
   14.30      std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
   14.31  #endif
   14.32    }
   14.33 -    cloneTest<CplexLp>();
   14.34  #endif
   14.35  
   14.36  #ifdef HAVE_SOPLEX
    15.1 --- a/test/mip_test.cc	Sun Mar 29 23:08:20 2009 +0200
    15.2 +++ b/test/mip_test.cc	Sun Mar 29 22:19:14 2009 +0100
    15.3 @@ -2,7 +2,7 @@
    15.4   *
    15.5   * This file is a part of LEMON, a generic C++ optimization library.
    15.6   *
    15.7 - * Copyright (C) 2003-2008
    15.8 + * Copyright (C) 2003-2009
    15.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
   15.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
   15.11   *
   15.12 @@ -109,7 +109,7 @@
   15.13  template<class MIP>
   15.14  void cloneTest()
   15.15  {
   15.16 -  
   15.17 +
   15.18    MIP* mip = new MIP();
   15.19    MIP* mipnew = mip->newSolver();
   15.20    MIP* mipclone = mip->cloneSolver();
   15.21 @@ -133,6 +133,7 @@
   15.22    try {
   15.23      CplexMip mip2;
   15.24      aTest(mip2);
   15.25 +    cloneTest<CplexMip>();
   15.26    } catch (CplexEnv::LicenseError& error) {
   15.27  #ifdef LEMON_FORCE_CPLEX_CHECK
   15.28      check(false, error.what());
   15.29 @@ -141,7 +142,6 @@
   15.30      std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
   15.31  #endif
   15.32    }
   15.33 -  cloneTest<CplexMip>();
   15.34  #endif
   15.35  
   15.36    return 0;
    16.1 --- a/test/time_measure_test.cc	Sun Mar 29 23:08:20 2009 +0200
    16.2 +++ b/test/time_measure_test.cc	Sun Mar 29 22:19:14 2009 +0100
    16.3 @@ -39,18 +39,16 @@
    16.4  {
    16.5    Timer T;
    16.6    unsigned int n;
    16.7 -  for(n=0;T.realTime()<1.0;n++) ;
    16.8 +  for(n=0;T.realTime()<0.1;n++) ;
    16.9    std::cout << T << " (" << n << " time queries)\n";
   16.10 -  T.restart();
   16.11 -  while(T.realTime()<2.0) ;
   16.12 -  std::cout << T << '\n';
   16.13 +
   16.14    TimeStamp full;
   16.15    TimeStamp t;
   16.16 -  t=runningTimeTest(f,1,&n,&full);
   16.17 +  t=runningTimeTest(f,0.1,&n,&full);
   16.18    std::cout << t << " (" << n << " tests)\n";
   16.19    std::cout << "Total: " << full << "\n";
   16.20  
   16.21 -  t=runningTimeTest(g,1,&n,&full);
   16.22 +  t=runningTimeTest(g,0.1,&n,&full);
   16.23    std::cout << t << " (" << n << " tests)\n";
   16.24    std::cout << "Total: " << full << "\n";
   16.25  
    17.1 --- a/tools/CMakeLists.txt	Sun Mar 29 23:08:20 2009 +0200
    17.2 +++ b/tools/CMakeLists.txt	Sun Mar 29 22:19:14 2009 +0100
    17.3 @@ -1,9 +1,9 @@
    17.4  INCLUDE_DIRECTORIES(
    17.5 -  ${CMAKE_SOURCE_DIR}
    17.6 -  ${CMAKE_BINARY_DIR}
    17.7 +  ${PROJECT_SOURCE_DIR}
    17.8 +  ${PROJECT_BINARY_DIR}
    17.9  )
   17.10  
   17.11 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
   17.12 +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
   17.13  
   17.14  ADD_EXECUTABLE(lgf-gen lgf-gen.cc)
   17.15  TARGET_LINK_LIBRARIES(lgf-gen lemon)
   17.16 @@ -22,7 +22,7 @@
   17.17  
   17.18  IF(NOT WIN32)
   17.19    INSTALL(
   17.20 -    FILES ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
   17.21 -    RUNTIME DESTINATION bin
   17.22 +    PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
   17.23 +    DESTINATION bin
   17.24      COMPONENT bin)
   17.25  ENDIF(NOT WIN32)
    18.1 --- a/tools/lemon-0.x-to-1.x.sh	Sun Mar 29 23:08:20 2009 +0200
    18.2 +++ b/tools/lemon-0.x-to-1.x.sh	Sun Mar 29 22:19:14 2009 +0100
    18.3 @@ -22,26 +22,25 @@
    18.4          -e "s/\<directed edges\>/_ar_c_label_s/g"\
    18.5          -e "s/UGraph/_Gr_aph_label_/g"\
    18.6          -e "s/u[Gg]raph/_gr_aph_label_/g"\
    18.7 -        -e "s/\<Graph\>/_Digr_aph_label_/g"\
    18.8 +        -e "s/Graph\>/_Digr_aph_label_/g"\
    18.9          -e "s/\<graph\>/_digr_aph_label_/g"\
   18.10 -        -e "s/\<Graphs\>/_Digr_aph_label_s/g"\
   18.11 +        -e "s/Graphs\>/_Digr_aph_label_s/g"\
   18.12          -e "s/\<graphs\>/_digr_aph_label_s/g"\
   18.13 -        -e "s/_Graph/__Gr_aph_label_/g"\
   18.14 -        -e "s/\([Gg]\)raph\([a-z_]\)/_\1r_aph_label_\2/g"\
   18.15 +        -e "s/\([Gg]\)raph\([a-z]\)/_\1r_aph_label_\2/g"\
   18.16          -e "s/\([a-z_]\)graph/\1_gr_aph_label_/g"\
   18.17          -e "s/Graph/_Digr_aph_label_/g"\
   18.18          -e "s/graph/_digr_aph_label_/g"\
   18.19          -e "s/UEdge/_Ed_ge_label_/g"\
   18.20          -e "s/u[Ee]dge/_ed_ge_label_/g"\
   18.21          -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
   18.22 -        -e "s/\<Edge\>/_Ar_c_label_/g"\
   18.23 +        -e "s/Edge\>/_Ar_c_label_/g"\
   18.24          -e "s/\<edge\>/_ar_c_label_/g"\
   18.25 -        -e "s/\<Edges\>/_Ar_c_label_s/g"\
   18.26 +        -e "s/_edge\>/_ar_c_label_/g"\
   18.27 +        -e "s/Edges\>/_Ar_c_label_s/g"\
   18.28          -e "s/\<edges\>/_ar_c_label_s/g"\
   18.29 -        -e "s/_Edge/__Ed_ge_label_/g"\
   18.30 -        -e "s/Edge\([a-z_]\)/_Ed_ge_label_\1/g"\
   18.31 -        -e "s/edge\([a-z_]\)/_ed_ge_label_\1/g"\
   18.32 -        -e "s/\([a-z_]\)edge/\1_ed_ge_label_/g"\
   18.33 +        -e "s/_edges\>/_ar_c_label_s/g"\
   18.34 +        -e "s/\([Ee]\)dge\([a-z]\)/_\1d_ge_label_\2/g"\
   18.35 +        -e "s/\([a-z]\)edge/\1_ed_ge_label_/g"\
   18.36          -e "s/Edge/_Ar_c_label_/g"\
   18.37          -e "s/edge/_ar_c_label_/g"\
   18.38          -e "s/A[Nn]ode/_Re_d_label_/g"\
   18.39 @@ -116,6 +115,11 @@
   18.40          -e "s/\<arcSubGraphAdaptor\>/filterEdges/g"\
   18.41          -e "s/\<DirGraphAdaptor\>/Orienter/g"\
   18.42          -e "s/\<dirGraphAdaptor\>/orienter/g"\
   18.43 +        -e "s/\<LpCplex\>/CplexLp/g"\
   18.44 +        -e "s/\<MipCplex\>/CplexMip/g"\
   18.45 +        -e "s/\<LpGlpk\>/GlpkLp/g"\
   18.46 +        -e "s/\<MipGlpk\>/GlpkMip/g"\
   18.47 +        -e "s/\<LpSoplex\>/SoplexLp/g"\
   18.48      <$i > $TMP
   18.49      mv $TMP $i
   18.50  done