# HG changeset patch # User Alpar Juttner # Date 1238361554 -3600 # Node ID 49a39bae067c4eca487e09c782ab3edba172b030 # Parent c5fd2d99690982c4a8e04d67ad3cb2f8bf68d48d# Parent f53d641aa967669a036ba891f018f71fe54a462b Merge diff -r c5fd2d996909 -r 49a39bae067c CMakeLists.txt --- a/CMakeLists.txt Sun Mar 29 23:08:20 2009 +0200 +++ b/CMakeLists.txt Sun Mar 29 22:19:14 2009 +0100 @@ -9,7 +9,7 @@ PROJECT(${PROJECT_NAME}) -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) INCLUDE(FindDoxygen) INCLUDE(FindGhostscript) @@ -38,74 +38,78 @@ ENABLE_TESTING() ADD_SUBDIRECTORY(lemon) -ADD_SUBDIRECTORY(demo) -ADD_SUBDIRECTORY(tools) -ADD_SUBDIRECTORY(doc) -ADD_SUBDIRECTORY(test) +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) + ADD_SUBDIRECTORY(demo) + ADD_SUBDIRECTORY(tools) + ADD_SUBDIRECTORY(doc) + ADD_SUBDIRECTORY(test) +ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) -IF(WIN32) - SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) - SET(CPACK_PACKAGE_VENDOR "EGRES") - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY - "LEMON - Library of Efficient Models and Optimization in Networks") - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) + IF(WIN32) + SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) + SET(CPACK_PACKAGE_VENDOR "EGRES") + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY + "LEMON - Library of Efficient Models and Optimization in Networks") + SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") - SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) + SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) - SET(CPACK_PACKAGE_INSTALL_DIRECTORY - "${PROJECT_NAME} ${PROJECT_VERSION}") - SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY - "${PROJECT_NAME} ${PROJECT_VERSION}") + SET(CPACK_PACKAGE_INSTALL_DIRECTORY + "${PROJECT_NAME} ${PROJECT_VERSION}") + SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY + "${PROJECT_NAME} ${PROJECT_VERSION}") - SET(CPACK_COMPONENTS_ALL headers library html_documentation bin) + SET(CPACK_COMPONENTS_ALL headers library html_documentation bin) - SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") - SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") - SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") - SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") + SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") + SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") + SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") + SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") - SET(CPACK_COMPONENT_HEADERS_DESCRIPTION - "C++ header files") - SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION - "DLL and import library") - SET(CPACK_COMPONENT_BIN_DESCRIPTION - "Command line utilities") - SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION - "Doxygen generated documentation") + SET(CPACK_COMPONENT_HEADERS_DESCRIPTION + "C++ header files") + SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION + "DLL and import library") + SET(CPACK_COMPONENT_BIN_DESCRIPTION + "Command line utilities") + SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION + "Doxygen generated documentation") - SET(CPACK_COMPONENT_HEADERS_DEPENDS library) + SET(CPACK_COMPONENT_HEADERS_DEPENDS library) - SET(CPACK_COMPONENT_HEADERS_GROUP "Development") - SET(CPACK_COMPONENT_LIBRARY_GROUP "Development") - SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation") + SET(CPACK_COMPONENT_HEADERS_GROUP "Development") + SET(CPACK_COMPONENT_LIBRARY_GROUP "Development") + SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation") - SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION - "Components needed to develop software using LEMON") - SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION - "Documentation of LEMON") + SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION + "Components needed to develop software using LEMON") + SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION + "Documentation of LEMON") - SET(CPACK_ALL_INSTALL_TYPES Full Developer) + SET(CPACK_ALL_INSTALL_TYPES Full Developer) - SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) - SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full) - SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full) + SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) + SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full) + SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full) - SET(CPACK_GENERATOR "NSIS") - SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico") - SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico") - #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") - SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") - SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") - SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") - SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") - SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") - SET(CPACK_NSIS_CREATE_ICONS_EXTRA " - CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\" - ") - SET(CPACK_NSIS_DELETE_ICONS_EXTRA " - !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP - Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" - ") + SET(CPACK_GENERATOR "NSIS") + SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico") + SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico") + #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") + SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") + SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") + SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") + SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") + SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") + SET(CPACK_NSIS_CREATE_ICONS_EXTRA " + CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\" + ") + SET(CPACK_NSIS_DELETE_ICONS_EXTRA " + !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" + ") - INCLUDE(CPack) -ENDIF(WIN32) + INCLUDE(CPack) + ENDIF(WIN32) +ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) diff -r c5fd2d996909 -r 49a39bae067c LICENSE --- a/LICENSE Sun Mar 29 23:08:20 2009 +0200 +++ b/LICENSE Sun Mar 29 22:19:14 2009 +0100 @@ -1,10 +1,14 @@ -LEMON code without an explicit copyright is covered by the following +LEMON code without an explicit copyright notice is covered by the following copyright/license. Copyright (C) 2003-2009 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport (Egervary Combinatorial Optimization Research Group, EGRES). +=========================================================================== +Boost Software License, Version 1.0 +=========================================================================== + Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, @@ -26,8 +30,3 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -=========================================================================== -This license is a verbatim copy of the Boost Software License, Version 1.0. - - diff -r c5fd2d996909 -r 49a39bae067c NEWS --- a/NEWS Sun Mar 29 23:08:20 2009 +0200 +++ b/NEWS Sun Mar 29 22:19:14 2009 +0100 @@ -1,3 +1,10 @@ +2009-03-27 LEMON joins to the COIN-OR initiative + + COIN-OR (Computational Infrastructure for Operations Research, + http://www.coin-or.org) project is an initiative to spur the + development of open-source software for the operations research + community. + 2008-10-13 Version 1.0 released This is the first stable release of LEMON. Compared to the 0.x diff -r c5fd2d996909 -r 49a39bae067c demo/CMakeLists.txt --- a/demo/CMakeLists.txt Sun Mar 29 23:08:20 2009 +0200 +++ b/demo/CMakeLists.txt Sun Mar 29 22:19:14 2009 +0100 @@ -1,9 +1,9 @@ INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} + ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} ) -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon) +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) SET(DEMOS arg_parser_demo diff -r c5fd2d996909 -r 49a39bae067c doc/CMakeLists.txt --- a/doc/CMakeLists.txt Sun Mar 29 23:08:20 2009 +0200 +++ b/doc/CMakeLists.txt Sun Mar 29 22:19:14 2009 +0100 @@ -1,11 +1,11 @@ SET(PACKAGE_NAME ${PROJECT_NAME}) SET(PACKAGE_VERSION ${PROJECT_VERSION}) -SET(abs_top_srcdir ${CMAKE_SOURCE_DIR}) -SET(abs_top_builddir ${CMAKE_BINARY_DIR}) +SET(abs_top_srcdir ${PROJECT_SOURCE_DIR}) +SET(abs_top_builddir ${PROJECT_BINARY_DIR}) CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in - ${CMAKE_BINARY_DIR}/doc/Doxyfile + ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in + ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY) IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE) diff -r c5fd2d996909 -r 49a39bae067c lemon/CMakeLists.txt --- a/lemon/CMakeLists.txt Sun Mar 29 23:08:20 2009 +0200 +++ b/lemon/CMakeLists.txt Sun Mar 29 22:19:14 2009 +0100 @@ -1,6 +1,6 @@ INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} + ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} ) CONFIGURE_FILE( diff -r c5fd2d996909 -r 49a39bae067c lemon/Makefile.am --- a/lemon/Makefile.am Sun Mar 29 23:08:20 2009 +0200 +++ b/lemon/Makefile.am Sun Mar 29 22:19:14 2009 +0100 @@ -17,6 +17,7 @@ lemon_libemon_la_CXXFLAGS = \ + $(AM_CXXFLAGS) \ $(GLPK_CFLAGS) \ $(CPLEX_CFLAGS) \ $(SOPLEX_CXXFLAGS) \ diff -r c5fd2d996909 -r 49a39bae067c lemon/cplex.cc --- a/lemon/cplex.cc Sun Mar 29 23:08:20 2009 +0200 +++ b/lemon/cplex.cc Sun Mar 29 22:19:14 2009 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2008 + * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -441,13 +441,13 @@ // CplexLp members CplexLp::CplexLp() - : LpBase(), CplexBase(), LpSolver() {} + : LpBase(), LpSolver(), CplexBase() {} CplexLp::CplexLp(const CplexEnv& env) - : LpBase(), CplexBase(env), LpSolver() {} + : LpBase(), LpSolver(), CplexBase(env) {} CplexLp::CplexLp(const CplexLp& other) - : LpBase(), CplexBase(other), LpSolver() {} + : LpBase(), LpSolver(), CplexBase(other) {} CplexLp::~CplexLp() {} @@ -798,7 +798,7 @@ // CplexMip members CplexMip::CplexMip() - : LpBase(), CplexBase(), MipSolver() { + : LpBase(), MipSolver(), CplexBase() { #if CPX_VERSION < 800 CPXchgprobtype(cplexEnv(), _prob, CPXPROB_MIP); @@ -808,7 +808,7 @@ } CplexMip::CplexMip(const CplexEnv& env) - : LpBase(), CplexBase(env), MipSolver() { + : LpBase(), MipSolver(), CplexBase(env) { #if CPX_VERSION < 800 CPXchgprobtype(cplexEnv(), _prob, CPXPROB_MIP); @@ -819,7 +819,7 @@ } CplexMip::CplexMip(const CplexMip& other) - : LpBase(), CplexBase(other), MipSolver() {} + : LpBase(), MipSolver(), CplexBase(other) {} CplexMip::~CplexMip() {} diff -r c5fd2d996909 -r 49a39bae067c lemon/cplex.h --- a/lemon/cplex.h Sun Mar 29 23:08:20 2009 +0200 +++ b/lemon/cplex.h Sun Mar 29 22:19:14 2009 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2008 + * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -78,7 +78,7 @@ /// \brief Base interface for the CPLEX LP and MIP solver /// /// This class implements the common interface of the CPLEX LP and - /// MIP solvers. + /// MIP solvers. /// \ingroup lp_group class CplexBase : virtual public LpBase { protected: @@ -235,10 +235,13 @@ /// \e virtual ~CplexMip(); + /// \e + virtual CplexMip* cloneSolver() const; + /// \e + virtual CplexMip* newSolver() const; + protected: - virtual CplexMip* _cloneSolver() const; - virtual CplexMip* _newSolver() const; virtual const char* _solverName() const; diff -r c5fd2d996909 -r 49a39bae067c lemon/glpk.cc --- a/lemon/glpk.cc Sun Mar 29 23:08:20 2009 +0200 +++ b/lemon/glpk.cc Sun Mar 29 22:19:14 2009 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2008 + * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -531,12 +531,12 @@ // GlpkLp members GlpkLp::GlpkLp() - : LpBase(), GlpkBase(), LpSolver() { + : LpBase(), LpSolver(), GlpkBase() { messageLevel(MESSAGE_NO_OUTPUT); } GlpkLp::GlpkLp(const GlpkLp& other) - : LpBase(other), GlpkBase(other), LpSolver(other) { + : LpBase(other), LpSolver(other), GlpkBase(other) { messageLevel(MESSAGE_NO_OUTPUT); } @@ -830,12 +830,12 @@ // GlpkMip members GlpkMip::GlpkMip() - : LpBase(), GlpkBase(), MipSolver() { + : LpBase(), MipSolver(), GlpkBase() { messageLevel(MESSAGE_NO_OUTPUT); } GlpkMip::GlpkMip(const GlpkMip& other) - : LpBase(), GlpkBase(other), MipSolver() { + : LpBase(), MipSolver(), GlpkBase(other) { messageLevel(MESSAGE_NO_OUTPUT); } diff -r c5fd2d996909 -r 49a39bae067c scripts/unify-sources.sh --- a/scripts/unify-sources.sh Sun Mar 29 23:08:20 2009 +0200 +++ b/scripts/unify-sources.sh Sun Mar 29 22:19:14 2009 +0100 @@ -88,7 +88,12 @@ function check_action() { if [ "$3" == 'tabs' ] then - PATTERN=$(echo -e '\t') + if echo $2 | grep -q -v -E 'Makefile\.am$' + then + PATTERN=$(echo -e '\t') + else + PATTERN=' ' + fi elif [ "$3" == 'trailing spaces' ] then PATTERN='\ +$' diff -r c5fd2d996909 -r 49a39bae067c test/CMakeLists.txt --- a/test/CMakeLists.txt Sun Mar 29 23:08:20 2009 +0200 +++ b/test/CMakeLists.txt Sun Mar 29 22:19:14 2009 +0100 @@ -1,13 +1,13 @@ INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} + ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} ) IF(HAVE_GLPK) INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR}) ENDIF(HAVE_GLPK) -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon) +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) SET(TESTS adaptors_test diff -r c5fd2d996909 -r 49a39bae067c test/counter_test.cc --- a/test/counter_test.cc Sun Mar 29 23:08:20 2009 +0200 +++ b/test/counter_test.cc Sun Mar 29 22:19:14 2009 +0100 @@ -18,59 +18,86 @@ #include #include +#include + +#include "test/test_tools.h" using namespace lemon; template void bubbleSort(std::vector& v) { - Counter op("Bubble Sort - Operations: "); - Counter::NoSubCounter as(op, "Assignments: "); - Counter::NoSubCounter co(op, "Comparisons: "); - for (int i = v.size()-1; i > 0; --i) { - for (int j = 0; j < i; ++j) { - if (v[j] > v[j+1]) { - T tmp = v[j]; - v[j] = v[j+1]; - v[j+1] = tmp; - as += 3; + std::stringstream s1, s2, s3; + { + Counter op("Bubble Sort - Operations: ", s1); + Counter::SubCounter as(op, "Assignments: ", s2); + Counter::SubCounter co(op, "Comparisons: ", s3); + for (int i = v.size()-1; i > 0; --i) { + for (int j = 0; j < i; ++j) { + if (v[j] > v[j+1]) { + T tmp = v[j]; + v[j] = v[j+1]; + v[j+1] = tmp; + as += 3; + } + ++co; } - ++co; } } + check(s1.str() == "Bubble Sort - Operations: 102\n", "Wrong counter"); + check(s2.str() == "Assignments: 57\n", "Wrong subcounter"); + check(s3.str() == "Comparisons: 45\n", "Wrong subcounter"); } template void insertionSort(std::vector& v) { - Counter op("Insertion Sort - Operations: "); - Counter::NoSubCounter as(op, "Assignments: "); - Counter::NoSubCounter co(op, "Comparisons: "); - for (int i = 1; i < int(v.size()); ++i) { - T value = v[i]; - ++as; - int j = i; - while (j > 0 && v[j-1] > value) { - v[j] = v[j-1]; - --j; - ++co; ++as; + std::stringstream s1, s2, s3; + { + Counter op("Insertion Sort - Operations: ", s1); + Counter::SubCounter as(op, "Assignments: ", s2); + Counter::SubCounter co(op, "Comparisons: ", s3); + for (int i = 1; i < int(v.size()); ++i) { + T value = v[i]; + ++as; + int j = i; + while (j > 0 && v[j-1] > value) { + v[j] = v[j-1]; + --j; + ++co; ++as; + } + v[j] = value; + ++as; } - v[j] = value; - ++as; } + check(s1.str() == "Insertion Sort - Operations: 56\n", "Wrong counter"); + check(s2.str() == "Assignments: 37\n", "Wrong subcounter"); + check(s3.str() == "Comparisons: 19\n", "Wrong subcounter"); } template -void counterTest() { - MyCounter c("Main Counter: "); - c++; - typename MyCounter::SubCounter d(c, "SubCounter: "); - d++; - typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: "); - e++; - d+=3; - c-=4; - e-=2; - c.reset(2); - c.reset(); +void counterTest(bool output) { + std::stringstream s1, s2, s3; + { + MyCounter c("Main Counter: ", s1); + c++; + typename MyCounter::SubCounter d(c, "SubCounter: ", s2); + d++; + typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ", s3); + e++; + d+=3; + c-=4; + e-=2; + c.reset(2); + c.reset(); + } + if (output) { + check(s1.str() == "Main Counter: 3\n", "Wrong Counter"); + check(s2.str() == "SubCounter: 3\n", "Wrong SubCounter"); + check(s3.str() == "", "Wrong NoSubCounter"); + } else { + check(s1.str() == "", "Wrong NoCounter"); + check(s2.str() == "", "Wrong SubCounter"); + check(s3.str() == "", "Wrong NoSubCounter"); + } } void init(std::vector& v) { @@ -80,8 +107,8 @@ int main() { - counterTest(); - counterTest(); + counterTest(true); + counterTest(false); std::vector x(10); init(x); bubbleSort(x); diff -r c5fd2d996909 -r 49a39bae067c test/lp_test.cc --- a/test/lp_test.cc Sun Mar 29 23:08:20 2009 +0200 +++ b/test/lp_test.cc Sun Mar 29 22:19:14 2009 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2008 + * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -365,7 +365,7 @@ void cloneTest() { //Test for clone/new - + LP* lp = new LP(); LP* lpnew = lp->newSolver(); LP* lpclone = lp->cloneSolver(); @@ -393,6 +393,7 @@ CplexLp lp_cplex1,lp_cplex2; lpTest(lp_cplex1); aTest(lp_cplex2); + cloneTest(); } catch (CplexEnv::LicenseError& error) { #ifdef LEMON_FORCE_CPLEX_CHECK check(false, error.what()); @@ -401,7 +402,6 @@ std::cerr << "Cplex license check failed, lp check skipped" << std::endl; #endif } - cloneTest(); #endif #ifdef HAVE_SOPLEX diff -r c5fd2d996909 -r 49a39bae067c test/mip_test.cc --- a/test/mip_test.cc Sun Mar 29 23:08:20 2009 +0200 +++ b/test/mip_test.cc Sun Mar 29 22:19:14 2009 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2008 + * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -109,7 +109,7 @@ template void cloneTest() { - + MIP* mip = new MIP(); MIP* mipnew = mip->newSolver(); MIP* mipclone = mip->cloneSolver(); @@ -133,6 +133,7 @@ try { CplexMip mip2; aTest(mip2); + cloneTest(); } catch (CplexEnv::LicenseError& error) { #ifdef LEMON_FORCE_CPLEX_CHECK check(false, error.what()); @@ -141,7 +142,6 @@ std::cerr << "Cplex license check failed, lp check skipped" << std::endl; #endif } - cloneTest(); #endif return 0; diff -r c5fd2d996909 -r 49a39bae067c test/time_measure_test.cc --- a/test/time_measure_test.cc Sun Mar 29 23:08:20 2009 +0200 +++ b/test/time_measure_test.cc Sun Mar 29 22:19:14 2009 +0100 @@ -39,18 +39,16 @@ { Timer T; unsigned int n; - for(n=0;T.realTime()<1.0;n++) ; + for(n=0;T.realTime()<0.1;n++) ; std::cout << T << " (" << n << " time queries)\n"; - T.restart(); - while(T.realTime()<2.0) ; - std::cout << T << '\n'; + TimeStamp full; TimeStamp t; - t=runningTimeTest(f,1,&n,&full); + t=runningTimeTest(f,0.1,&n,&full); std::cout << t << " (" << n << " tests)\n"; std::cout << "Total: " << full << "\n"; - t=runningTimeTest(g,1,&n,&full); + t=runningTimeTest(g,0.1,&n,&full); std::cout << t << " (" << n << " tests)\n"; std::cout << "Total: " << full << "\n"; diff -r c5fd2d996909 -r 49a39bae067c tools/CMakeLists.txt --- a/tools/CMakeLists.txt Sun Mar 29 23:08:20 2009 +0200 +++ b/tools/CMakeLists.txt Sun Mar 29 22:19:14 2009 +0100 @@ -1,9 +1,9 @@ INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} + ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} ) -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon) +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) ADD_EXECUTABLE(lgf-gen lgf-gen.cc) TARGET_LINK_LIBRARIES(lgf-gen lemon) @@ -22,7 +22,7 @@ IF(NOT WIN32) INSTALL( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh - RUNTIME DESTINATION bin + PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh + DESTINATION bin COMPONENT bin) ENDIF(NOT WIN32) diff -r c5fd2d996909 -r 49a39bae067c tools/lemon-0.x-to-1.x.sh --- a/tools/lemon-0.x-to-1.x.sh Sun Mar 29 23:08:20 2009 +0200 +++ b/tools/lemon-0.x-to-1.x.sh Sun Mar 29 22:19:14 2009 +0100 @@ -22,26 +22,25 @@ -e "s/\/_ar_c_label_s/g"\ -e "s/UGraph/_Gr_aph_label_/g"\ -e "s/u[Gg]raph/_gr_aph_label_/g"\ - -e "s/\/_Digr_aph_label_/g"\ + -e "s/Graph\>/_Digr_aph_label_/g"\ -e "s/\/_digr_aph_label_/g"\ - -e "s/\/_Digr_aph_label_s/g"\ + -e "s/Graphs\>/_Digr_aph_label_s/g"\ -e "s/\/_digr_aph_label_s/g"\ - -e "s/_Graph/__Gr_aph_label_/g"\ - -e "s/\([Gg]\)raph\([a-z_]\)/_\1r_aph_label_\2/g"\ + -e "s/\([Gg]\)raph\([a-z]\)/_\1r_aph_label_\2/g"\ -e "s/\([a-z_]\)graph/\1_gr_aph_label_/g"\ -e "s/Graph/_Digr_aph_label_/g"\ -e "s/graph/_digr_aph_label_/g"\ -e "s/UEdge/_Ed_ge_label_/g"\ -e "s/u[Ee]dge/_ed_ge_label_/g"\ -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\ - -e "s/\/_Ar_c_label_/g"\ + -e "s/Edge\>/_Ar_c_label_/g"\ -e "s/\/_ar_c_label_/g"\ - -e "s/\/_Ar_c_label_s/g"\ + -e "s/_edge\>/_ar_c_label_/g"\ + -e "s/Edges\>/_Ar_c_label_s/g"\ -e "s/\/_ar_c_label_s/g"\ - -e "s/_Edge/__Ed_ge_label_/g"\ - -e "s/Edge\([a-z_]\)/_Ed_ge_label_\1/g"\ - -e "s/edge\([a-z_]\)/_ed_ge_label_\1/g"\ - -e "s/\([a-z_]\)edge/\1_ed_ge_label_/g"\ + -e "s/_edges\>/_ar_c_label_s/g"\ + -e "s/\([Ee]\)dge\([a-z]\)/_\1d_ge_label_\2/g"\ + -e "s/\([a-z]\)edge/\1_ed_ge_label_/g"\ -e "s/Edge/_Ar_c_label_/g"\ -e "s/edge/_ar_c_label_/g"\ -e "s/A[Nn]ode/_Re_d_label_/g"\ @@ -116,6 +115,11 @@ -e "s/\/filterEdges/g"\ -e "s/\/Orienter/g"\ -e "s/\/orienter/g"\ + -e "s/\/CplexLp/g"\ + -e "s/\/CplexMip/g"\ + -e "s/\/GlpkLp/g"\ + -e "s/\/GlpkMip/g"\ + -e "s/\/SoplexLp/g"\ <$i > $TMP mv $TMP $i done