COIN-OR::LEMON - Graph Library

Changeset 1162:404b98971e1f in lemon


Ignore:
Timestamp:
09/13/12 12:13:19 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
1155:b6347aae6575 (diff), 1160:00f8d9f9920d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge #449

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1159 r1162  
    1313ELSE()
    1414  EXECUTE_PROCESS(
    15     COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py
     15    COMMAND
     16    hg log -r. --template "{latesttag}"
    1617    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
    17     OUTPUT_VARIABLE HG_REVISION_PATH
     18    OUTPUT_VARIABLE HG_REVISION_TAG
    1819    ERROR_QUIET
    1920    OUTPUT_STRIP_TRAILING_WHITESPACE
    2021  )
    2122  EXECUTE_PROCESS(
    22     COMMAND hg id -i
     23    COMMAND
     24    hg log -r. --template "{latesttagdistance}"
    2325    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
    24     OUTPUT_VARIABLE HG_REVISION
     26    OUTPUT_VARIABLE HG_REVISION_DIST
    2527    ERROR_QUIET
    2628    OUTPUT_STRIP_TRAILING_WHITESPACE
    2729  )
    28   IF(HG_REVISION STREQUAL "")
     30  EXECUTE_PROCESS(
     31    COMMAND
     32    hg log -r. --template "{node|short}"
     33    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     34    OUTPUT_VARIABLE HG_REVISION_ID
     35    ERROR_QUIET
     36    OUTPUT_STRIP_TRAILING_WHITESPACE
     37  )
     38
     39  IF(HG_REVISION_TAG STREQUAL "")
    2940    SET(HG_REVISION_ID "hg-tip")
    3041  ELSE()
    31     IF(HG_REVISION_PATH STREQUAL "")
    32       SET(HG_REVISION_ID ${HG_REVISION})
     42    IF(HG_REVISION_TAG STREQUAL "null")
     43      SET(HG_REVISION_TAG "trunk")
     44    ELSEIF(HG_REVISION_TAG MATCHES "^r")
     45      STRING(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG)
     46    ENDIF()
     47    IF(HG_REVISION_DIST STREQUAL "0")
     48      SET(HG_REVISION ${HG_REVISION_TAG})
    3349    ELSE()
    34       SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION})
     50      SET(HG_REVISION
     51        "${HG_REVISION_TAG}+${HG_REVISION_DIST}-${HG_REVISION_ID}")
    3552    ENDIF()
    3653  ENDIF()
    37   SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.")
     54
     55  SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
    3856ENDIF()
    3957
     
    115133SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
    116134
    117 INCLUDE(FindPythonInterp)
     135INCLUDE(FindThreads)
     136
     137IF(NOT LEMON_THREADING)
     138  IF(CMAKE_USE_PTHREADS_INIT)
     139    SET(LEMON_THREADING "Pthread")
     140  ELSEIF(CMAKE_USE_WIN32_THREADS_INIT)
     141    SET(LEMON_THREADING "Win32")
     142  ELSE()
     143    SET(LEMON_THREADING "None")
     144  ENDIF()
     145ENDIF()
     146
     147SET( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING
     148  "Choose the threading library, options are: Pthread Win32 None."
     149  FORCE )
     150
     151IF(LEMON_THREADING STREQUAL "Pthread")
     152  SET(LEMON_USE_PTHREAD TRUE)
     153ELSEIF(LEMON_THREADING STREQUAL "Win32")
     154  SET(LEMON_USE_WIN32_THREADS TRUE)
     155ENDIF()
    118156
    119157ENABLE_TESTING()
     
    127165ADD_SUBDIRECTORY(lemon)
    128166IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
     167  ADD_SUBDIRECTORY(contrib)
    129168  ADD_SUBDIRECTORY(demo)
    130169  ADD_SUBDIRECTORY(tools)
     
    150189ENDIF()
    151190
     191CONFIGURE_FILE(
     192  ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in
     193  ${PROJECT_BINARY_DIR}/cmake/version.cmake
     194  @ONLY
     195)
     196
     197SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})
     198STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)
     199SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})
     200ADD_CUSTOM_TARGET(dist
     201  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
     202  COMMAND hg archive ${ARCHIVE_NAME}
     203  COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake
     204  COMMAND tar -czf ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_NAME}
     205  COMMAND zip -r ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.zip ${ARCHIVE_NAME}
     206  COMMAND cmake -E copy_directory doc/html ${ARCHIVE_NAME}/doc/html
     207  COMMAND tar -czf ${ARCHIVE_NAME}.tar.gz ${ARCHIVE_NAME}
     208  COMMAND zip -r ${ARCHIVE_NAME}.zip ${ARCHIVE_NAME}
     209  COMMAND cmake -E copy_directory doc/html ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
     210  COMMAND tar -czf ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
     211  COMMAND zip -r ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.zip ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
     212  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
     213  COMMAND cmake -E remove_directory ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
     214  DEPENDS html
     215  WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
     216
     217# CPACK config (Basically for NSIS)
    152218IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    153219  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
  • lemon/bits/edge_set_extender.h

    r1110 r1161  
    524524    // Returns the base node of the iterator
    525525    Node baseNode(const IncEdgeIt &e) const {
    526       return e.direction ? u(e) : v(e);
     526      return e.direction ? this->u(e) : this->v(e);
    527527    }
    528528    // Running node of the iterator
     
    530530    // Returns the running node of the iterator
    531531    Node runningNode(const IncEdgeIt &e) const {
    532       return e.direction ? v(e) : u(e);
     532      return e.direction ? this->v(e) : this->u(e);
    533533    }
    534534
  • lemon/concepts/graph_components.h

    r1127 r1161  
    495495          _GraphItemIt it3 = it1;
    496496          _GraphItemIt it4 = INVALID;
     497          ignore_unused_variable_warning(it3);
     498          ignore_unused_variable_warning(it4);
    497499
    498500          it2 = ++it1;
     
    584586          _GraphIncIt it3 = it1;
    585587          _GraphIncIt it4 = INVALID;
     588          ignore_unused_variable_warning(it3);
     589          ignore_unused_variable_warning(it4);
    586590
    587591          it2 = ++it1;
  • lemon/core.h

    r1159 r1162  
    447447
    448448  }
     449
     450  /// \brief Check whether a graph is undirected.
     451  ///
     452  /// This function returns \c true if the given graph is undirected.
     453#ifdef DOXYGEN
     454  template <typename GR>
     455  bool undirected(const GR& g) { return false; }
     456#else
     457  template <typename GR>
     458  typename enable_if<UndirectedTagIndicator<GR>, bool>::type
     459  undirected(const GR&) {
     460    return true;
     461  }
     462  template <typename GR>
     463  typename disable_if<UndirectedTagIndicator<GR>, bool>::type
     464  undirected(const GR&) {
     465    return false;
     466  }
     467#endif
    449468
    450469  /// \brief Class to copy a digraph.
  • lemon/path.h

    r1146 r1162  
    4444  ///
    4545  /// In a sense, the path can be treated as a list of arcs. The
    46   /// lemon path type stores just this list. As a consequence, it
     46  /// LEMON path type stores just this list. As a consequence, it
    4747  /// cannot enumerate the nodes of the path and the source node of
    4848  /// a zero length path is undefined.
     
    149149    void clear() { head.clear(); tail.clear(); }
    150150
    151     /// \brief The nth arc.
     151    /// \brief The n-th arc.
    152152    ///
    153153    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    157157    }
    158158
    159     /// \brief Initialize arc iterator to point to the nth arc
     159    /// \brief Initialize arc iterator to point to the n-th arc
    160160    ///
    161161    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    245245  ///
    246246  /// In a sense, the path can be treated as a list of arcs. The
    247   /// lemon path type stores just this list. As a consequence it
     247  /// LEMON path type stores just this list. As a consequence it
    248248  /// cannot enumerate the nodes in the path and the zero length paths
    249249  /// cannot store the source.
     
    354354    void clear() { data.clear(); }
    355355
    356     /// \brief The nth arc.
     356    /// \brief The n-th arc.
    357357    ///
    358358    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    361361    }
    362362
    363     /// \brief  Initializes arc iterator to point to the nth arc.
     363    /// \brief  Initializes arc iterator to point to the n-th arc.
    364364    ArcIt nthIt(int n) const {
    365365      return ArcIt(*this, n);
     
    422422  ///
    423423  /// In a sense, the path can be treated as a list of arcs. The
    424   /// lemon path type stores just this list. As a consequence it
     424  /// LEMON path type stores just this list. As a consequence it
    425425  /// cannot enumerate the nodes in the path and the zero length paths
    426426  /// cannot store the source.
     
    544544    };
    545545
    546     /// \brief The nth arc.
    547     ///
    548     /// This function looks for the nth arc in O(n) time.
     546    /// \brief The n-th arc.
     547    ///
     548    /// This function looks for the n-th arc in O(n) time.
    549549    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
    550550    const Arc& nth(int n) const {
     
    556556    }
    557557
    558     /// \brief Initializes arc iterator to point to the nth arc.
     558    /// \brief Initializes arc iterator to point to the n-th arc.
    559559    ArcIt nthIt(int n) const {
    560560      Node *node = first;
     
    775775  ///
    776776  /// In a sense, the path can be treated as a list of arcs. The
    777   /// lemon path type stores just this list. As a consequence it
     777  /// LEMON path type stores just this list. As a consequence it
    778778  /// cannot enumerate the nodes in the path and the source node of
    779779  /// a zero length path is undefined.
     
    884884    };
    885885
    886     /// \brief The nth arc.
     886    /// \brief The n-th arc.
    887887    ///
    888888    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    891891    }
    892892
    893     /// \brief The arc iterator pointing to the nth arc.
     893    /// \brief The arc iterator pointing to the n-th arc.
    894894    ArcIt nthIt(int n) const {
    895895      return ArcIt(*this, n);
     
    10951095  ///
    10961096  /// In a sense, the path can be treated as a list of arcs. The
    1097   /// lemon path type stores only this list. As a consequence, it
     1097  /// LEMON path type stores only this list. As a consequence, it
    10981098  /// cannot enumerate the nodes in the path and the zero length paths
    10991099  /// cannot have a source node.
  • test/CMakeLists.txt

    r1159 r1162  
    3838  maps_test
    3939  matching_test
     40  max_cardinality_search_test
     41  max_clique_test
    4042  min_cost_arborescence_test
    4143  min_cost_flow_test
    4244  min_mean_cycle_test
     45  nagamochi_ibaraki_test
    4346  path_test
    4447  planarity_test
Note: See TracChangeset for help on using the changeset viewer.