Compare commits

...

101 Commits

Author SHA1 Message Date
Jeremy W. Murphy a649be53bd Merge pull request #305 from boostorg/develop
Merge develop into master for 1.80.0 release
2022-07-27 09:55:56 +10:00
Jeremy W. Murphy 2862644154 Merge pull request #304 from sebrockm/fix-max-flows
Fix named parameter overload of `boykov_kolmogorov_max_flow`
2022-07-25 11:44:49 +10:00
Sebastian Brockmeyer f62a1839bd Fix return type of named paramter overload 2022-07-25 01:37:31 +02:00
Sebastian Brockmeyer 3600dbc226 add test for bk_max_flow with named bundled properties 2022-07-25 01:08:40 +02:00
Sebastian Brockmeyer 01020b0265 Use put instead of subscript operator in fill_random_max_flow_graph 2022-07-25 00:30:19 +02:00
Jeremy W. Murphy fcfc152f85 Merge pull request #303 from jesseli2002/docs_update
Clarify docs on what traversal category allowed
2022-07-20 09:32:57 +10:00
Jesse Li ea24532da5 Clarify docs on what traversal category allowed 2022-07-18 22:54:03 -07:00
Jeremy W. Murphy 944d9fc836 Merge pull request #302 from sebrockm/fix-conversion-warning
Fix conversion warning
2022-07-18 21:13:36 +10:00
Sebastian Brockmeyer 446dc15cf8 Remove redundant erase call 2022-07-17 21:23:08 +02:00
Sebastian Brockmeyer 44632af1a9 Fix conversion warning 2022-07-17 21:20:40 +02:00
Jeremy W. Murphy 5f4ce096f8 Merge pull request #299 from boostorg/Xcode_CI
Disable old versions of Xcode in Drone config
2022-07-15 09:50:55 +10:00
Jeremy W. Murphy 393c31d148 Remove GCC 11 and 12 2022-07-15 09:48:45 +10:00
Jeremy W. Murphy 73149e556b Add GCC 11 and 12 from Beast 2022-07-13 15:06:45 +10:00
Jeremy W. Murphy 3b6d40011b Remove old versions of Xcode from Drone config 2022-07-13 13:58:47 +10:00
Jeremy W. Murphy 797530d23a Merge pull request #296 from sebrockm/fix_stoer_wagner
Fix Stoer Wagner
2022-07-12 16:02:26 +10:00
Sebastian Brockmeyer 2e4b9c461a Rollback implementation change of 393c072c18 2022-07-11 14:19:18 +02:00
Sebastian Brockmeyer 3b6825958a Fix link and expected result in regression test 2022-07-10 19:42:46 +02:00
etienneINSA fa6aa57529 add test for stoer_wagner 2022-07-10 19:30:49 +02:00
Jeremy W. Murphy 430f61f696 Merge pull request #290 from jeremy-murphy/windows_msvc_14_3
Add MSVC 14.3 to github CI

Not Drone CI like I mistakenly said in the original commit message.
2022-03-06 22:46:10 +11:00
Jeremy W. Murphy 51f7f20cb6 Add MSVC 14.3 to Drone CI
Using windows-2022 machine.
2022-03-06 21:39:50 +11:00
Jeremy W. Murphy 71fed2fda8 Merge pull request #264 from qbit86/feature/first-child
Resolves #261 by replacing child() with first_child()
2022-03-04 13:10:18 +11:00
Jeremy W. Murphy 76aed24add Merge pull request #265 from qbit86/feature/remove-combine
Resolves #260 by removing call to `combine`
2022-03-04 10:55:12 +11:00
John Maddock c583bfa197 Merge branch 'develop' 2022-02-22 12:13:51 +00:00
Jeremy W. Murphy fa3bd05312 Merge pull request #269 from cqc-alec/bugfix/issue_268
Revert commit change to `reindex_edge_list`

Specifically, this reverts 5dd748307c.
2022-02-21 11:43:28 +11:00
Alec Edgington 99d0414416 Merge branch 'develop' into bugfix/issue_268 2022-02-20 07:56:56 +00:00
Jeremy W. Murphy 31026c4a5a Merge pull request #289 from jeremy-murphy/fix-windows-CI
Change windows-latest to windows-2019
2022-02-20 12:32:44 +11:00
Jeremy W. Murphy 5f6e128c16 Change windows-latest to windows-2019 2022-02-20 07:09:17 +11:00
Alec Edgington 1e200701f8 Merge branch 'develop' into bugfix/issue_268 2022-02-04 08:50:16 +00:00
Jeremy W. Murphy 8543c8ad78 Merge pull request #279 from jeremy-murphy/gcc-10-ICE
Get a green CI build by removing builds and code that we can't support

In the long term someone may want to revisit the builds removed and reinstate them if the underlying problem can be fixed.
Boost.Concept_Check has to be made compatible with C++17 before we can resume using the broken features.
2022-02-03 15:10:41 +11:00
Jeremy W. Murphy f2e5ef1b40 Disable failing builds 2022-02-03 09:55:02 +11:00
Jeremy W. Murphy f6fc9c8157 Remove failing builds from Drone CI configuration 2022-01-30 06:39:52 +11:00
Alec Edgington 0486e91d1b Extend unit test to cover directed graphs as well and add a couple of checks. 2022-01-05 10:43:25 +00:00
Jeremy W. Murphy 0defbbc323 Merge pull request #277 from cvvergara/patch-1
Add pgRouting to Boost Graph Library Users
2022-01-04 12:58:12 +11:00
Jeremy W. Murphy b657cf3901 Disable use of AdaptableBinaryFunction
It uses deprecated (C++17) and removed (C++20) classes such as
std::binary_function. Fails to compile on msvc-14.2.
Temporarily disabling altogether for simplicity.
2021-12-12 22:10:45 +11:00
Jeremy W. Murphy 5ff3645af6 Remove g++-10 from CI because it has an ICE on Boost.Xpressive code. 2021-12-12 22:04:47 +11:00
Alec Edgington 84232b46c0 Add unit test. 2021-12-10 12:47:21 +00:00
Ashish Kumar b76ffc7f2a Typo fix in graph edge_coloring docs (#209) 2021-12-09 17:26:38 +11:00
Philip Allgaier 972bde3031 Fix minor doc typos (#270)
* Fix typo in incident doc

* Add missing closing bracket to random_spanning_tree doc
2021-12-09 17:22:10 +11:00
char-lie 8c76c8aa01 Fix #274: Typo in Boykov-Kolmogorov Max-Flow (#275)
Redundant letter `c` in a comment.
2021-12-09 17:19:11 +11:00
Vicky Vergara 4879e70593 Add pgRouting to Boost Graph Library Users
First of all, I want to congratulate you for the amazing job you are doing.

I am the main developer of pgRouting, and the project is part of the OSGeo
Foundation [2] community projects.

pgRouting extends the PostGIS / PostgreSQL geospatial database to provide
geospatial routing functionality.

I would like pgRouting [1] to be added on the list of
"Boost Graph Library Users"
The Boost license is on the projects repository [3] and we document when a
boost graph function is used for example in [4]

[1] https://pgrouting.org/
[2] https://www.osgeo.org
[3] https://github.com/pgRouting/pgrouting
[4] https://docs.pgrouting.org/latest/en/pgr_aStar.html
2021-11-12 09:49:11 -06:00
Alec Edgington 27202068ea Remove stray bracket. 2021-07-05 13:31:20 +01:00
John Maddock cea3ee8225 Merge branch 'develop' 2021-07-03 10:21:10 +01:00
Alec Edgington 6e1f68ef22 Partially revert commit 5dd748307c.
Revert change to `reindex_edge_list`.

See https://github.com/boostorg/graph/issues/268 .
2021-07-02 14:17:27 +01:00
jzmaddock af22c9bcde Merge pull request #267 from boostorg/feature/lightweight_test
Convert the few remaining tests to use the header-only Lightweight Test
2021-06-10 08:55:38 +01:00
Glen Fernandes 7a6ceb3cd2 Convert the few remaining tests to use the header only Lightweight Test 2021-06-09 22:40:16 -04:00
Peter Dimov 2bc8d0490e Do not define BOOST_GRAPH_SOURCE in CMakeLists.txt 2021-06-09 19:06:17 +03:00
Peter Dimov 5bb73cd899 Add CMakeLists.txt 2021-06-09 19:06:00 +03:00
Peter Dimov 6bae630c38 Do not define BOOST_GRAPH_SOURCE in CMakeLists.txt 2021-06-09 18:45:39 +03:00
Viktor T bb4fbd6494 Resolves #260 by removing call to combine from astar_search_no_init_tree 2021-06-04 00:01:17 +03:00
Viktor T 64aa4a822a Resolves #261 by replacing child() with first_child() 2021-06-03 02:14:43 +03:00
jzmaddock d865589d62 As with other repro's, clang-9 on github is broken. 2021-05-31 12:01:41 +01:00
jzmaddock 03318bfb5f Fix #include errors and one GCC-ism in relaxed_heap.hpp. 2021-05-31 09:50:52 +01:00
Peter Dimov 97f51d8180 Add CMakeLists.txt 2021-05-29 20:34:01 +03:00
jzmaddock 35d3e15a47 Merge pull request #255 from boostorg/pr190_integration
Integration testing for PR190
2021-04-21 19:23:47 +01:00
jzmaddock c2c341c12d Merge pull request #254 from boostorg/pr234_integrate
Run PR234 through new CI
2021-04-21 11:59:23 +01:00
jzmaddock 685f9e091a Merge pull request #253 from boostorg/pr217_integrate
Integration CI test for PR217
2021-04-21 11:59:07 +01:00
jzmaddock 2247005473 Remove XCode testing workarounds, to see if PR190 fixes them.
Fixes: https://github.com/boostorg/graph/issues/251
2021-04-20 19:18:50 +01:00
John Maddock 1fd5fc12a4 Merge branch 'issue_175' of https://github.com/bkpoon/graph into pr190_integration 2021-04-20 19:14:58 +01:00
jzmaddock 58b6f3640a Merge pull request #202 from jwakely/patch-2
Prevent fallthrough when assertions are not fatal
2021-04-20 19:11:58 +01:00
jzmaddock 63135f59b5 Merge pull request #219 from vadi2/patch-1
Remove extra closing bracket
2021-04-20 19:10:55 +01:00
John Maddock 0c38817632 Merge branch 'develop' of https://github.com/jcelerier/graph into pr234_integrate 2021-04-20 18:59:31 +01:00
jzmaddock 5842a766b6 Merge pull request #236 from Myles1/fix-links
fix graph library user manual links
2021-04-20 18:57:38 +01:00
John Maddock 5f1bbdb941 Merge branch 'use-boost-override' of https://github.com/EugeneZelenko/graph into pr217_integrate 2021-04-20 18:54:20 +01:00
jzmaddock 9b425a037c Merge pull request #191 from valiko-ua/develop
Fixed HTML and other errors in doc/graph_theory_review.html
2021-04-20 10:47:28 +01:00
jzmaddock 2bcd634112 Merge pull request #210 from jaredkhan/patch-1
Fix minor typo in AdjacencyGraph docs
2021-04-20 10:45:22 +01:00
jzmaddock 7cccda8854 Merge pull request #241 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-04-20 10:42:56 +01:00
jzmaddock f4aa9658fe Update build badges. 2021-04-20 10:41:22 +01:00
jzmaddock b3751605e4 Merge pull request #250 from boostorg/update_ci
Update CI.
2021-04-19 17:53:20 +01:00
jzmaddock d63a380343 Add missing #define to drone config. 2021-04-19 15:31:11 +01:00
jzmaddock 46702c45ac More clang versions have broken std lib headers. 2021-04-19 08:43:19 +01:00
jzmaddock 487459712b Change version number to which issue 251 applies. 2021-04-19 08:42:13 +01:00
jzmaddock cb342d159b Correct various CI issues. 2021-04-18 19:12:40 +01:00
jzmaddock b05b379492 Correct CI script and Jamfile. 2021-04-18 10:04:21 +01:00
jzmaddock 099f965f24 Correct path to tests. 2021-04-17 18:43:44 +01:00
jzmaddock d4160d52ba More CI fixes. 2021-04-17 18:38:43 +01:00
jzmaddock 50e9e7a692 Correct CI scripts. 2021-04-17 16:44:40 +01:00
jzmaddock d2ae80b7db Update drone files. 2021-04-17 12:46:04 +01:00
jzmaddock 0cfb1b8895 Update CI. 2021-04-17 12:01:26 +01:00
Edward Diener 493e7b53a5 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-19 22:42:35 -05:00
Myles1 f0c469b8e6 fix graph library user manual links 2020-12-21 18:39:49 -08:00
Jean-Michaël Celerier bbc499708c Fix compilation on C++20 mode
MSVC standard library has removed std::not1, thus use the C++17 alternative if available
2020-12-14 12:08:04 +01:00
jzmaddock e4e12158e7 Merge pull request #218 from Lastique/fix_deprecated_headers
Fix usage of deprecated headers boost/bind.hpp and boost/detail/iterator.hpp
2020-11-02 15:39:05 +00:00
Peter Dimov 0c9dbd7808 Merge branch 'master' into develop 2020-11-01 16:20:07 +02:00
Peter Dimov 83646b1913 Merge pull request #215 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-08-24 14:08:17 +03:00
Vadim Peretokin 56ce18a75d Remove extra closing bracket 2020-05-24 10:13:30 +02:00
Andrey Semashev 1b2c9d8d3f Update usage of deprecated header boost/bind.hpp, add missing includes.
boost/bind.hpp generates compiler warnings about deprecation of placeholders
in the global namespace. Updated to include boost/bind/bind.hpp and
using namespace boost::placeholders;

Also added a few missing includes.
2020-05-11 20:11:06 +03:00
Andrey Semashev f364ee7be2 Removed usage of deprecated header boost/detail/iterator.hpp.
The header was deprecated in favor of <iterator>. It generates compiler
warnings and will be removed in a future release.
2020-05-11 19:59:23 +03:00
Eugene Zelenko 910445584a Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings.
Also fix CLang extra-semi, Clang-tidy modernize-deprecated-headers and readability-container-size-empty warnings.
Alphabetical order of C++ headers.
2020-05-09 15:05:13 -07:00
Edward Diener 4149230e27 Corrected fix. 2020-04-08 19:08:47 -04:00
Edward Diener 7f77c3563b Include ctime and use std::time function. 2020-04-03 12:11:43 -04:00
Edward Diener 14c2bf17b4 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 08:36:03 -04:00
Jared Khan ecbd271eb1 Fix minor typo in AdjacencyGraph docs 2020-03-17 16:31:08 +00:00
jzmaddock ca17604dca Update readme with correct bug reporting locations, plus CI badges. 2020-02-09 19:48:38 +00:00
Jonathan Wakely 274a05f630 Prevent fallthrough when assertions are not fatal
When BOOST_DISABLE_ASSERTS or BOOST_ENABLE_ASSERT_HANDLER is defined, the nested switch on `str[1]` can continue past the assert and will fallthrough to the `default` case below.

This can cause warnings with static analysis tools, and if a user-defined `boost::assertion_failed` function that doesn't terminate the process is being used, that function will be called twice because the first assertion falls through to the second.

Inserting a `break` avoids static analysis warnings and avoids potentially calling the assertion handler twice.
2020-01-31 14:48:21 +00:00
Valentyn Shtronda 7c0a9d2998 One more correction of "Elementary Graph Theory" 2019-12-03 16:13:54 +02:00
Valentyn Shtronda c1803bbb4f Some vertices were omitted 2019-11-27 04:26:23 +02:00
Valentyn Shtronda 545428a4d0 Grammar/formatting 2019-11-27 04:25:30 +02:00
Valentyn Shtronda 53d0e93e43 Added missing parts.
Added parts that seems were lost long time ago during conversion to HTML.
2019-11-27 04:22:38 +02:00
Valentyn Shtronda 1eb8c16a76 Fixed HTML. 2019-11-27 04:17:17 +02:00
Billy K. Poon b9c3b14d39 Second file with forward iterator issue 2019-10-16 15:30:58 -07:00
Billy K. Poon 80b88a32e9 Use boost::first_max_element instead of std::max_element to avoid issue with forward iterator (#175) 2019-10-16 15:30:11 -07:00
75 changed files with 1323 additions and 943 deletions
+163
View File
@@ -0,0 +1,163 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={}
linuxglobalimage="cppalliance/droneubuntu1604:1"
windowsglobalimage="cppalliance/dronevs2019"
def main(ctx):
return [
linux_cxx("g++-4.4 98", "g++", packages="g++-4.4", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.4', 'CXXSTD': '98', }, globalenv=globalenv),
linux_cxx("g++-4.4 0x", "g++", packages="g++-4.4", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.4', 'CXXSTD': '0x', }, globalenv=globalenv),
linux_cxx("g++-4.6 03", "g++", packages="g++-4.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.6', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-4.6 0x", "g++", packages="g++-4.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.6', 'CXXSTD': '0x', }, globalenv=globalenv),
linux_cxx("g++-4.7 03", "g++-4.7", packages="g++-4.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-4.7 11", "g++-4.7", packages="g++-4.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-4.8 03", "g++-4.8", packages="g++-4.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-4.8 11", "g++-4.8", packages="g++-4.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-4.9 03", "g++-4.9", packages="g++-4.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-4.9 11", "g++-4.9", packages="g++-4.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-5 03", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-5 11", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-5 14", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-5 1z", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("g++-6 03", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-6 11", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-6 14", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-6 1z", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("g++-7 03", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-7 11", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-7 14", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-7 17", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-8 03", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-8 11", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-8 14", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-8 17", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-9 03", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("g++-9 11", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-9 14", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-9 17", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-9 2a", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("g++-10 11", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("g++-10 14", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-10 17", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-10 20", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '20', }, globalenv=globalenv),
linux_cxx("clang++-3.5 03", "clang++", packages="clang-3.5", llvm_os="precise", llvm_ver="3.5", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-3.5 11", "clang++", packages="clang-3.5", llvm_os="precise", llvm_ver="3.5", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '11', }, globalenv=globalenv),
#linux_cxx("clang++-3.5 14", "clang++", packages="clang-3.5", llvm_os="precise", llvm_ver="3.5", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '14', }, globalenv=globalenv),
#linux_cxx("clang++-3.5 1z", "clang++", packages="clang-3.5", llvm_os="precise", llvm_ver="3.5", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-3.6 03", "clang++", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-3.6 11", "clang++", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '11', }, globalenv=globalenv),
#linux_cxx("clang++-3.6 14", "clang++", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '14', }, globalenv=globalenv),
#linux_cxx("clang++-3.6 1z", "clang++", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-3.7 03", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-3.7 11", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '11', }, globalenv=globalenv),
#linux_cxx("clang++-3.7 14", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '14', }, globalenv=globalenv),
#linux_cxx("clang++-3.7 1z", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-3.8 03", "clang++-3.8", packages="clang-3.8", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-3.8 11", "clang++-3.8", packages="clang-3.8", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '11', }, globalenv=globalenv),
# These have issues not of our making:
#linux_cxx("clang++-3.8 14", "clang++-3.8", packages="clang-3.8", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '14', }, globalenv=globalenv),
#linux_cxx("clang++-3.8 1z", "clang++-3.8", packages="clang-3.8", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-3.9 03", "clang++-3.9", packages="clang-3.9", llvm_os="precise", llvm_ver="3.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-3.9 11", "clang++-3.9", packages="clang-3.9", llvm_os="precise", llvm_ver="3.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '11', }, globalenv=globalenv),
# These have issues not of our making:
#linux_cxx("clang++-3.9 14", "clang++-3.9", packages="clang-3.9", llvm_os="precise", llvm_ver="3.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '14', }, globalenv=globalenv),
#linux_cxx("clang++-3.9 1z", "clang++-3.9", packages="clang-3.9", llvm_os="precise", llvm_ver="3.9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-4.0 03", "clang++-4.0", packages="clang-4.0", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-4.0 11", "clang++-4.0", packages="clang-4.0", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-4.0 14", "clang++-4.0", packages="clang-4.0", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-4.0 1z", "clang++-4.0", packages="clang-4.0", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-5.0 03", "clang++-5.0", packages="clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-5.0 11", "clang++-5.0", packages="clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-5.0 14", "clang++-5.0", packages="clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-5.0 1z", "clang++-5.0", packages="clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-6.0 03", "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-6.0 11", "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-6.0 14", "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-6.0 1z", "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-7 03", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-7 14", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-7 17", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-7 1z", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-8 03", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-8 11", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-8 14", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-8 17", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-8 2a", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("clang++-9 03", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-9 11", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-9 14", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-9 17", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-9 2a", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("clang++-10 03", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '03', }, globalenv=globalenv),
linux_cxx("clang++-10 11", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '11', }, globalenv=globalenv),
linux_cxx("clang++-10 14", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-10 17", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-10 20", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '20', }, globalenv=globalenv),
osx_cxx("XCode-11.7 03", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
osx_cxx("XCode-11.7 11", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
osx_cxx("XCode-11.7 14", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
osx_cxx("XCode-11.7 17", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '17', }, globalenv=globalenv),
osx_cxx("XCode-11.7 2a", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '2a', }, globalenv=globalenv),
# We don't support these old versions of Xcode any more, but you are welcome to take up the challenge for doing so if you need them.
# osx_cxx("XCode-10.2 03", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
# osx_cxx("XCode-10.2 11", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
# osx_cxx("XCode-10.2 14", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
# osx_cxx("XCode-10.2 17", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '17', }, globalenv=globalenv),
# osx_cxx("XCode-10.2 2a", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '2a', }, globalenv=globalenv),
# osx_cxx("XCode-9.4 03", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
# osx_cxx("XCode-9.4 11", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
# osx_cxx("XCode-9.4 14", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
# osx_cxx("XCode-9.4 1z", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '1z', }, globalenv=globalenv),
# osx_cxx("XCode-9.0 03", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
# osx_cxx("XCode-9.0 11", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
# osx_cxx("XCode-9.0 14", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
# osx_cxx("XCode-9.0 1z", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '1z', }, globalenv=globalenv),
# osx_cxx("XCode-8.3 03", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
# osx_cxx("XCode-8.3 11", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
# osx_cxx("XCode-8.3 14", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
# osx_cxx("XCode-8.3 1z", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '1z', }, globalenv=globalenv),
# osx_cxx("XCode-8.0 03", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
# osx_cxx("XCode-8.0 11", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
# osx_cxx("XCode-8.0 14", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
# osx_cxx("XCode-8.0 1z", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '1z', }, globalenv=globalenv),
# osx_cxx("XCode-7.3 03", "clang++", packages="", buildtype="boost", xcode_version="7.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03', }, globalenv=globalenv),
# osx_cxx("XCode-7.3 11", "clang++", packages="", buildtype="boost", xcode_version="7.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, globalenv=globalenv),
]
# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export PATH=~/.local/bin:/usr/local/bin:$PATH
echo '==================================> BEFORE_INSTALL'
. .drone/before-install.sh
echo '==================================> INSTALL'
cd ..
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boost_install
git submodule update --init libs/headers
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/graph
python tools/boostdep/depinst/depinst.py graph
./bootstrap.sh
./b2 headers
echo '==================================> BEFORE_SCRIPT'
. $DRONE_BUILD_DIR/.drone/before-script.sh
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER : $OPTIONS ;" > ~/user-config.jam
(cd libs/config/test && ../../../b2 cxxstd=$CXXSTD config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
(cd libs/graph/test && ../../../b2 -j3 cxxstd=$CXXSTD toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES)
echo '==================================> AFTER_SUCCESS'
. $DRONE_BUILD_DIR/.drone/after-success.sh
+266
View File
@@ -0,0 +1,266 @@
# Copyright 2020 Evan Miller
# Copyright 2020 Matt Borland
# Copyright 2021 John Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
name: CI
on: [ push, pull_request ]
jobs:
ubuntu-focal:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# Removed g++-10 because of an ICE; meant to be fixed in 10.2?
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94938
compiler: [ g++-9, clang++-10 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set TOOLSET
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install g++-9 clang-10
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info
run: ../../../b2 print_config_info toolset=$TOOLSET cxxstd=03,11,14,17,2a
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET cxxstd=03,11,14,17,2a
working-directory: ../boost-root/libs/graph/test
ubuntu-bionic:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
compiler: [ g++-7, g++-8, clang++-7, clang++-8 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set TOOLSET
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install g++-7 g++-8 clang-7 clang-8
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info install
run: ../../../b2 print_config_info toolset=$TOOLSET cxxstd=03,11,14,17
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET cxxstd=03,11,14,17
working-directory: ../boost-root/libs/graph/test
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
toolset: [ clang ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Config info
run: ../../../b2 print_config_info toolset=${{ matrix.toolset }} cxxstd=03,11,14,17,2a
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=03,11,14,17,2a define=CI_SUPPRESS_KNOWN_ISSUES
working-directory: ../boost-root/libs/graph/test
windows_msvc_14_0:
runs-on: windows-2019
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.0 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info
run: ..\..\..\b2 print_config_info cxxstd=14,17 address-model=64 toolset=msvc-14.0
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17 toolset=msvc-14.0
working-directory: ../boost-root/libs/graph/test
windows_msvc_14_2:
runs-on: windows-2019
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.2 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info
run: ..\..\..\b2 print_config_info cxxstd=14,17,20 address-model=64 toolset=msvc-14.2
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17,20 toolset=msvc-14.2
working-directory: ../boost-root/libs/graph/test
windows_msvc_14_3:
runs-on: windows-2022
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.3 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info
run: ..\..\..\b2 print_config_info cxxstd=14,17,20 address-model=64 toolset=msvc-14.3
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17,20 toolset=msvc-14.3
working-directory: ../boost-root/libs/graph/test
-334
View File
@@ -1,334 +0,0 @@
# Copyright 2016, 2017 Peter Dimov
# Copyright 2018 Joh Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
language: cpp
python: "2.7"
dist : xenial
os:
- linux
- osx
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++-4.4
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
addons:
apt:
packages:
- g++-4.4
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.6
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x
addons:
apt:
packages:
- g++-4.6
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.7
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.9
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,14
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=14,17
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-9
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=14,2a
addons:
apt:
packages:
- g++-9
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14
addons:
apt:
packages:
- clang-3.6
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.9
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- os: linux
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14
addons:
apt:
packages:
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-4.0
- os: linux
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=11,14,1z
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-5.0
- os: linux
compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=14,1z
addons:
apt:
packages:
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
- os: linux
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=14,1z
addons:
apt:
packages:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-7
- os: linux
compiler: clang++-8
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=14,17,2a
addons:
apt:
packages:
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=14,1z
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=14,1z
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03
osx_image: xcode9.4.1
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode9.4.1
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=14,1z
osx_image: xcode9.4.1
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/graph
- python tools/boostdep/depinst/depinst.py graph
- ./bootstrap.sh
- ./b2 headers
script:
- |-
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- IFS=','
- for CXXLOCAL in $CXXSTD; do (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET cxxstd=$CXXLOCAL && ./config_info_travis && rm ./config_info_travis) done
- unset IFS
- ./b2 -j3 libs/graph/test toolset=$TOOLSET cxxstd=$CXXSTD
notifications:
email:
on_success: always
+80
View File
@@ -0,0 +1,80 @@
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_graph VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_graph
src/graphml.cpp
src/read_graphviz_new.cpp
)
add_library(Boost::graph ALIAS boost_graph)
target_include_directories(boost_graph PUBLIC include)
target_link_libraries(boost_graph
PUBLIC
Boost::algorithm
Boost::any
Boost::array
Boost::assert
Boost::bimap
Boost::bind
Boost::concept_check
Boost::config
Boost::container_hash
Boost::conversion
Boost::core
Boost::detail
Boost::foreach
Boost::function
Boost::integer
Boost::iterator
Boost::lexical_cast
Boost::math
Boost::move
Boost::mpl
Boost::multi_index
Boost::optional
Boost::parameter
Boost::preprocessor
Boost::property_map
Boost::property_tree
Boost::random
Boost::range
Boost::serialization
Boost::smart_ptr
Boost::spirit
Boost::static_assert
Boost::throw_exception
Boost::tti
Boost::tuple
Boost::type_traits
Boost::typeof
Boost::unordered
Boost::utility
Boost::xpressive
PRIVATE
Boost::regex
)
target_compile_definitions(boost_graph
PUBLIC BOOST_GRAPH_NO_LIB
# Source files already define BOOST_GRAPH_SOURCE
# PRIVATE BOOST_GRAPH_SOURCE
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_graph PUBLIC BOOST_GRAPH_DYN_LINK)
else()
target_compile_definitions(boost_graph PUBLIC BOOST_GRAPH_STATIC_LINK)
endif()
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
+15 -4
View File
@@ -1,4 +1,5 @@
Boost Graph Library
Boost Graph Library [![Build Status](https://drone.cpp.al/api/badges/boostorg/graph/status.svg)](https://drone.cpp.al/boostorg/graph)[![Build Status](https://github.com/boostorg/graph/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/graph/actions)
===================
A generic interface for traversing graphs, using C++ templates.
@@ -7,9 +8,14 @@ The full documentation is available on [boost.org](http://www.boost.org/doc/libs
## Support, bugs and feature requests ##
Bugs and feature requests can be reported through the [Trac issue tracker](https://svn.boost.org/trac/boost/query?component=graph&desc=1&order=id)
(see [open issues](https://svn.boost.org/trac/boost/query?status=!closed&component=graph&desc=1&order=id) and
[closed issues](https://svn.boost.org/trac/boost/query?status=closed&component=graph&col=id&col=summary&col=status&col=owner&col=type&col=milestone&col=version&desc=1&order=id)). [Here](http://lists.boost.org/Archives/boost/2015/04/221780.php) is why Trac is still in use.
Bugs and feature requests can be reported through the [Github issue page](https://github.com/boostorg/graph/issues).
See also:
* [Current open issues](https://github.com/boostorg/graph/issues)
* [Closed issues](https://github.com/boostorg/graph/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed)
* Old issues still open on [Trac](https://svn.boost.org/trac/boost/query?status=!closed&component=graph&desc=1&order=id)
* Closed issues on [Trac](https://svn.boost.org/trac/boost/query?status=closed&component=graph&col=id&col=summary&col=status&col=owner&col=type&col=milestone&col=version&desc=1&order=id)
You can submit your changes through a [pull request](https://github.com/boostorg/graph/pulls). One of the maintainers will take a look (remember that it can take some time).
@@ -18,6 +24,11 @@ There is no mailing-list specific to Boost Graph, although you can use the gener
## Development ##
| | Master | Develop |
|------------------|----------|-------------|
| Github Actions | [![Build Status](https://github.com/boostorg/graph/workflows/CI/badge.svg?branch=master)](https://github.com/boostorg/graph/actions) | [![Build Status](https://github.com/boostorg/graph/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/graph/actions) |
|Drone | [![Build Status](https://drone.cpp.al/api/badges/boostorg/graph/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/graph) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/graph/status.svg)](https:/drone.cpp.al/boostorg/graph) |
Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)):
git clone https://github.com/boostorg/boost
-64
View File
@@ -1,64 +0,0 @@
# Copyright 2016 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
platform:
- x64
environment:
matrix:
- ARGS: --toolset=msvc-9.0 address-model=32
- ARGS: --toolset=msvc-10.0 address-model=32
- ARGS: --toolset=msvc-11.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=32
- ARGS: --toolset=msvc-14.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest
- ARGS: --toolset=gcc address-model=64
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=32
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
PATH: C:\MinGW\bin;%PATH%
install:
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- git submodule update --init tools/build
- git submodule update --init libs/config
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\graph
- git submodule update --init tools/boostdep
- python tools/boostdep/depinst/depinst.py graph
- bootstrap
- b2 headers
build: off
test_script:
- cd libs\config\test
- ..\..\..\b2 config_info_travis_install %ARGS%
- config_info_travis
- cd ..\..\graph\test
- ..\..\..\b2 -j3 --hash %ARGS%
+1 -1
View File
@@ -21,7 +21,7 @@
AdjacencyGraph
</H2>
The AdjacencyGraph concept provides and interface for efficient access
The AdjacencyGraph concept provides an interface for efficient access
of the adjacent vertices to a vertex in a graph. This is quite similar
to the <a href="./IncidenceGraph.html">IncidenceGraph</a> concept (the
target of an out-edge is an adjacent vertex). Both concepts are
+2 -1
View File
@@ -87,7 +87,8 @@ This describes the ways in which the vertices and edges of the
graph can be visited. The choices are <TT>incidence_graph_tag</TT>,
<TT>adjacency_graph_tag</TT>, <TT>bidirectional_graph_tag</TT>,
<TT>vertex_list_graph_tag</TT>, <TT>edge_list_graph_tag</TT>, and
<TT>adjacency_matrix_tag</TT>.
<TT>adjacency_matrix_tag</TT>. You can also create your own
tag which should inherit from one or more of the above.
</td>
</tr>
+2 -2
View File
@@ -52,7 +52,7 @@ colors c<sub>1</sub>, c<sub>2</sub>, ..., c<sub>n</sub> in a way
that no vertex connects with 2 edges of the same color. Furthermore
at most m + 1 colors are used.
<!-- King, I.P. An automatic reordering scheme for simultaneous equations derived from network analysis. Int. J. Numer. Methods Engrg. 2 (1970), 523-533 -->
<!-- Misra, J., & Gries, D. (1992). A constructive proof of Vizing's theorem. In Information Processing Letters. -->
<h3>Where defined</h3>
<a href="../../../boost/graph/edge_coloring.hpp"><tt>boost/graph/edge_coloring.hpp</tt></a>
@@ -80,7 +80,7 @@ OUT: <tt>ColorMap color</tt>
<h3>Example</h3>
See <A
href="../example/edge_coloring.cpp"><tt>example/king_ordering.cpp</tt></A>.
href="../example/edge_coloring.cpp"><tt>example/edge_coloring.cpp</tt></A>.
<h3>See Also</h3>
+20 -21
View File
@@ -69,7 +69,6 @@ pair of letters. Now we can write down an example of a directed graph
as follows:
<P>
<BR>
<DIV ALIGN="center">
<table><tr><td><tt>
V = {v, b, x, z, a, y } <br>
@@ -103,17 +102,16 @@ Example of a directed graph.</CAPTION>
Next we have a similar graph, though this time it is undirected. <A
HREF="#fig:undirected-graph">Figure 2</A> gives the pictorial view.
Self loops are not allowed in undirected graphs. This graph is the <a
name="def:undirected-version"><I>undirected version</i></a. of the the
name="def:undirected-version"><i>undirected version</i></a> of the the
previous graph (minus the parallel edge <i>(b,y)</i>), meaning it has
the same vertices and the same edges with their directions removed.
Also the self edge has been removed, and edges such as <i>(a,z)</i>
and <i>(z,a)</i> are collapsed into one edge. One can go the other
way, and make a <a name="def:directed-version"><I>directed version</i>
way, and make a <a name="def:directed-version"><i>directed version</i>
of an undirected graph be replacing each edge by two edges, one
pointing in each direction.
<P>
<BR>
<DIV ALIGN="CENTER">
<table><tr><td><tt>
V = {v, b, x, z, a, y }<br>
@@ -136,7 +134,7 @@ Example of an undirected graph.</CAPTION>
<P>
Now for some more graph terminology. If some edge <i>(u,v)</i> is in
graph , then vertex <i>v</i> is <a
graph <i>G</i>, then vertex <i>v</i> is <a
name="def:adjacent"><I>adjacent</I></a> to vertex <i>u</i>. In a
directed graph, edge <i>(u,v)</i> is an <a
name="def:out-edge"><I>out-edge</I></a> of vertex <i>u</i> and an <a
@@ -175,7 +173,7 @@ name="def:simple-path"><I>simple</I></a> if none of the vertices in
the sequence are repeated. The path &lt;(b,x), (x,v)&gt; is simple,
while the path &lt;(a,z), (z,a)&gt; is not. Also, the path &lt;(a,z),
(z,a)&gt; is called a <a name="def:cycle"><I>cycle</I></a> because the
first and last vertex in the path are the same. A graph with no cycles
first and last vertices in the path are the same. A graph with no cycles
is <a name="def:acyclic"><I>acyclic</I></a>.
<P>
@@ -353,12 +351,12 @@ Breadth-first search spreading through a graph.</CAPTION>
<P>
<PRE>
order of discovery: s r w v t x u y
order of finish: s r w v t x u y
order of finish: s r w v t x u y
</PRE>
<P>
We start at vertex <i>s</i>, and first visit <i>r</i> and <i>w</i> (the two
neighbors of <i>s</i>). Once both neighbors of are visited, we visit the
neighbors of <i>s</i>). Once both neighbors of <i>s</i> are visited, we visit the
neighbor of <i>r</i> (vertex <i>v</i>), then the neighbors of <i>w</i>
(the discovery order between <i>r</i> and <i>w</i> does not matter)
which are <i>t</i> and <i>x</i>. Finally we visit the neighbors of
@@ -404,7 +402,8 @@ properly nested set of parenthesis. <A
HREF="#fig:dfs-example">Figure 7</A> shows
DFS applied to an undirected graph, with the edges labeled in the
order they were explored. Below we list the vertices of the graph
ordered by discover and finish time, as well as show the parenthesis structure. DFS is used as the kernel for several other graph
ordered by discover and finish time, as well as show the parenthesis
structure. DFS is used as the kernel for several other graph
algorithms, including topological sort and two of the connected
component algorithms. It can also be used to detect cycles (see the <A
HREF="file_dependency_example.html#sec:cycles">Cylic Dependencies </a>
@@ -424,7 +423,7 @@ Depth-first search on an undirected graph.</CAPTION>
<P>
<PRE>
order of discovery: a b e d c f g h i
order of finish: d f c e b a
order of finish: d f c e b a i h g
parenthesis: (a (b (e (d d) (c (f f) c) e) b) a) (g (h (i i) h) g)
</PRE>
@@ -442,8 +441,7 @@ total weight is given by
<i>w(T)</i> = sum of <i>w(u,v)</i> over all <i>(u,v)</i> in <i>T</i>,
where <i>w(u,v)</i> is the weight on the edge <i>(u,v)</i>
</DIV>
<BR CLEAR="ALL">
<P></P>
<BR CLEAR="ALL"><P></P>
<i>T</i> is called the <I>spanning tree</I>.
<!--
@@ -480,7 +478,7 @@ of a path</I><BR>
<p></p>
<DIV ALIGN="left">
<i>w(p) = sum from i=1..k of w(v<sub>i-1</sub>,v<sub>i</sub>)</i>
<i>w(p) = sum of w(v<sub>i-1</sub>,v<sub>i</sub>) for i=1..k</i>
</DIV>
<BR CLEAR="ALL"><P></P>
@@ -495,7 +493,7 @@ The <I>shortest path weight</I> from vertex <i>u</i> to <i>v</i> is then
</DIV>
<BR CLEAR="ALL"><P></P>
A <I>shortest path</I> is any path who's path weight is equal to the
A <I>shortest path</I> is any path whose path weight is equal to the
<I>shortest path weight</I>.
<P>
@@ -509,12 +507,12 @@ problem that are asymptotically faster than algorithms that solve the
single-source problem.
<P>
A <I>shortest-paths tree</I> rooted at vertex in graph <i>G=(V,E)</i>
is a directed subgraph <G'> where <i>V'</i> is a subset
A <I>shortest-paths tree</I> rooted at vertex <i>r</i> in graph <i>G=(V,E)</i>
is a directed subgraph <I>G'=(V',E')</I> where <i>V'</i> is a subset
of <i>V</i> and <i>E'</i> is a subset of <i>E</i>, <i>V'</i> is the
set of vertices reachable from , <i>G'</i> forms a rooted tree with
root , and for all <i>v</i> in <i>V'</i> the unique simple path from
to <i>v</i> in <i>G'</i> is a shortest path from to <i>v</i> in . The
set of vertices reachable from <i>r</i>, <i>G'</i> forms a rooted tree with
root <i>r</i>, and for all <i>v</i> in <i>V'</i> the unique simple path from <i>r</i>
to <i>v</i> in <i>G'</i> is a shortest path from <i>r</i> to <i>v</i> in <i>G</i>. The
result of a single-source algorithm is a shortest-paths tree.
<P>
@@ -532,7 +530,7 @@ constraints:
<p>
<i>f(u,v) <= c(u,v) for all (u,v) in V x V</i> (Capacity constraint) <br>
<i>f(u,v) = - f(v,u) for all (u,v) in V x V</i> (Skew symmetry)<br>
<i>sum<sub>v in V</sub> f(u,v) = 0 for all u in V - {s,t}</i> (Flow conservation)
<i>sum<sub>v in V</sub> f(u,v) = 0 for all v in V - {s,t}</i> (Flow conservation)
<p>
The <b><i>flow</i></b> of the network is the net flow entering the
@@ -553,7 +551,8 @@ The <b><i>maximum flow problem</i></b> is to determine the maximum
possible value for <i>|f|</i> and the corresponding flow values for
every vertex pair in the graph.
<p>
The <b><i>minimum cost maximum flow problem</i></b> is to determine the maximum flow which minimizes <i> sum<sub>(u,v) in E</sub>
The <b><i>minimum cost maximum flow problem</i></b> is to determine
the maximum flow which minimizes <i> sum<sub>(u,v) in E</sub>
cost(u,v) * f(u,v) </i>.
<p>
+2 -2
View File
@@ -200,9 +200,9 @@ The ways in which the vertices in the graph can be traversed.
The traversal category tags are:
<tt>incidence_graph_tag, adjacency_graph_tag,
bidirectional_graph_tag, vertex_list_graph_tag,
edge_list_graph_tag, vertex_and_edge_list_graph_tag,
edge_list_graph_tag,
adjacency_matrix_tag</tt>. You can also create your own
tag which should inherit from one of the above.
tag which should inherit from one or more of the above.
</td>
</tr>
+1 -1
View File
@@ -44,7 +44,7 @@
incident(typename graph_traits&lt;Graph&gt;::edge_descriptor e, Graph& g)
</pre>
This function takes and edge descriptor and returns the pair of
This function takes an edge descriptor and returns the pair of
vertices that are <i>incident</i> to the edge. For directed graphs,
the <tt>first</tt> vertex is the source and the <tt>second</tt> vertex
is the target. This function is equivalent to the expression
+1 -1
View File
@@ -17,7 +17,7 @@
alt="C++ Boost" width="277" height="86">
<h1>The Boost Graph Library (BGL)
<a href="http://www.awprofessional.com/title/0201729148">
<a href="https://www.informit.com/store/boost-graph-library-user-guide-and-reference-manual-9780132651837">
<img src="bgl-cover.jpg" alt="BGL Book" align="RIGHT"></a>
</h1>
+1 -1
View File
@@ -39,7 +39,7 @@ void random_spanning_tree(const Graph&amp; g, Gen&amp; gen, vertex_descriptor ro
<p>
The <tt>random_spanning_tree()</tt> function generates a random spanning tree
on a directed or undirected graph. The algorithm used is Wilson's algorithm (<a
href="bibliography.html#wilson96generating">73</a>, based on <!-- (FIXME: add
href="bibliography.html#wilson96generating">73</a>), based on <!-- (FIXME: add
documentation for loop_erased_random_walk()) <a
href="loop_erased_random_walk.html"> -->loop-erased random walks<!-- </a> -->. There must
be a path from every non-root vertex of the graph to the root;
+1 -1
View File
@@ -17,7 +17,7 @@
ALT="C++ Boost" width="277" height="86">
<h1>Table of Contents: the Boost Graph Library
<a href="http://www.awprofessional.com/title/0201729148">
<a href="https://www.informit.com/store/boost-graph-library-user-guide-and-reference-manual-9780132651837">
<img src="bgl-cover.jpg" ALT="BGL Book" ALIGN="RIGHT"></a>
</h1>
+1
View File
@@ -40,6 +40,7 @@ or form.</p>
<li><a href="http://www.vrjuggler.org/">VR Juggler: Virtual Reality Tools</a></li>
<li><a href="http://hyperworx.org">Hyperworx Platform Project</a></li>
<li><a href="http://www.opencog.org/">OpenCog, an open source Artificial General Intelligence framework</a></li>
<li><a href="https://www.pgRouting.org/">pgRouting extends the PostGIS/PostgreSQL geospatial database to provide geospatial routing functionality.</a></li>
</ul>
</body>
+1 -1
View File
@@ -75,7 +75,7 @@ run filtered_graph.cpp ;
run filtered_graph_edge_range.cpp ;
run filtered_vec_as_graph.cpp ;
run filtered-copy-example.cpp ;
exe fr_layout : fr_layout.cpp ;
exe fr_layout : fr_layout.cpp : [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] ;
run gerdemann.cpp ;
run graph.cpp ;
run graph_as_tree.cpp ;
+4
View File
@@ -20,7 +20,11 @@ namespace boost
template < class Alloc, class ValueType >
struct container_gen< list_with_allocatorS< Alloc >, ValueType >
{
#ifdef BOOST_NO_CXX11_ALLOCATOR
typedef typename Alloc::template rebind< ValueType >::other Allocator;
#else
typedef typename std::allocator_traits<Alloc>::template rebind_alloc<ValueType> Allocator;
#endif
typedef std::list< ValueType, Allocator > type;
};
template < class Alloc >
+21 -19
View File
@@ -7,7 +7,7 @@
// Author: Douglas Gregor
#include <boost/graph/graphviz.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/test/minimal.hpp>
#include <boost/core/lightweight_test.hpp>
#include <string>
#include <fstream>
#include <boost/graph/iteration_macros.hpp>
@@ -25,16 +25,18 @@ typedef boost::adjacency_list< vecS, vecS, undirectedS,
void test_graph_read_write(const std::string& filename)
{
std::ifstream in(filename.c_str());
BOOST_REQUIRE(in);
if (!BOOST_TEST(in)) {
return;
}
Graph g;
dynamic_properties dp;
dp.property("id", get(vertex_name, g));
dp.property("weight", get(edge_weight, g));
BOOST_CHECK(read_graphviz(in, g, dp, "id"));
BOOST_TEST(read_graphviz(in, g, dp, "id"));
BOOST_CHECK(num_vertices(g) == 4);
BOOST_CHECK(num_edges(g) == 4);
BOOST_TEST(num_vertices(g) == 4);
BOOST_TEST(num_edges(g) == 4);
typedef graph_traits< Graph >::vertex_descriptor Vertex;
@@ -43,27 +45,27 @@ void test_graph_read_write(const std::string& filename)
name_to_vertex[get(vertex_name, g, v)] = v;
// Check vertices
BOOST_CHECK(name_to_vertex.find("0") != name_to_vertex.end());
BOOST_CHECK(name_to_vertex.find("1") != name_to_vertex.end());
BOOST_CHECK(name_to_vertex.find("foo") != name_to_vertex.end());
BOOST_CHECK(name_to_vertex.find("bar") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("0") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("1") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("foo") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("bar") != name_to_vertex.end());
// Check edges
BOOST_CHECK(edge(name_to_vertex["0"], name_to_vertex["1"], g).second);
BOOST_CHECK(edge(name_to_vertex["1"], name_to_vertex["foo"], g).second);
BOOST_CHECK(edge(name_to_vertex["foo"], name_to_vertex["bar"], g).second);
BOOST_CHECK(edge(name_to_vertex["1"], name_to_vertex["bar"], g).second);
BOOST_TEST(edge(name_to_vertex["0"], name_to_vertex["1"], g).second);
BOOST_TEST(edge(name_to_vertex["1"], name_to_vertex["foo"], g).second);
BOOST_TEST(edge(name_to_vertex["foo"], name_to_vertex["bar"], g).second);
BOOST_TEST(edge(name_to_vertex["1"], name_to_vertex["bar"], g).second);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["0"], name_to_vertex["1"], g).first)
== 3.14159);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["1"], name_to_vertex["foo"], g).first)
== 2.71828);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["foo"], name_to_vertex["bar"], g).first)
== 10.0);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["1"], name_to_vertex["bar"], g).first)
== 10.0);
@@ -71,9 +73,9 @@ void test_graph_read_write(const std::string& filename)
write_graphviz_dp(std::cout, g, dp, std::string("id"));
}
int test_main(int argc, char* argv[])
int main(int argc, char* argv[])
{
test_graph_read_write(argc >= 2 ? argv[1] : "graphviz_example.dot");
return 0;
return boost::report_errors();
}
+1 -1
View File
@@ -30,7 +30,7 @@
#ifndef BOOST_ALGORITHM_HPP
#define BOOST_ALGORITHM_HPP
#include <boost/detail/iterator.hpp>
// Algorithms on sequences
//
// The functions in this file have not yet gone through formal
+3 -3
View File
@@ -10,7 +10,7 @@
#ifndef BOOST_ADJACENCY_ITERATOR_HPP
#define BOOST_ADJACENCY_ITERATOR_HPP
#include <boost/detail/iterator.hpp>
#include <iterator>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/graph/graph_traits.hpp>
@@ -45,7 +45,7 @@ template < class Graph,
class adjacency_iterator_generator
{
typedef
typename boost::detail::iterator_traits< OutEdgeIter >::difference_type
typename std::iterator_traits< OutEdgeIter >::difference_type
difference_type;
public:
@@ -81,7 +81,7 @@ template < class Graph,
class inv_adjacency_iterator_generator
{
typedef
typename boost::detail::iterator_traits< InEdgeIter >::difference_type
typename std::iterator_traits< InEdgeIter >::difference_type
difference_type;
public:
-1
View File
@@ -328,7 +328,6 @@ inline void astar_search_no_init_tree(const VertexListGraph& g,
BOOST_THROW_EXCEPTION(negative_edge());
bool decreased
= relax(e, g, weight, predecessor, distance, combine, compare);
combine(get(distance, v), e_weight);
if (decreased)
{
vis.edge_relaxed(e, g);
+2 -2
View File
@@ -9,11 +9,11 @@
#ifndef BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP
#define BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP
#include <boost/algorithm/minmax_element.hpp>
#include <boost/graph/betweenness_centrality.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/pending/indirect_cmp.hpp>
#include <algorithm>
#include <vector>
#include <boost/property_map/property_map.hpp>
@@ -133,7 +133,7 @@ void betweenness_centrality_clustering(MutableGraph& g, Done done,
.vertex_index_map(vertex_index));
std::pair< edge_iterator, edge_iterator > edges_iters = edges(g);
edge_descriptor e
= *max_element(edges_iters.first, edges_iters.second, cmp);
= *boost::first_max_element(edges_iters.first, edges_iters.second, cmp);
is_done = done(get(edge_centrality, e), e, g);
if (!is_done)
remove_edge(e, g);
-1
View File
@@ -20,7 +20,6 @@
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/one_bit_color_map.hpp>
#include <boost/bind.hpp>
namespace boost
{
@@ -977,7 +977,7 @@ boykov_kolmogorov_max_flow(Graph& g, CapacityEdgeMap cap,
}
/**
* non-named-parameter version, given capacity, residucal_capacity,
* non-named-parameter version, given capacity, residual_capacity,
* reverse_edges, and an index map.
*/
template < class Graph, class CapacityEdgeMap, class ResidualCapacityEdgeMap,
@@ -1029,8 +1029,7 @@ boykov_kolmogorov_max_flow(Graph& g, CapacityEdgeMap cap,
* named-parameter version, some given
*/
template < class Graph, class P, class T, class R >
typename property_traits<
typename property_map< Graph, edge_capacity_t >::const_type >::value_type
typename detail::edge_capacity_value< Graph, P, T, R >::type
boykov_kolmogorov_max_flow(Graph& g,
typename graph_traits< Graph >::vertex_descriptor src,
typename graph_traits< Graph >::vertex_descriptor sink,
+2 -2
View File
@@ -27,7 +27,7 @@
#include <boost/graph/detail/mpi_include.hpp>
#include <boost/concept/assert.hpp>
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / concepts.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/concepts.hpp>)
namespace boost
{
@@ -403,6 +403,6 @@ namespace graph
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / breadth_first_search.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/breadth_first_search.hpp>)
#endif // BOOST_GRAPH_BREADTH_FIRST_SEARCH_HPP
+1 -1
View File
@@ -109,6 +109,6 @@ connected_components(const Graph& g,
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / connected_components.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/connected_components.hpp>)
#endif // BOOST_GRAPH_CONNECTED_COMPONENTS_HPP
+1 -1
View File
@@ -428,6 +428,6 @@ void depth_first_visit(const IncidenceGraph& g,
}
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / depth_first_search.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/depth_first_search.hpp>)
#endif
@@ -21,6 +21,7 @@
#include <boost/range/irange.hpp>
#include <boost/graph/graph_traits.hpp>
#include <memory>
#include <iterator>
#include <algorithm>
#include <boost/limits.hpp>
@@ -2068,15 +2069,20 @@ namespace detail
inline void reindex_edge_list(
EdgeList& el, vertex_descriptor u, boost::disallow_parallel_edge_tag)
{
for (typename EdgeList::iterator ei = el.begin(); ei != el.end(); ++ei)
typename EdgeList::iterator ei = el.begin(), e_end = el.end();
while (ei != e_end)
{
if (ei->get_target() > u)
{
typename EdgeList::value_type ce = *ei;
++ei;
el.erase(ce);
--ce.get_target();
el.insert(ce);
}
else {
++ei;
}
}
}
} // namespace detail
@@ -2370,7 +2376,7 @@ namespace detail
typedef typename OutEdgeList::size_type degree_size_type;
typedef typename OutEdgeList::iterator OutEdgeIter;
typedef boost::detail::iterator_traits< OutEdgeIter >
typedef std::iterator_traits< OutEdgeIter >
OutEdgeIterTraits;
typedef
typename OutEdgeIterTraits::iterator_category OutEdgeIterCat;
@@ -2398,7 +2404,7 @@ namespace detail
// Edge Iterator
typedef boost::detail::iterator_traits< EdgeIter > EdgeIterTraits;
typedef std::iterator_traits< EdgeIter > EdgeIterTraits;
typedef typename EdgeIterTraits::iterator_category EdgeIterCat;
typedef typename EdgeIterTraits::difference_type EdgeIterDiff;
+4 -4
View File
@@ -204,10 +204,10 @@ private:
// Get the parent of a given node in the heap
static size_type parent(size_type index) { return (index - 1) / Arity; }
// Get the child_idx'th child of a given node; 0 <= child_idx < Arity
static size_type child(size_type index, std::size_t child_idx)
// Get the first child of a given node
static size_type first_child(size_type index)
{
return index * Arity + child_idx + 1;
return index * Arity + 1;
}
// Swap two elements in the heap by index, updating index_in_heap
@@ -304,7 +304,7 @@ private:
Value* data_ptr = &data[0];
for (;;)
{
size_type first_child_index = child(index, 0);
size_type first_child_index = first_child(index);
if (first_child_index >= heap_size)
break; /* No children */
Value* child_base_ptr = data_ptr + first_child_index;
+3 -2
View File
@@ -55,8 +55,9 @@ namespace detail
(ReadablePropertyMapConcept< DistanceMap, Vertex >));
BOOST_CONCEPT_ASSERT((NumericValueConcept< Distance >));
typedef numeric_values< Distance > DistanceNumbers;
BOOST_CONCEPT_ASSERT((AdaptableBinaryFunction< Combinator, Distance,
Distance, Distance >));
// NOTE: Disabled until this concept assert is fixed in Boost.ConceptCheck.
// BOOST_CONCEPT_ASSERT((AdaptableBinaryFunction< Combinator, Distance,
// Distance, Distance >));
// If there's ever an infinite distance, then we simply return
// infinity. Note that this /will/ include the a non-zero
@@ -21,7 +21,6 @@
#include <boost/graph/properties.hpp>
#include <boost/pending/indirect_cmp.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/bind.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/depth_first_search.hpp>
@@ -575,6 +575,6 @@ inline void dijkstra_shortest_paths(const VertexListGraph& g,
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / dijkstra_shortest_paths.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/dijkstra_shortest_paths.hpp>)
#endif // BOOST_GRAPH_DIJKSTRA_HPP
@@ -8,11 +8,11 @@
#ifndef BOOST_DEPRECATED_INCLUDE_EDMONDS_KARP_MAX_FLOW_HPP
#define BOOST_DEPRECATED_INCLUDE_EDMONDS_KARP_MAX_FLOW_HPP
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
#if defined(_MSC_VER) || defined(__BORLANDC__) && !defined(__clang__) || defined(__DMC__)
#pragma message( \
"Warning: This header is deprecated. Please use: boost/graph/edmonds_karp_max_flow.hpp")
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) \
|| defined(__IBMCPP__)
|| defined(__IBMCPP__) || defined(__BORLANDC__)
#warning \
"This header is deprecated. Please use: boost/graph/edmonds_karp_max_flow.hpp"
#endif
+1 -1
View File
@@ -455,6 +455,6 @@ void fruchterman_reingold_force_directed_layout(
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / fruchterman_reingold.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/fruchterman_reingold.hpp>)
#endif // BOOST_GRAPH_FRUCHTERMAN_REINGOLD_FORCE_DIRECTED_LAYOUT_HPP
+3 -2
View File
@@ -27,8 +27,9 @@ struct mean_geodesic_measure
BOOST_CONCEPT_ASSERT((VertexListGraphConcept< Graph >));
BOOST_CONCEPT_ASSERT((NumericValueConcept< DistanceType >));
BOOST_CONCEPT_ASSERT((NumericValueConcept< ResultType >));
BOOST_CONCEPT_ASSERT((AdaptableBinaryFunctionConcept< Divides,
ResultType, ResultType, ResultType >));
// NOTE: Disabled until this concept assert is fixed in Boost.ConceptCheck.
// BOOST_CONCEPT_ASSERT((AdaptableBinaryFunctionConcept< Divides,
// ResultType, ResultType, ResultType >));
return (d == base_type::infinite_distance())
? base_type::infinite_result()
+1 -1
View File
@@ -38,7 +38,7 @@ namespace boost
// It is needed in order to allow us to write using boost::vertices as
// needed for ADL when using vector_as_graph below.
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) \
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
&& !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#define BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
#endif
+12 -12
View File
@@ -18,7 +18,6 @@
#include <boost/type_traits/is_convertible.hpp>
#include <boost/graph/dll_import_export.hpp>
#include <boost/graph/graphviz.hpp> // for exceptions
#include <typeinfo>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/find.hpp>
@@ -27,6 +26,7 @@
#include <boost/throw_exception.hpp>
#include <exception>
#include <sstream>
#include <typeinfo>
namespace boost
{
@@ -41,8 +41,8 @@ struct BOOST_SYMBOL_VISIBLE parse_error : public graph_exception
error = err;
statement = "parse error: " + error;
}
virtual ~parse_error() throw() {}
virtual const char* what() const throw() { return statement.c_str(); }
~parse_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE { return statement.c_str(); }
std::string statement;
std::string error;
};
@@ -84,16 +84,16 @@ public:
{
}
bool is_directed() const
bool is_directed() const BOOST_OVERRIDE
{
return is_convertible<
typename graph_traits< MutableGraph >::directed_category,
directed_tag >::value;
}
virtual any do_add_vertex() { return any(add_vertex(m_g)); }
any do_add_vertex() BOOST_OVERRIDE { return any(add_vertex(m_g)); }
virtual std::pair< any, bool > do_add_edge(any source, any target)
std::pair< any, bool > do_add_edge(any source, any target) BOOST_OVERRIDE
{
std::pair< edge_descriptor, bool > retval
= add_edge(any_cast< vertex_descriptor >(source),
@@ -101,8 +101,8 @@ public:
return std::make_pair(any(retval.first), retval.second);
}
virtual void set_graph_property(const std::string& name,
const std::string& value, const std::string& value_type)
void set_graph_property(const std::string& name,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
{
bool type_found = false;
try
@@ -123,8 +123,8 @@ public:
}
}
virtual void set_vertex_property(const std::string& name, any vertex,
const std::string& value, const std::string& value_type)
void set_vertex_property(const std::string& name, any vertex,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
{
bool type_found = false;
try
@@ -146,8 +146,8 @@ public:
}
}
virtual void set_edge_property(const std::string& name, any edge,
const std::string& value, const std::string& value_type)
void set_edge_property(const std::string& name, any edge,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
{
bool type_found = false;
try
+40 -38
View File
@@ -11,11 +11,11 @@
#define BOOST_GRAPHVIZ_HPP
#include <boost/config.hpp>
#include <string>
#include <map>
#include <iostream>
#include <cstdio> // for FILE
#include <fstream>
#include <stdio.h> // for FILE
#include <iostream>
#include <map>
#include <string>
#include <boost/property_map/property_map.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/graph_traits.hpp>
@@ -651,8 +651,8 @@ void write_graphviz_dp(std::ostream& out, const Graph& g,
/////////////////////////////////////////////////////////////////////////////
struct BOOST_SYMBOL_VISIBLE graph_exception : public std::exception
{
virtual ~graph_exception() throw() {}
virtual const char* what() const throw() = 0;
~graph_exception() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE = 0;
};
struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
@@ -665,8 +665,8 @@ struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
{
}
virtual ~bad_parallel_edge() throw() {}
const char* what() const throw()
~bad_parallel_edge() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
{
if (statement.empty())
statement = std::string("Failed to add parallel edge: (") + from
@@ -678,8 +678,8 @@ struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception
{
virtual ~directed_graph_error() throw() {}
virtual const char* what() const throw()
~directed_graph_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
{
return "read_graphviz: "
"Tried to read a directed graph into an undirected graph.";
@@ -688,8 +688,8 @@ struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception
struct BOOST_SYMBOL_VISIBLE undirected_graph_error : public graph_exception
{
virtual ~undirected_graph_error() throw() {}
virtual const char* what() const throw()
~undirected_graph_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
{
return "read_graphviz: "
"Tried to read an undirected graph into a directed graph.";
@@ -700,8 +700,8 @@ struct BOOST_SYMBOL_VISIBLE bad_graphviz_syntax : public graph_exception
{
std::string errmsg;
bad_graphviz_syntax(const std::string& errmsg) : errmsg(errmsg) {}
const char* what() const throw() { return errmsg.c_str(); }
~bad_graphviz_syntax() throw() {};
const char* what() const throw() BOOST_OVERRIDE { return errmsg.c_str(); }
~bad_graphviz_syntax() throw() BOOST_OVERRIDE {}
};
namespace detail
@@ -723,7 +723,7 @@ namespace detail
{
static int idx = 0;
return edge_t(idx++);
};
}
bool operator==(const edge_t& rhs) const
{
@@ -774,9 +774,9 @@ namespace detail
{
}
~mutate_graph_impl() {}
~mutate_graph_impl() BOOST_OVERRIDE {}
bool is_directed() const
bool is_directed() const BOOST_OVERRIDE
{
return boost::is_convertible<
typename boost::graph_traits<
@@ -784,7 +784,7 @@ namespace detail
boost::directed_tag >::value;
}
virtual void do_add_vertex(const node_t& node)
void do_add_vertex(const node_t& node) BOOST_OVERRIDE
{
// Add the node to the graph.
bgl_vertex_t v = add_vertex(graph_);
@@ -797,8 +797,8 @@ namespace detail
put(node_id_prop_, dp_, v, node);
}
void do_add_edge(
const edge_t& edge, const node_t& source, const node_t& target)
void do_add_edge(const edge_t& edge, const node_t& source,
const node_t& target) BOOST_OVERRIDE
{
std::pair< bgl_edge_t, bool > result
= add_edge(bgl_nodes[source], bgl_nodes[target], graph_);
@@ -814,25 +814,26 @@ namespace detail
}
}
void set_node_property(
const id_t& key, const node_t& node, const id_t& value)
void set_node_property(const id_t& key, const node_t& node,
const id_t& value) BOOST_OVERRIDE
{
put(key, dp_, bgl_nodes[node], value);
}
void set_edge_property(
const id_t& key, const edge_t& edge, const id_t& value)
void set_edge_property(const id_t& key, const edge_t& edge,
const id_t& value) BOOST_OVERRIDE
{
put(key, dp_, bgl_edges[edge], value);
}
void set_graph_property(const id_t& key, const id_t& value)
void set_graph_property(const id_t& key,
const id_t& value) BOOST_OVERRIDE
{
/* RG: pointer to graph prevents copying */
put(key, dp_, &graph_, value);
}
void finish_building_graph() {}
void finish_building_graph() BOOST_OVERRIDE {}
protected:
MutableGraph& graph_;
@@ -869,9 +870,9 @@ namespace detail
{
}
~mutate_graph_impl() {}
~mutate_graph_impl() BOOST_OVERRIDE {}
void finish_building_graph()
void finish_building_graph() BOOST_OVERRIDE
{
typedef compressed_sparse_row_graph< directedS, no_property,
bgl_edge_t, GraphProperty, Vertex, EdgeIndex >
@@ -902,14 +903,14 @@ namespace detail
}
}
bool is_directed() const
bool is_directed() const BOOST_OVERRIDE
{
return boost::is_convertible<
typename boost::graph_traits< CSRGraph >::directed_category,
boost::directed_tag >::value;
}
virtual void do_add_vertex(const node_t& node)
void do_add_vertex(const node_t& node) BOOST_OVERRIDE
{
// Add the node to the graph.
bgl_vertex_t v = vertex_count++;
@@ -923,8 +924,8 @@ namespace detail
boost::make_tuple(node_id_prop_, v, node));
}
void do_add_edge(
const edge_t& edge, const node_t& source, const node_t& target)
void do_add_edge(const edge_t& edge, const node_t& source,
const node_t& target) BOOST_OVERRIDE
{
bgl_edge_t result = edges_to_add.size();
edges_to_add.push_back(
@@ -932,21 +933,22 @@ namespace detail
bgl_edges.insert(std::make_pair(edge, result));
}
void set_node_property(
const id_t& key, const node_t& node, const id_t& value)
void set_node_property(const id_t& key, const node_t& node,
const id_t& value) BOOST_OVERRIDE
{
vertex_props.push_back(
boost::make_tuple(key, bgl_nodes[node], value));
}
void set_edge_property(
const id_t& key, const edge_t& edge, const id_t& value)
void set_edge_property(const id_t& key, const edge_t& edge,
const id_t& value) BOOST_OVERRIDE
{
edge_props.push_back(
boost::make_tuple(key, bgl_edges[edge], value));
}
void set_graph_property(const id_t& key, const id_t& value)
void set_graph_property(const id_t& key,
const id_t& value) BOOST_OVERRIDE
{
/* RG: pointer to graph prevents copying */
put(key, dp_, &graph_, value);
@@ -1025,6 +1027,6 @@ bool read_graphviz(std::istream& in, MutableGraph& graph,
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / graphviz.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/graphviz.hpp>)
#endif // BOOST_GRAPHVIZ_HPP
-1
View File
@@ -15,7 +15,6 @@
#include <numeric>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/limits.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
+9 -2
View File
@@ -10,9 +10,11 @@
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <limits>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/concept_check.hpp>
@@ -21,6 +23,7 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/concept/assert.hpp>
#include <boost/algorithm/minmax_element.hpp>
/** @file howard_cycle_ratio.hpp
* @brief The implementation of the maximum/minimum cycle ratio/mean algorithm.
@@ -238,9 +241,11 @@ namespace detail
typename graph_traits< Graph >::out_edge_iterator oei, oeie;
for (boost::tie(vi, vie) = vertices(m_g); vi != vie; ++vi)
{
using namespace boost::placeholders;
boost::tie(oei, oeie) = out_edges(*vi, m_g);
typename graph_traits< Graph >::out_edge_iterator mei
= std::max_element(oei, oeie,
= boost::first_max_element(oei, oeie,
boost::bind(m_cmp,
boost::bind(&EdgeWeight1::operator[], m_ew1m, _1),
boost::bind(&EdgeWeight1::operator[], m_ew1m, _2)));
@@ -351,6 +356,8 @@ namespace detail
*/
float_t policy_mcr()
{
using namespace boost::placeholders;
std::fill(m_col_bfs.begin(), m_col_bfs.end(), my_white);
color_map_t vcm_ = color_map_t(m_col_bfs.begin(), m_vim);
typename graph_traits< Graph >::vertex_iterator uv_itr, vie;
@@ -13,10 +13,10 @@
#ifndef BOOST_INCREMENTAL_COMPONENTS_HPP
#define BOOST_INCREMENTAL_COMPONENTS_HPP
#include <boost/detail/iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/detail/incremental_components.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/make_shared.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/pending/disjoint_sets.hpp>
#include <iterator>
@@ -69,7 +69,7 @@ void compress_components(ParentIterator first, ParentIterator last)
}
template < class ParentIterator >
typename boost::detail::iterator_traits< ParentIterator >::difference_type
typename std::iterator_traits< ParentIterator >::difference_type
component_count(ParentIterator first, ParentIterator last)
{
std::ptrdiff_t count = 0;
+7
View File
@@ -11,7 +11,12 @@
#ifndef BOOST_GRAPH_KING_HPP
#define BOOST_GRAPH_KING_HPP
#include <deque>
#include <vector>
#include <algorithm>
#include <boost/config.hpp>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/detail/sparse_ordering.hpp>
#include <boost/graph/graph_utility.hpp>
@@ -44,6 +49,8 @@ namespace detail
template < typename Vertex, typename Graph >
void finish_vertex(Vertex, Graph& g)
{
using namespace boost::placeholders;
typename graph_traits< Graph >::out_edge_iterator ei, ei_end;
Vertex v, w;
+1 -1
View File
@@ -99,6 +99,6 @@ inline one_bit_color_map< IndexMap > make_one_bit_color_map(
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / one_bit_color_map.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/one_bit_color_map.hpp>)
#endif // BOOST_ONE_BIT_COLOR_MAP_HPP
+1 -1
View File
@@ -174,6 +174,6 @@ namespace graph
}
} // end namespace boost::graph
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / page_rank.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/page_rank.hpp>)
#endif // BOOST_GRAPH_PAGE_RANK_HPP
+2 -2
View File
@@ -38,7 +38,7 @@ typename graph_traits< Graph >::vertex_descriptor random_vertex(
{
if (num_vertices(g) > 1)
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x581))
std::size_t n = std::random(num_vertices(g));
#else
uniform_int<> distrib(0, num_vertices(g) - 1);
@@ -59,7 +59,7 @@ typename graph_traits< Graph >::edge_descriptor random_edge(
{
if (num_edges(g) > 1)
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x581))
typename graph_traits< Graph >::edges_size_type n
= std::random(num_edges(g));
#else
+1 -1
View File
@@ -658,6 +658,6 @@ private:
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / rmat_graph_generator.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/rmat_graph_generator.hpp>)
#endif // BOOST_GRAPH_RMAT_GENERATOR_HPP
+163 -100
View File
@@ -29,94 +29,130 @@ namespace boost
namespace detail
{
template < typename ParityMap, typename WeightMap, typename IndexMap >
class mas_min_cut_visitor : public boost::default_mas_visitor
/**
* \brief Performs a phase of the Stoer-Wagner min-cut algorithm
*
* Performs a phase of the Stoer-Wagner min-cut algorithm.
*
* As described by Stoer & Wagner (1997), a phase is simply a maximum
* adjacency search (also called a maximum cardinality search), which
* results in the selection of two vertices \em s and \em t, and, as a side
* product, a minimum <em>s</em>-<em>t</em> cut of the input graph. Here,
* the input graph is basically \p g, but some vertices are virtually
* assigned to others as a way of viewing \p g as a graph with some sets of
* vertices merged together.
*
* This implementation is a translation of pseudocode by Professor Uri
* Zwick, School of Computer Science, Tel Aviv University.
*
* \pre \p g is a connected, undirected graph
* \param[in] g the input graph
* \param[in] assignments a read/write property map from each vertex to the
* vertex that it is assigned to
* \param[in] assignedVertices a list of vertices that are assigned to
* others
* \param[in] weights a readable property map from each edge to its
* weight (a non-negative value)
* \param[out] pq a keyed, updatable max-priority queue
* \returns a tuple (\em s, \em t, \em w) of the "<em>s</em>" and
* "<em>t</em>" of the minimum <em>s</em>-<em>t</em> cut and the
* cut weight \em w of the minimum <em>s</em>-<em>t</em> cut.
* \see http://www.cs.tau.ac.il/~zwick/grad-algo-08/gmc.pdf
*
* \author Daniel Trebbien
* \date 2010-09-11
*/
template < class UndirectedGraph, class VertexAssignmentMap,
class WeightMap, class KeyedUpdatablePriorityQueue >
boost::tuple<
typename boost::graph_traits< UndirectedGraph >::vertex_descriptor,
typename boost::graph_traits< UndirectedGraph >::vertex_descriptor,
typename boost::property_traits< WeightMap >::value_type >
stoer_wagner_phase(const UndirectedGraph& g,
VertexAssignmentMap assignments,
const std::set< typename boost::graph_traits<
UndirectedGraph >::vertex_descriptor >& assignedVertices,
WeightMap weights, KeyedUpdatablePriorityQueue& pq)
{
typedef one_bit_color_map< IndexMap > InternalParityMap;
typedef
typename boost::graph_traits< UndirectedGraph >::vertex_descriptor
vertex_descriptor;
typedef typename boost::property_traits< WeightMap >::value_type
weight_type;
public:
template < typename Graph >
mas_min_cut_visitor(const Graph& g, ParityMap parity,
weight_type& cutweight, const WeightMap& weight_map,
IndexMap index_map)
: m_bestParity(parity)
, m_parity(make_one_bit_color_map(num_vertices(g), index_map))
, m_bestWeight(cutweight)
, m_cutweight(0)
, m_visited(0)
, m_weightMap(weight_map)
BOOST_ASSERT(pq.empty());
typename KeyedUpdatablePriorityQueue::key_map keys = pq.keys();
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
// set here since the init list sets the reference
m_bestWeight = (std::numeric_limits< weight_type >::max)();
}
if (v == get(assignments, v))
{ // foreach u \in V do
put(keys, v, weight_type(0));
template < typename Vertex, typename Graph >
void initialize_vertex(Vertex u, const Graph& g)
{
typedef typename boost::property_traits< ParityMap >::value_type
parity_type;
typedef
typename boost::property_traits< InternalParityMap >::value_type
internal_parity_type;
put(m_parity, u, internal_parity_type(0));
put(m_bestParity, u, parity_type(0));
}
template < typename Edge, typename Graph >
void examine_edge(Edge e, const Graph& g)
{
weight_type w = get(m_weightMap, e);
// if the target of e is already marked then decrease cutweight
// otherwise, increase it
if (get(m_parity, boost::target(e, g)))
{
m_cutweight -= w;
}
else
{
m_cutweight += w;
pq.push(v);
}
}
template < typename Vertex, typename Graph >
void finish_vertex(Vertex u, const Graph& g)
{
typedef
typename boost::property_traits< InternalParityMap >::value_type
internal_parity_type;
BOOST_ASSERT(pq.size() >= 2);
++m_visited;
put(m_parity, u, internal_parity_type(1));
vertex_descriptor s
= boost::graph_traits< UndirectedGraph >::null_vertex();
vertex_descriptor t
= boost::graph_traits< UndirectedGraph >::null_vertex();
weight_type w;
while (!pq.empty())
{ // while PQ \neq {} do
const vertex_descriptor u = pq.top(); // u = extractmax(PQ)
w = get(keys, u);
pq.pop();
if (m_cutweight < m_bestWeight && m_visited < num_vertices(g))
s = t;
t = u;
BGL_FORALL_OUTEDGES_T(u, e, g, UndirectedGraph)
{ // foreach (u, v) \in E do
const vertex_descriptor v = get(assignments, target(e, g));
if (pq.contains(v))
{ // if v \in PQ then
put(keys, v,
get(keys, v)
+ get(weights,
e)); // increasekey(PQ, v, wA(v) + w(u, v))
pq.update(v);
}
}
typename std::set< vertex_descriptor >::const_iterator
assignedVertexIt,
assignedVertexEnd = assignedVertices.end();
for (assignedVertexIt = assignedVertices.begin();
assignedVertexIt != assignedVertexEnd; ++assignedVertexIt)
{
m_bestWeight = m_cutweight;
BGL_FORALL_VERTICES_T(i, g, Graph)
const vertex_descriptor uPrime = *assignedVertexIt;
if (get(assignments, uPrime) == u)
{
put(m_bestParity, i, get(m_parity, i));
BGL_FORALL_OUTEDGES_T(uPrime, e, g, UndirectedGraph)
{ // foreach (u, v) \in E do
const vertex_descriptor v
= get(assignments, target(e, g));
if (pq.contains(v))
{ // if v \in PQ then
put(keys, v,
get(keys, v)
+ get(weights, e)); // increasekey(PQ, v,
// wA(v) + w(u, v))
pq.update(v);
}
}
}
}
}
inline void clear()
{
m_bestWeight = (std::numeric_limits< weight_type >::max)();
m_visited = 0;
m_cutweight = 0;
}
private:
ParityMap m_bestParity;
InternalParityMap m_parity;
weight_type& m_bestWeight;
weight_type m_cutweight;
unsigned m_visited;
const WeightMap& m_weightMap;
};
return boost::make_tuple(s, t, w);
}
/**
* \brief Computes a min-cut of the input graph
@@ -156,44 +192,71 @@ namespace detail
vertex_descriptor;
typedef typename boost::property_traits< WeightMap >::value_type
weight_type;
typedef
typename boost::graph_traits< UndirectedGraph >::vertices_size_type
vertices_size_type;
typedef typename boost::property_traits< ParityMap >::value_type
parity_type;
typename graph_traits< UndirectedGraph >::vertex_iterator u_iter, u_end;
vertices_size_type n = num_vertices(g);
weight_type bestW = (std::numeric_limits< weight_type >::max)();
weight_type bestThisTime = (std::numeric_limits< weight_type >::max)();
vertex_descriptor bestStart
= boost::graph_traits< UndirectedGraph >::null_vertex();
std::set< vertex_descriptor > assignedVertices;
detail::mas_min_cut_visitor< ParityMap, WeightMap, IndexMap > vis(
g, parities, bestThisTime, weights, index_map);
// initialize `assignments` (all vertices are initially assigned to
// themselves)
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph) { put(assignments, v, v); }
// for each node in the graph,
for (boost::tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
vertex_descriptor s, t;
weight_type bestW;
boost::tie(s, t, bestW) = boost::detail::stoer_wagner_phase(
g, assignments, assignedVertices, weights, pq);
BOOST_ASSERT(s != t);
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
// run the MAS and find the min cut
vis.clear();
boost::maximum_adjacency_search(g,
boost::weight_map(weights)
.visitor(vis)
.root_vertex(*u_iter)
.vertex_assignment_map(assignments)
.max_priority_queue(pq));
if (bestThisTime < bestW)
put(parities, v, parity_type(v == t ? 1 : 0));
}
put(assignments, t, s);
assignedVertices.insert(t);
--n;
for (; n >= 2; --n)
{
weight_type w;
boost::tie(s, t, w) = boost::detail::stoer_wagner_phase(
g, assignments, assignedVertices, weights, pq);
BOOST_ASSERT(s != t);
if (w < bestW)
{
bestW = bestThisTime;
bestStart = *u_iter;
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
put(parities, v,
parity_type(get(assignments, v) == t ? 1 : 0));
if (get(assignments, v)
== t) // all vertices that were assigned to t are now
// assigned to s
put(assignments, v, s);
}
bestW = w;
}
else
{
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
if (get(assignments, v)
== t) // all vertices that were assigned to t are now
// assigned to s
put(assignments, v, s);
}
}
put(assignments, t, s);
assignedVertices.insert(t);
}
// Run one more time, starting from the best start location, to
// ensure the visitor has the best values.
vis.clear();
boost::maximum_adjacency_search(g,
boost::vertex_assignment_map(assignments)
.weight_map(weights)
.visitor(vis)
.root_vertex(bestStart)
.max_priority_queue(pq));
BOOST_ASSERT(pq.empty());
return bestW;
}
+1 -1
View File
@@ -342,6 +342,6 @@ kosaraju_strong_components(
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / strong_components.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/strong_components.hpp>)
#endif // BOOST_GRAPH_STRONG_COMPONENTS_HPP
+15 -7
View File
@@ -13,7 +13,7 @@
#include <algorithm> // for std::min and std::max
#include <functional>
#include <boost/config.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/topological_sort.hpp>
#include <boost/graph/graph_concepts.hpp>
@@ -82,7 +82,7 @@ void transitive_closure(const Graph& g, GraphTC& tc,
iterator_property_map< cg_vertex*, VertexIndexMap, cg_vertex, cg_vertex& >
component_number(&component_number_vec[0], index_map);
int num_scc
const cg_vertex num_scc
= strong_components(g, component_number, vertex_index_map(index_map));
std::vector< std::vector< vertex > > components;
@@ -107,12 +107,11 @@ void transitive_closure(const Graph& g, GraphTC& tc,
}
}
std::sort(adj.begin(), adj.end());
typename std::vector< cg_vertex >::iterator di
const typename std::vector< cg_vertex >::iterator di
= std::unique(adj.begin(), adj.end());
if (di != adj.end())
adj.erase(di, adj.end());
for (typename std::vector< cg_vertex >::const_iterator i = adj.begin();
i != adj.end(); ++i)
i != di; ++i)
{
add_edge(s, *i, CG);
}
@@ -131,6 +130,8 @@ void transitive_closure(const Graph& g, GraphTC& tc,
std::vector< std::vector< cg_vertex > > CG_vec(num_vertices(CG));
for (size_type i = 0; i < num_vertices(CG); ++i)
{
using namespace boost::placeholders;
typedef typename boost::graph_traits< CG_t >::adjacency_iterator
cg_adj_iter;
std::pair< cg_adj_iter, cg_adj_iter > pr = adjacent_vertices(i, CG);
@@ -156,9 +157,16 @@ void transitive_closure(const Graph& g, GraphTC& tc,
{
chain.push_back(v);
in_a_chain[v] = true;
typename std::vector< cg_vertex >::const_iterator next
#ifdef __cpp_lib_not_fn
= std::find_if(CG_vec[v].begin(), CG_vec[v].end(),
std::not1(detail::subscript(in_a_chain)));
std::not_fn(detail::subscript(in_a_chain)));
#else
= std::find_if(CG_vec[v].begin(), CG_vec[v].end(),
std::not1(detail::subscript(in_a_chain)));
#endif
if (next != CG_vec[v].end())
v = *next;
else
+1 -1
View File
@@ -103,6 +103,6 @@ inline two_bit_color_map< IndexMap > make_two_bit_color_map(
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / two_bit_color_map.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/two_bit_color_map.hpp>)
#endif // BOOST_TWO_BIT_COLOR_MAP_HPP
+1 -2
View File
@@ -6,8 +6,7 @@
// Authors: Douglas Gregor
// Andrew Lumsdaine
#warning \
"Use of relaxed_heap is depreciated; please use the standard heap functions."
#ifndef BOOST_RELAXED_HEAP_HEADER
#define BOOST_RELAXED_HEAP_HEADER
+2 -1
View File
@@ -12,5 +12,6 @@
],
"maintainers": [
"K. Noel Belcourt <kbelco -at- sandia.gov>"
]
],
"cxxstd": "03"
}
+5 -2
View File
@@ -18,6 +18,9 @@
#include <boost/graph/dll_import_export.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <map>
#include <string>
#include <vector>
using namespace boost;
@@ -162,8 +165,8 @@ public:
std::string local_directed
= edge.second.get(path("<xmlattr>/directed"), "");
bool is_directed
= (local_directed == "" ? default_directed
: local_directed == "true");
= (local_directed.empty() ? default_directed
: local_directed == "true");
if (is_directed != m_g.is_directed())
{
if (is_directed)
+7 -6
View File
@@ -33,19 +33,18 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <cstdlib>
#include <algorithm>
#include <exception> // for std::exception
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <set>
#include <utility>
#include <map>
#include <iostream>
#include <cstdlib>
#include <boost/throw_exception.hpp>
#include <boost/regex.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/graph/dll_import_export.hpp>
#include <boost/graph/graphviz.hpp>
@@ -334,6 +333,8 @@ namespace read_graphviz_detail
BOOST_ASSERT(!"Definition of punctuation_token does "
"not match switch statement");
}
// Prevent static analyzers complaining about fallthrough:
break;
}
default:
BOOST_ASSERT(!"Definition of punctuation_token does not "
@@ -827,7 +828,7 @@ namespace read_graphviz_detail
get();
if (peek().type != token::identifier)
error("Wanted identifier as port angle");
if (id.angle != "")
if (!id.angle.empty())
error("Duplicate port angle");
id.angle = get().normalized_value;
goto parse_more;
+10 -10
View File
@@ -9,6 +9,7 @@
import modules ;
import path ;
import ../../config/checks/config : requires ;
path-constant TEST_DIR : . ;
@@ -69,12 +70,11 @@ alias graph_test_regular :
[ run graph.cpp : : : <define>TEST=9 : graph_9 ]
[ compile graph_concepts.cpp ]
[ run graphviz_test.cpp
/boost/test//boost_test_exec_monitor/<link>static
../build//boost_graph
../../regex/build//boost_regex : --log_level=all ]
[ run metis_test.cpp : $(METIS_INPUT_FILE) ]
[ run gursoy_atun_layout_test.cpp ]
[ run layout_test.cpp : : : <test-info>always_show_run_output <toolset>intel:<debug-symbols>off ]
[ run gursoy_atun_layout_test.cpp : : : [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] ]
[ run layout_test.cpp : : : <test-info>always_show_run_output <toolset>intel:<debug-symbols>off [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] ]
[ run serialize.cpp
../../serialization/build//boost_serialization
@@ -86,7 +86,7 @@ alias graph_test_regular :
# TODO: Merge these into a single test framework.
[ run subgraph.cpp ]
[ run subgraph_bundled.cpp ]
[ run subgraph_add.cpp ../../test/build//boost_unit_test_framework/<link>static : $(TEST_DIR) ]
[ run subgraph_add.cpp : $(TEST_DIR) ]
[ run subgraph_props.cpp ]
[ run isomorphism.cpp ]
@@ -142,17 +142,17 @@ alias graph_test_regular :
[ run random_spanning_tree_test.cpp ../build//boost_graph ]
[ run random_matching_test.cpp : 1000 1020 ]
[ run graphml_test.cpp ../build//boost_graph : : "graphml_test.xml" ]
[ run mas_test.cpp ../../test/build//boost_unit_test_framework/<link>static : $(TEST_DIR) ]
[ run stoer_wagner_test.cpp ../../test/build//boost_unit_test_framework/<link>static : $(TEST_DIR) ]
[ run mas_test.cpp : $(TEST_DIR) ]
[ run stoer_wagner_test.cpp : $(TEST_DIR) ]
[ compile filtered_graph_properties_dijkstra.cpp ]
[ run vf2_sub_graph_iso_test.cpp ]
[ run vf2_sub_graph_iso_test_2.cpp ]
[ run hawick_circuits.cpp ]
[ run successive_shortest_path_nonnegative_weights_test.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run cycle_canceling_test.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run successive_shortest_path_nonnegative_weights_test.cpp ]
[ run cycle_canceling_test.cpp ]
[ run strong_components_test.cpp ]
[ run find_flow_cost_bundled_properties_and_named_params_test.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run max_flow_algorithms_bundled_properties_and_named_params.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run find_flow_cost_bundled_properties_and_named_params_test.cpp ]
[ run max_flow_algorithms_bundled_properties_and_named_params.cpp ]
[ run delete_edge.cpp ]
[ run johnson-test.cpp ]
[ run lvalue_pmap.cpp ]
+22 -8
View File
@@ -72,7 +72,7 @@ fill_random_max_flow_graph(Graph& g, CapacityMap cap, ReverseEdgeMap rev,
// cannot use this, as we have no idea how properties are stored, right?
typename graph_traits< Graph >::edge_iterator ei, e_end;
for (boost::tie(ei, e_end) = edges(g); ei != e_end; ++ei)
cap[*ei] = int_gen();
put(cap, *ei, int_gen());
// get source and sink node
vertex_descriptor s = random_vertex(g, gen);
@@ -96,9 +96,9 @@ fill_random_max_flow_graph(Graph& g, CapacityMap cap, ReverseEdgeMap rev,
boost::tie(new_edge, inserted)
= add_edge(source_vertex, target_vertex, g);
assert(inserted);
rev[old_edge] = new_edge;
rev[new_edge] = old_edge;
cap[new_edge] = 0;
put(rev, old_edge, new_edge);
put(rev, new_edge, old_edge);
put(cap, new_edge, 0);
}
return std::make_pair(s, t);
}
@@ -188,10 +188,24 @@ long test_bundled_properties(int n_verts, int n_edges, std::size_t seed)
boost::tie(src, sink)
= fill_random_max_flow_graph(g, get(&tEdge::edge_capacity, g),
get(&tEdge::edge_reverse, g), n_verts, n_edges, seed);
return boykov_kolmogorov_max_flow(g, get(&tEdge::edge_capacity, g),
get(&tEdge::edge_residual_capacity, g), get(&tEdge::edge_reverse, g),
get(&tVertex::vertex_predecessor, g), get(&tVertex::vertex_color, g),
get(&tVertex::vertex_distance, g), get(vertex_index, g), src, sink);
long flow_unnamed_overload = boykov_kolmogorov_max_flow(g,
get(&tEdge::edge_capacity, g), get(&tEdge::edge_residual_capacity, g),
get(&tEdge::edge_reverse, g), get(&tVertex::vertex_predecessor, g),
get(&tVertex::vertex_color, g), get(&tVertex::vertex_distance, g),
get(vertex_index, g), src, sink);
long flow_named_overload = boykov_kolmogorov_max_flow(g, src, sink,
capacity_map(get(&tEdge::edge_capacity, g))
.residual_capacity_map(get(&tEdge::edge_residual_capacity, g))
.reverse_edge_map(get(&tEdge::edge_reverse, g))
.predecessor_map(get(&tVertex::vertex_predecessor, g))
.color_map(get(&tVertex::vertex_color, g))
.distance_map(get(&tVertex::vertex_distance, g))
.vertex_index_map(get(vertex_index, g)));
BOOST_TEST(flow_unnamed_overload == flow_named_overload);
return flow_named_overload;
}
long test_overloads(int n_verts, int n_edges, std::size_t seed)
+15 -9
View File
@@ -7,16 +7,14 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#define BOOST_TEST_MODULE cycle_canceling_test
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/edmonds_karp_max_flow.hpp>
#include "min_cost_max_flow_utils.hpp"
BOOST_AUTO_TEST_CASE(cycle_canceling_def_test)
void cycle_canceling_def_test()
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -26,10 +24,10 @@ BOOST_AUTO_TEST_CASE(cycle_canceling_def_test)
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 29);
BOOST_TEST_EQ(cost, 29);
}
BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
void path_augmentation_def_test2()
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -39,10 +37,10 @@ BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 7);
BOOST_TEST_EQ(cost, 7);
}
BOOST_AUTO_TEST_CASE(cycle_canceling_test)
void cycle_canceling_test()
{
boost::SampleGraph::vertex_descriptor s, t;
typedef boost::SampleGraph::Graph Graph;
@@ -66,5 +64,13 @@ BOOST_AUTO_TEST_CASE(cycle_canceling_test)
.vertex_index_map(idx));
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 29);
BOOST_TEST_EQ(cost, 29);
}
int main()
{
cycle_canceling_def_test();
path_augmentation_def_test2();
cycle_canceling_test();
return boost::report_errors();
}
+18
View File
@@ -55,5 +55,23 @@ int main(int argc, char* argv[])
BOOST_TEST(m_graph[ed1] == EDGE_VAL);
// https://github.com/boostorg/graph/issues/268
// 1. Undirected:
{
boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS> g;
boost::add_edge(2, 0, g);
boost::remove_vertex(1, g);
BOOST_TEST(num_vertices(g) == 2);
BOOST_TEST(num_edges(g) == 1);
}
// 2. Directed:
{
boost::adjacency_list<boost::setS, boost::vecS, boost::directedS> g;
boost::add_edge(2, 0, g);
boost::remove_vertex(1, g);
BOOST_TEST(num_vertices(g) == 2);
BOOST_TEST(num_edges(g) == 1);
}
return boost::report_errors();
}
+2 -1
View File
@@ -10,6 +10,7 @@
#include <iostream>
#include <map>
#include <vector>
#include <ctime>
#include <boost/config.hpp>
#ifdef BOOST_MSVC
@@ -80,7 +81,7 @@ int main(int argc, char* argv[])
int vertices_to_create = 10;
int edges_to_create = 500;
std::size_t random_seed = time(0);
std::size_t random_seed = std::time(0);
if (argc > 1)
{
@@ -1,7 +1,4 @@
#define BOOST_TEST_MODULE \
find_flow_cost_bundled_properties_and_named_params_test
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>
#include "min_cost_max_flow_utils.hpp"
@@ -29,7 +26,7 @@ typedef boost::adjacency_list< boost::listS, boost::vecS, boost::directedS,
// Unit test written in order to fails (at compile time) if the find_flow_cost()
// is not properly handling bundled properties
BOOST_AUTO_TEST_CASE(using_bundled_properties_with_find_max_flow_test)
void using_bundled_properties_with_find_max_flow_test()
{
Graph g;
traits::vertex_descriptor s, t;
@@ -59,13 +56,12 @@ BOOST_AUTO_TEST_CASE(using_bundled_properties_with_find_max_flow_test)
// The "bundled properties" version (producing errors)
int flow_cost = boost::find_flow_cost(g, capacity, residual_capacity, cost);
BOOST_CHECK_EQUAL(flow_cost, 29);
BOOST_TEST_EQ(flow_cost, 29);
}
// Unit test written in order to fails (at compile time) if the find_flow_cost()
// is not properly handling bundled properties
BOOST_AUTO_TEST_CASE(
using_named_params_and_bundled_properties_with_find_max_flow_test)
void using_named_params_and_bundled_properties_with_find_max_flow_test()
{
Graph g;
traits::vertex_descriptor s, t;
@@ -99,5 +95,12 @@ BOOST_AUTO_TEST_CASE(
boost::capacity_map(capacity)
.residual_capacity_map(residual_capacity)
.weight_map(cost));
BOOST_CHECK_EQUAL(flow_cost, 29);
BOOST_TEST_EQ(flow_cost, 29);
}
int main()
{
using_bundled_properties_with_find_max_flow_test();
using_named_params_and_bundled_properties_with_find_max_flow_test();
return boost::report_errors();
}
+71 -42
View File
@@ -12,7 +12,6 @@
// Author: Ronald Garcia
#define BOOST_GRAPHVIZ_USE_ISTREAM
#define BOOST_TEST_MODULE TestGraphviz
#include <boost/regex.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/assign/std/map.hpp>
@@ -21,15 +20,29 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/property_map/dynamic_property_map.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/core/lightweight_test.hpp>
#include <algorithm>
#include <string>
#include <iostream>
#include <iterator>
#include <map>
#include <utility>
#include <cmath>
template<class T>
class close_to {
public:
explicit close_to(T f)
: f_(f) { }
bool operator()(T l, T r) const {
return std::abs(l - r) <=
(std::max)(f_ * (std::max)(std::abs(l), std::abs(r)), T());
}
private:
T f_;
};
using namespace std;
using namespace boost;
@@ -92,7 +105,7 @@ bool test_graph(std::istream& dotfile, graph_t& graph,
{
#endif
// check correct vertex count
BOOST_CHECK_EQUAL(num_vertices(graph), correct_num_vertices);
BOOST_TEST_EQ(num_vertices(graph), correct_num_vertices);
// check masses
if (!masses.empty())
{
@@ -105,10 +118,10 @@ bool test_graph(std::istream& dotfile, graph_t& graph,
std::string node_name = get(name, *i);
// - get its mass
float node_mass = get(mass, *i);
BOOST_CHECK(masses.find(node_name) != masses.end());
BOOST_TEST(masses.find(node_name) != masses.end());
float ref_mass = masses.find(node_name)->second;
// - compare the mass to the result in the table
BOOST_CHECK_CLOSE(node_mass, ref_mass, 0.01f);
BOOST_TEST_WITH(node_mass, ref_mass, close_to<float>(0.01f));
}
}
// check weights
@@ -124,16 +137,16 @@ bool test_graph(std::istream& dotfile, graph_t& graph,
get(name, source(*i, graph)), get(name, target(*i, graph)));
// - get its weight
double edge_weight = get(weight, *i);
BOOST_CHECK(weights.find(edge_name) != weights.end());
BOOST_TEST(weights.find(edge_name) != weights.end());
double ref_weight = weights.find(edge_name)->second;
// - compare the weight to teh result in the table
BOOST_CHECK_CLOSE(edge_weight, ref_weight, 0.01);
BOOST_TEST_WITH(edge_weight, ref_weight, close_to<double>(0.01));
}
}
if (!g_name.empty())
{
std::string parsed_name = get_property(graph, graph_name);
BOOST_CHECK(parsed_name == g_name);
BOOST_TEST(parsed_name == g_name);
}
}
else
@@ -166,27 +179,27 @@ struct edge_p_bundled
};
// Basic directed graph tests
BOOST_AUTO_TEST_CASE(basic_directed_graph_1)
void test_basic_directed_graph_1()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
gs_t gs("digraph { a node [mass = 7.7] c e [mass = 6.66] }");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
BOOST_TEST((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
}
BOOST_AUTO_TEST_CASE(basic_directed_graph_2)
void test_basic_directed_graph_2()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("e", 6.66f);
gs_t gs("digraph { a node [mass = 7.7] \"a\" e [mass = 6.66] }");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 2, masses, weight_map_t())));
BOOST_TEST((test_graph< graph_t >(gs, 2, masses, weight_map_t())));
}
BOOST_AUTO_TEST_CASE(basic_directed_graph_3)
void test_basic_directed_graph_3()
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)(
@@ -197,33 +210,33 @@ BOOST_AUTO_TEST_CASE(basic_directed_graph_3)
"d ->e->a [weight=.5]}");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
BOOST_TEST((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
}
// undirected graph with alternate node_id property name
BOOST_AUTO_TEST_CASE(undirected_graph_alternate_node_id)
void test_undirected_graph_alternate_node_id()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
gs_t gs("graph { a node [mass = 7.7] c e [mass = 6.66] }");
typedef adjacency_list< vecS, vecS, undirectedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK(
BOOST_TEST(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "nodenames")));
}
// Basic undirected graph tests
BOOST_AUTO_TEST_CASE(basic_undirected_graph_1)
void test_basic_undirected_graph_1()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
gs_t gs("graph { a node [mass = 7.7] c e [mass =\\\n6.66] }");
typedef adjacency_list< vecS, vecS, undirectedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
BOOST_TEST((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
}
BOOST_AUTO_TEST_CASE(basic_undirected_graph_2)
void test_basic_undirected_graph_2()
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)(
@@ -232,11 +245,11 @@ BOOST_AUTO_TEST_CASE(basic_undirected_graph_2)
"c -- d e -- f [weight = 6.66] }");
typedef adjacency_list< vecS, vecS, undirectedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
BOOST_TEST((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
}
// Mismatch directed graph test
BOOST_AUTO_TEST_CASE(mismatch_directed_graph)
void test_mismatch_directed_graph()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
@@ -260,7 +273,7 @@ BOOST_AUTO_TEST_CASE(mismatch_directed_graph)
}
// Mismatch undirected graph test
BOOST_AUTO_TEST_CASE(mismatch_undirected_graph)
void test_mismatch_undirected_graph()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
@@ -279,9 +292,8 @@ BOOST_AUTO_TEST_CASE(mismatch_undirected_graph)
}
// Complain about parallel edges
BOOST_AUTO_TEST_CASE(complain_about_parallel_edges)
void test_complain_about_parallel_edges()
{
BOOST_TEST_CHECKPOINT("Complain about parallel edges");
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 7.7);
gs_t gs("diGraph { a -> b [weight = 7.7] a -> b [weight = 7.7] }");
@@ -299,18 +311,18 @@ BOOST_AUTO_TEST_CASE(complain_about_parallel_edges)
}
// Handle parallel edges gracefully
BOOST_AUTO_TEST_CASE(handle_parallel_edges_gracefully)
void test_handle_parallel_edges_gracefully()
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 7.7);
gs_t gs("digraph { a -> b [weight = 7.7] a -> b [weight = 7.7] }");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 2, mass_map_t(), weights)));
BOOST_TEST((test_graph< graph_t >(gs, 2, mass_map_t(), weights)));
}
// Graph Property Test 1
BOOST_AUTO_TEST_CASE(graph_property_test_1)
void test_graph_property_test_1()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 0.0f)("e", 6.66f);
@@ -319,12 +331,12 @@ BOOST_AUTO_TEST_CASE(graph_property_test_1)
std::string graph_name("foo \"escaped\"");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK(
BOOST_TEST(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "", graph_name)));
}
// Graph Property Test 2
BOOST_AUTO_TEST_CASE(graph_property_test_2)
void test_graph_property_test_2()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 0.0f)("e", 6.66f);
@@ -332,12 +344,12 @@ BOOST_AUTO_TEST_CASE(graph_property_test_2)
std::string graph_name("foo");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK(
BOOST_TEST(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "", graph_name)));
}
// Graph Property Test 3 (HTML)
BOOST_AUTO_TEST_CASE(graph_property_test_3)
void test_graph_property_test_3()
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 0.0f)("e", 6.66f);
@@ -347,12 +359,12 @@ BOOST_AUTO_TEST_CASE(graph_property_test_3)
gs_t gs("digraph { name=" + graph_name + " a c e [mass = 6.66] }");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK(
BOOST_TEST(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "", graph_name)));
}
// Comments embedded in strings
BOOST_AUTO_TEST_CASE(comments_embedded_in_strings)
void test_comments_embedded_in_strings()
{
gs_t gs("digraph { "
"a0 [ label = \"//depot/path/to/file_14#4\" ];"
@@ -361,11 +373,11 @@ BOOST_AUTO_TEST_CASE(comments_embedded_in_strings)
"}");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_CHECK((test_graph< graph_t >(gs, 2, mass_map_t(), weight_map_t())));
BOOST_TEST((test_graph< graph_t >(gs, 2, mass_map_t(), weight_map_t())));
}
#if 0 // Currently broken
BOOST_AUTO_TEST_CASE (basic_csr_directed_graph) {
void test_basic_csr_directed_graph() {
weight_map_t weights;
insert( weights )(make_pair("a","b"),0.0)
(make_pair("c","d"),7.7)(make_pair("e","f"),6.66)
@@ -374,11 +386,11 @@ BOOST_AUTO_TEST_CASE(comments_embedded_in_strings)
"c -> d e-> f [weight = 6.66] "
"d ->e->a [weight=.5]}");
typedef compressed_sparse_row_graph<directedS, vertex_p_bundled, edge_p_bundled, graph_p > graph_t;
BOOST_CHECK((test_graph<graph_t>(gs,6,mass_map_t(),weights,"node_id","",&vertex_p_bundled::name,&vertex_p_bundled::color,&edge_p_bundled::weight)));
BOOST_TEST((test_graph<graph_t>(gs,6,mass_map_t(),weights,"node_id","",&vertex_p_bundled::name,&vertex_p_bundled::color,&edge_p_bundled::weight)));
}
#endif
BOOST_AUTO_TEST_CASE(basic_csr_directed_graph_ext_props)
void test_basic_csr_directed_graph_ext_props()
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)(
@@ -400,9 +412,26 @@ BOOST_AUTO_TEST_CASE(basic_csr_directed_graph_ext_props)
vector_property_map< double,
property_map< graph_t, edge_index_t >::const_type >
edge_weight(get(edge_index, g));
BOOST_CHECK((test_graph(gs, g, 6, mass_map_t(), weights, "node_id", "",
BOOST_TEST((test_graph(gs, g, 6, mass_map_t(), weights, "node_id", "",
vertex_name, vertex_color, edge_weight)));
}
// return 0;
// }
int main()
{
test_basic_directed_graph_1();
test_basic_directed_graph_2();
test_basic_directed_graph_3();
test_undirected_graph_alternate_node_id();
test_basic_undirected_graph_1();
test_basic_undirected_graph_2();
test_mismatch_directed_graph();
test_mismatch_undirected_graph();
test_complain_about_parallel_edges();
test_handle_parallel_edges_gracefully();
test_graph_property_test_1();
test_graph_property_test_2();
test_graph_property_test_3();
test_comments_embedded_in_strings();
test_basic_csr_directed_graph_ext_props();
return boost::report_errors();
}
+2 -1
View File
@@ -10,6 +10,7 @@
#include <fstream>
#include <iostream>
#include <set>
#include <ctime>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
@@ -224,7 +225,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
int main(int argc, char* argv[])
{
std::size_t random_seed = time(0);
std::size_t random_seed = std::time(0);
if (argc > 1)
{
+2 -1
View File
@@ -10,6 +10,7 @@
#include <iostream>
#include <map>
#include <set>
#include <ctime>
#include <boost/foreach.hpp>
#include <boost/graph/adjacency_list.hpp>
@@ -127,7 +128,7 @@ template < typename Graph > void test_graph(const Graph& graph)
int main(int argc, char* argv[])
{
std::size_t vertices_to_generate = 100, edges_to_generate = 50,
random_seed = time(0);
random_seed = std::time(0);
// Parse command-line arguments
+31 -34
View File
@@ -18,7 +18,7 @@
#include <boost/graph/visitors.hpp>
#include <boost/graph/property_maps/constant_property_map.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
@@ -37,19 +37,6 @@ typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS >
std::string test_dir;
boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[])
{
if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " path-to-libs-graph-test"
<< std::endl;
throw boost::unit_test::framework::setup_error(
"Invalid command line arguments");
}
test_dir = argv[1];
return 0;
}
struct edge_t
{
unsigned long first;
@@ -111,7 +98,7 @@ private:
// Check various implementations of the ArgPack where
// the weights are provided in it, and one case where
// they are not.
BOOST_AUTO_TEST_CASE(test0)
void test0()
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -159,9 +146,9 @@ BOOST_AUTO_TEST_CASE(test0)
.vertex_assignment_map(assignments)
.max_priority_queue(pq));
BOOST_CHECK_EQUAL(test_vis.curr(), vertex_descriptor(7));
BOOST_CHECK_EQUAL(test_vis.prev(), vertex_descriptor(6));
BOOST_CHECK_EQUAL(test_vis.reach_weight(), 5);
BOOST_TEST_EQ(test_vis.curr(), vertex_descriptor(7));
BOOST_TEST_EQ(test_vis.prev(), vertex_descriptor(6));
BOOST_TEST_EQ(test_vis.reach_weight(), 5);
test_vis.clear();
boost::maximum_adjacency_search(g,
@@ -170,17 +157,17 @@ BOOST_AUTO_TEST_CASE(test0)
.root_vertex(*vertices(g).first)
.max_priority_queue(pq));
BOOST_CHECK_EQUAL(test_vis.curr(), vertex_descriptor(7));
BOOST_CHECK_EQUAL(test_vis.prev(), vertex_descriptor(6));
BOOST_CHECK_EQUAL(test_vis.reach_weight(), 5);
BOOST_TEST_EQ(test_vis.curr(), vertex_descriptor(7));
BOOST_TEST_EQ(test_vis.prev(), vertex_descriptor(6));
BOOST_TEST_EQ(test_vis.reach_weight(), 5);
test_vis.clear();
boost::maximum_adjacency_search(
g, boost::weight_map(weights).visitor(test_vis).max_priority_queue(pq));
BOOST_CHECK_EQUAL(test_vis.curr(), vertex_descriptor(7));
BOOST_CHECK_EQUAL(test_vis.prev(), vertex_descriptor(6));
BOOST_CHECK_EQUAL(test_vis.reach_weight(), 5);
BOOST_TEST_EQ(test_vis.curr(), vertex_descriptor(7));
BOOST_TEST_EQ(test_vis.prev(), vertex_descriptor(6));
BOOST_TEST_EQ(test_vis.reach_weight(), 5);
boost::maximum_adjacency_search(g,
boost::weight_map(weights).visitor(
@@ -196,14 +183,14 @@ BOOST_AUTO_TEST_CASE(test0)
boost::make_constant_property< edge_descriptor >(weight_type(1)))
.visitor(test_vis)
.max_priority_queue(pq));
BOOST_CHECK_EQUAL(test_vis.curr(), vertex_descriptor(7));
BOOST_CHECK_EQUAL(test_vis.prev(), vertex_descriptor(3));
BOOST_CHECK_EQUAL(test_vis.reach_weight(), 2);
BOOST_TEST_EQ(test_vis.curr(), vertex_descriptor(7));
BOOST_TEST_EQ(test_vis.prev(), vertex_descriptor(3));
BOOST_TEST_EQ(test_vis.reach_weight(), 2);
}
// Check the unweighted case
// with and without providing a weight_map
BOOST_AUTO_TEST_CASE(test1)
void test1()
{
typedef boost::graph_traits<
undirected_unweighted_graph >::vertex_descriptor vertex_descriptor;
@@ -248,9 +235,9 @@ BOOST_AUTO_TEST_CASE(test1)
.visitor(test_vis)
.max_priority_queue(pq));
BOOST_CHECK_EQUAL(test_vis.curr(), vertex_descriptor(7));
BOOST_CHECK_EQUAL(test_vis.prev(), vertex_descriptor(3));
BOOST_CHECK_EQUAL(test_vis.reach_weight(), weight_type(2));
BOOST_TEST_EQ(test_vis.curr(), vertex_descriptor(7));
BOOST_TEST_EQ(test_vis.prev(), vertex_descriptor(3));
BOOST_TEST_EQ(test_vis.reach_weight(), weight_type(2));
weight_type ws[] = { 2, 3, 4, 3, 2, 2, 2, 2, 2, 3, 1, 3 };
std::map< edge_descriptor, weight_type > wm;
@@ -266,9 +253,19 @@ BOOST_AUTO_TEST_CASE(test1)
boost::maximum_adjacency_search(
g, boost::weight_map(ws_map).visitor(test_vis).max_priority_queue(pq));
BOOST_CHECK_EQUAL(test_vis.curr(), vertex_descriptor(7));
BOOST_CHECK_EQUAL(test_vis.prev(), vertex_descriptor(6));
BOOST_CHECK_EQUAL(test_vis.reach_weight(), weight_type(5));
BOOST_TEST_EQ(test_vis.curr(), vertex_descriptor(7));
BOOST_TEST_EQ(test_vis.prev(), vertex_descriptor(6));
BOOST_TEST_EQ(test_vis.reach_weight(), weight_type(5));
}
#include <boost/graph/iteration_macros_undef.hpp>
int main(int argc, char* argv[])
{
if (BOOST_TEST(argc == 2)) {
test_dir = argv[1];
test0();
test1();
}
return boost::report_errors();
}
@@ -1,8 +1,5 @@
#define BOOST_TEST_MODULE \
max_flow_algorithms_named_parameters_and_bundled_params_test
#include <boost/graph/adjacency_list.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/edmonds_karp_max_flow.hpp>
#include "min_cost_max_flow_utils.hpp"
@@ -29,8 +26,7 @@ typedef boost::adjacency_list< boost::listS, boost::vecS, boost::directedS,
node_t, edge_t >
Graph;
BOOST_AUTO_TEST_CASE(
using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test)
void using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test()
{
Graph g;
traits::vertex_descriptor s, t;
@@ -60,5 +56,11 @@ BOOST_AUTO_TEST_CASE(
.color_map(col)
.predecessor_map(pred));
BOOST_CHECK_EQUAL(flow_value, 4);
BOOST_TEST_EQ(flow_value, 4);
}
int main()
{
using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test();
return boost::report_errors();
}
+2 -1
View File
@@ -12,6 +12,7 @@
#include <fstream>
#include <sstream>
#include <vector>
#include <ctime>
#include <boost/lexical_cast.hpp>
#include <boost/random.hpp>
@@ -311,7 +312,7 @@ int main(int argc, char* argv[])
{
int vertices_to_create = 10;
int max_edges_per_vertex = 2;
std::size_t random_seed = time(0);
std::size_t random_seed = std::time(0);
if (argc > 1)
{
+1 -1
View File
@@ -90,7 +90,7 @@ void testScalability(unsigned numpts)
typedef set< simple_point< double >, cmpPnt< double > > PointSet;
typedef vector< Vertex > Container;
boost::mt19937 rng(time(0));
boost::mt19937 rng(std::time(0));
uniform_real<> range(0.01, (numpts * 2));
variate_generator< boost::mt19937&, uniform_real<> > pnt_gen(rng, range);
+93 -63
View File
@@ -20,7 +20,7 @@
#include <boost/graph/stoer_wagner_min_cut.hpp>
#include <boost/graph/property_maps/constant_property_map.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/tuple/tuple.hpp>
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS,
@@ -35,19 +35,6 @@ typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS >
std::string test_dir;
boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[])
{
if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " path-to-libs-graph-test"
<< std::endl;
throw boost::unit_test::framework::setup_error(
"Invalid command line arguments");
}
test_dir = argv[1];
return 0;
}
struct edge_t
{
unsigned long first;
@@ -55,7 +42,7 @@ struct edge_t
};
// the example from Stoer & Wagner (1997)
BOOST_AUTO_TEST_CASE(test0)
void test0()
{
edge_t edges[] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 0, 4 }, { 1, 4 },
{ 1, 5 }, { 2, 6 }, { 3, 6 }, { 3, 7 }, { 4, 5 }, { 5, 6 }, { 6, 7 } };
@@ -67,25 +54,25 @@ BOOST_AUTO_TEST_CASE(test0)
boost::associative_property_map< std::map< int, bool > > parities(parity);
int w
= boost::stoer_wagner_min_cut(g, weights, boost::parity_map(parities));
BOOST_CHECK_EQUAL(w, 4);
BOOST_TEST_EQ(w, 4);
const bool parity0 = get(parities, 0);
BOOST_CHECK_EQUAL(parity0, get(parities, 1));
BOOST_CHECK_EQUAL(parity0, get(parities, 4));
BOOST_CHECK_EQUAL(parity0, get(parities, 5));
BOOST_TEST_EQ(parity0, get(parities, 1));
BOOST_TEST_EQ(parity0, get(parities, 4));
BOOST_TEST_EQ(parity0, get(parities, 5));
const bool parity2 = get(parities, 2);
BOOST_CHECK_NE(parity0, parity2);
BOOST_CHECK_EQUAL(parity2, get(parities, 3));
BOOST_CHECK_EQUAL(parity2, get(parities, 6));
BOOST_CHECK_EQUAL(parity2, get(parities, 7));
BOOST_TEST_NE(parity0, parity2);
BOOST_TEST_EQ(parity2, get(parities, 3));
BOOST_TEST_EQ(parity2, get(parities, 6));
BOOST_TEST_EQ(parity2, get(parities, 7));
}
BOOST_AUTO_TEST_CASE(test1)
void test1()
{
{ // if only one vertex, can't run `boost::stoer_wagner_min_cut`
undirected_graph g;
add_vertex(g);
BOOST_CHECK_THROW(
BOOST_TEST_THROWS(
boost::stoer_wagner_min_cut(g, get(boost::edge_weight, g)),
boost::bad_graph);
}
@@ -107,15 +94,15 @@ BOOST_AUTO_TEST_CASE(test1)
assignments(assignment);
int w = boost::stoer_wagner_min_cut(g, weights,
boost::parity_map(parities).vertex_assignment_map(assignments));
BOOST_CHECK_EQUAL(w, 3);
BOOST_TEST_EQ(w, 3);
const bool parity2 = get(parities, 2), parity0 = get(parities, 0);
BOOST_CHECK_NE(parity2, parity0);
BOOST_CHECK_EQUAL(parity0, get(parities, 1));
BOOST_TEST_NE(parity2, parity0);
BOOST_TEST_EQ(parity0, get(parities, 1));
}
}
// example by Daniel Trebbien
BOOST_AUTO_TEST_CASE(test2)
void test2()
{
edge_t edges[] = { { 5, 2 }, { 0, 6 }, { 5, 6 }, { 3, 1 }, { 0, 1 },
{ 6, 3 }, { 4, 6 }, { 2, 4 }, { 5, 3 } };
@@ -126,19 +113,19 @@ BOOST_AUTO_TEST_CASE(test2)
boost::associative_property_map< std::map< int, bool > > parities(parity);
int w = boost::stoer_wagner_min_cut(
g, get(boost::edge_weight, g), boost::parity_map(parities));
BOOST_CHECK_EQUAL(w, 3);
BOOST_TEST_EQ(w, 3);
const bool parity2 = get(parities, 2);
BOOST_CHECK_EQUAL(parity2, get(parities, 4));
BOOST_TEST_EQ(parity2, get(parities, 4));
const bool parity5 = get(parities, 5);
BOOST_CHECK_NE(parity2, parity5);
BOOST_CHECK_EQUAL(parity5, get(parities, 3));
BOOST_CHECK_EQUAL(parity5, get(parities, 6));
BOOST_CHECK_EQUAL(parity5, get(parities, 1));
BOOST_CHECK_EQUAL(parity5, get(parities, 0));
BOOST_TEST_NE(parity2, parity5);
BOOST_TEST_EQ(parity5, get(parities, 3));
BOOST_TEST_EQ(parity5, get(parities, 6));
BOOST_TEST_EQ(parity5, get(parities, 1));
BOOST_TEST_EQ(parity5, get(parities, 0));
}
// example by Daniel Trebbien
BOOST_AUTO_TEST_CASE(test3)
void test3()
{
edge_t edges[] = { { 3, 4 }, { 3, 6 }, { 3, 5 }, { 0, 4 }, { 0, 1 },
{ 0, 6 }, { 0, 7 }, { 0, 5 }, { 0, 2 }, { 4, 1 }, { 1, 6 }, { 1, 5 },
@@ -151,19 +138,19 @@ BOOST_AUTO_TEST_CASE(test3)
boost::associative_property_map< std::map< int, bool > > parities(parity);
int w
= boost::stoer_wagner_min_cut(g, weights, boost::parity_map(parities));
BOOST_CHECK_EQUAL(w, 7);
BOOST_TEST_EQ(w, 7);
const bool parity1 = get(parities, 1);
BOOST_CHECK_EQUAL(parity1, get(parities, 5));
BOOST_TEST_EQ(parity1, get(parities, 5));
const bool parity0 = get(parities, 0);
BOOST_CHECK_NE(parity1, parity0);
BOOST_CHECK_EQUAL(parity0, get(parities, 2));
BOOST_CHECK_EQUAL(parity0, get(parities, 3));
BOOST_CHECK_EQUAL(parity0, get(parities, 4));
BOOST_CHECK_EQUAL(parity0, get(parities, 6));
BOOST_CHECK_EQUAL(parity0, get(parities, 7));
BOOST_TEST_NE(parity1, parity0);
BOOST_TEST_EQ(parity0, get(parities, 2));
BOOST_TEST_EQ(parity0, get(parities, 3));
BOOST_TEST_EQ(parity0, get(parities, 4));
BOOST_TEST_EQ(parity0, get(parities, 6));
BOOST_TEST_EQ(parity0, get(parities, 7));
}
BOOST_AUTO_TEST_CASE(test4)
void test4()
{
typedef boost::graph_traits<
undirected_unweighted_graph >::vertex_descriptor vertex_descriptor;
@@ -185,16 +172,42 @@ BOOST_AUTO_TEST_CASE(test4)
int w = boost::stoer_wagner_min_cut(g,
boost::make_constant_property< edge_descriptor >(weight_type(1)),
boost::vertex_assignment_map(assignments).parity_map(parities));
BOOST_CHECK_EQUAL(w, 2);
BOOST_TEST_EQ(w, 2);
const bool parity0 = get(parities, 0);
BOOST_CHECK_EQUAL(parity0, get(parities, 1));
BOOST_CHECK_EQUAL(parity0, get(parities, 4));
BOOST_CHECK_EQUAL(parity0, get(parities, 5));
BOOST_TEST_EQ(parity0, get(parities, 1));
BOOST_TEST_EQ(parity0, get(parities, 4));
BOOST_TEST_EQ(parity0, get(parities, 5));
const bool parity2 = get(parities, 2);
BOOST_CHECK_NE(parity0, parity2);
BOOST_CHECK_EQUAL(parity2, get(parities, 3));
BOOST_CHECK_EQUAL(parity2, get(parities, 6));
BOOST_CHECK_EQUAL(parity2, get(parities, 7));
BOOST_TEST_NE(parity0, parity2);
BOOST_TEST_EQ(parity2, get(parities, 3));
BOOST_TEST_EQ(parity2, get(parities, 6));
BOOST_TEST_EQ(parity2, get(parities, 7));
}
// Non regression test for github.com/boostorg/graph/issues/286
void test5()
{
edge_t edges[] = { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 1, 3 },
{ 2, 3 }, { 4, 5 }, { 4, 6 }, { 4, 7 }, { 5, 6 }, { 5, 7 }, { 6, 7 },
{ 0, 4 } };
weight_type ws[] = { 3, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 6 };
undirected_graph g(edges, edges + 13, ws, 8, 13);
weight_map_type weights = get(boost::edge_weight, g);
std::map< int, bool > parity;
boost::associative_property_map< std::map< int, bool > > parities(parity);
int w
= boost::stoer_wagner_min_cut(g, weights, boost::parity_map(parities));
BOOST_TEST_EQ(w, 6);
const bool parity0 = get(parities, 0);
BOOST_TEST_EQ(parity0, get(parities, 1));
BOOST_TEST_EQ(parity0, get(parities, 2));
BOOST_TEST_EQ(parity0, get(parities, 3));
const bool parity4 = get(parities, 4);
BOOST_TEST_NE(parity0, parity4);
BOOST_TEST_EQ(parity4, get(parities, 5));
BOOST_TEST_EQ(parity4, get(parities, 6));
BOOST_TEST_EQ(parity4, get(parities, 7));
}
// The input for the `test_prgen` family of tests comes from a program, named
@@ -210,7 +223,7 @@ BOOST_AUTO_TEST_CASE(test4)
// weight of the min-cut is verified.
// 3 min-cuts
BOOST_AUTO_TEST_CASE(test_prgen_20_70_2)
void test_prgen_20_70_2()
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -225,7 +238,7 @@ BOOST_AUTO_TEST_CASE(test_prgen_20_70_2)
boost::associative_property_map<
std::map< vertex_descriptor, std::size_t > >
components(component);
BOOST_CHECK_EQUAL(boost::connected_components(g, components),
BOOST_TEST_EQ(boost::connected_components(g, components),
1U); // verify the connectedness assumption
typedef boost::shared_array_property_map< weight_type,
@@ -247,11 +260,11 @@ BOOST_AUTO_TEST_CASE(test_prgen_20_70_2)
int w = boost::stoer_wagner_min_cut(
g, get(boost::edge_weight, g), boost::max_priority_queue(pq));
BOOST_CHECK_EQUAL(w, 3407);
BOOST_TEST_EQ(w, 3407);
}
// 7 min-cuts
BOOST_AUTO_TEST_CASE(test_prgen_50_40_2)
void test_prgen_50_40_2()
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -266,15 +279,15 @@ BOOST_AUTO_TEST_CASE(test_prgen_50_40_2)
boost::associative_property_map<
std::map< vertex_descriptor, std::size_t > >
components(component);
BOOST_CHECK_EQUAL(boost::connected_components(g, components),
BOOST_TEST_EQ(boost::connected_components(g, components),
1U); // verify the connectedness assumption
int w = boost::stoer_wagner_min_cut(g, get(boost::edge_weight, g));
BOOST_CHECK_EQUAL(w, 10056);
BOOST_TEST_EQ(w, 10056);
}
// 6 min-cuts
BOOST_AUTO_TEST_CASE(test_prgen_50_70_2)
void test_prgen_50_70_2()
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -289,9 +302,26 @@ BOOST_AUTO_TEST_CASE(test_prgen_50_70_2)
boost::associative_property_map<
std::map< vertex_descriptor, std::size_t > >
components(component);
BOOST_CHECK_EQUAL(boost::connected_components(g, components),
BOOST_TEST_EQ(boost::connected_components(g, components),
1U); // verify the connectedness assumption
int w = boost::stoer_wagner_min_cut(g, get(boost::edge_weight, g));
BOOST_CHECK_EQUAL(w, 21755);
BOOST_TEST_EQ(w, 21755);
}
int main(int argc, char* argv[])
{
if (BOOST_TEST(argc == 2))
{
test_dir = argv[1];
test0();
test1();
test2();
test3();
test4();
test5();
test_prgen_20_70_2();
test_prgen_50_70_2();
}
return boost::report_errors();
}
+78 -81
View File
@@ -10,13 +10,11 @@
*
*/
#define BOOST_TEST_MODULE subgraph_add
// std lib includes
#include <iostream>
// include boost components
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/iteration_macros.hpp>
@@ -25,11 +23,8 @@
using namespace boost;
BOOST_AUTO_TEST_CASE(simpleGraph)
void simpleGraphTest()
{
BOOST_TEST_MESSAGE("simple subgraph");
typedef subgraph< adjacency_list< vecS, vecS, directedS, no_property,
property< edge_index_t, int > > >
Graph;
@@ -50,8 +45,8 @@ BOOST_AUTO_TEST_CASE(simpleGraph)
Graph& G1 = G0.create_subgraph();
Graph& G2 = G1.create_subgraph();
BOOST_CHECK(&G1.parent() == &G0);
BOOST_CHECK(&G2.parent() == &G1);
BOOST_TEST(&G1.parent() == &G0);
BOOST_TEST(&G2.parent() == &G1);
enum
{
@@ -73,10 +68,10 @@ BOOST_AUTO_TEST_CASE(simpleGraph)
add_vertex(C, G2); // global vertex C becomes local A2 for G2
add_vertex(E, G2); // global vertex E becomes local B2 for G2
BOOST_CHECK(num_vertices(G0) == 6);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G0) == 6);
BOOST_TEST(num_vertices(G1) == 3);
std::cerr << num_vertices(G1) << std::endl;
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G2) == 2);
// add edges to root graph
add_edge(A, B, G0);
@@ -84,26 +79,23 @@ BOOST_AUTO_TEST_CASE(simpleGraph)
add_edge(B, D, G0);
add_edge(E, F, G0);
BOOST_CHECK(num_edges(G0) == 4);
BOOST_CHECK(num_edges(G1) == 1);
BOOST_CHECK(num_edges(G2) == 0);
BOOST_TEST(num_edges(G0) == 4);
BOOST_TEST(num_edges(G1) == 1);
BOOST_TEST(num_edges(G2) == 0);
// add edges to G1
add_edge(A1, B1, G1);
BOOST_CHECK(num_edges(G0) == 5);
BOOST_CHECK(num_edges(G1) == 2);
BOOST_CHECK(num_edges(G2) == 1);
BOOST_TEST(num_edges(G0) == 5);
BOOST_TEST(num_edges(G1) == 2);
BOOST_TEST(num_edges(G2) == 1);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 6);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 6);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 2);
}
BOOST_AUTO_TEST_CASE(addVertices)
void addVerticesTest()
{
BOOST_TEST_MESSAGE("subgraph add edges");
typedef subgraph< adjacency_list< vecS, vecS, directedS, no_property,
property< edge_index_t, int > > >
Graph;
@@ -114,8 +106,8 @@ BOOST_AUTO_TEST_CASE(addVertices)
Graph& G1 = G0.create_subgraph();
Graph& G2 = G1.create_subgraph();
BOOST_CHECK(&G1.parent() == &G0);
BOOST_CHECK(&G2.parent() == &G1);
BOOST_TEST(&G1.parent() == &G0);
BOOST_TEST(&G2.parent() == &G1);
// add vertices to G2
Vertex n1 = add_vertex(0, G2);
@@ -123,7 +115,7 @@ BOOST_AUTO_TEST_CASE(addVertices)
// check if the global vertex 2 is equal to the returned local vertex
if (G2.find_vertex(0).second)
{
BOOST_CHECK(G2.find_vertex(0).first == n1);
BOOST_TEST(G2.find_vertex(0).first == n1);
}
else
{
@@ -131,7 +123,7 @@ BOOST_AUTO_TEST_CASE(addVertices)
}
if (G2.find_vertex(1).second)
{
BOOST_CHECK(G2.find_vertex(1).first == n2);
BOOST_TEST(G2.find_vertex(1).first == n2);
}
else
{
@@ -140,7 +132,7 @@ BOOST_AUTO_TEST_CASE(addVertices)
// and check if this vertex is also present in G1
if (G1.find_vertex(0).second)
{
BOOST_CHECK(G1.local_to_global(G1.find_vertex(0).first) == 0);
BOOST_TEST(G1.local_to_global(G1.find_vertex(0).first) == 0);
}
else
{
@@ -148,7 +140,7 @@ BOOST_AUTO_TEST_CASE(addVertices)
}
if (G1.find_vertex(0).second)
{
BOOST_CHECK(G1.local_to_global(G1.find_vertex(1).first) == 1);
BOOST_TEST(G1.local_to_global(G1.find_vertex(1).first) == 1);
}
else
{
@@ -156,50 +148,50 @@ BOOST_AUTO_TEST_CASE(addVertices)
}
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
// add vertices to G1
Vertex n3 = add_vertex(2, G1);
// check if the global vertex 2 is equal to the returned local vertex
if (G1.find_vertex(2).second)
{
BOOST_CHECK(G1.find_vertex(2).first == n3);
BOOST_TEST(G1.find_vertex(2).first == n3);
}
else
{
BOOST_ERROR("vertex not found!");
}
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 2);
// add vertices to G1
Vertex n4 = add_vertex(G1);
// check if the new local vertex is also in the global graph
BOOST_CHECK(G0.find_vertex(G1.local_to_global(n4)).second);
BOOST_TEST(G0.find_vertex(G1.local_to_global(n4)).second);
// check if the new local vertex is not in the subgraphs
BOOST_CHECK(!G2.find_vertex(n4).second);
BOOST_TEST(!G2.find_vertex(n4).second);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 4);
BOOST_CHECK(num_vertices(G1) == 4);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 4);
BOOST_TEST(num_vertices(G1) == 4);
BOOST_TEST(num_vertices(G2) == 2);
// add vertices to G0
Vertex n5 = add_vertex(G0);
// check if the new local vertex is not in the subgraphs
BOOST_CHECK(!G1.find_vertex(n5).second);
BOOST_CHECK(!G2.find_vertex(n5).second);
BOOST_TEST(!G1.find_vertex(n5).second);
BOOST_TEST(!G2.find_vertex(n5).second);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 5);
BOOST_CHECK(num_vertices(G1) == 4);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 5);
BOOST_TEST(num_vertices(G1) == 4);
BOOST_TEST(num_vertices(G2) == 2);
typedef std::map< graph_traits< Graph::graph_type >::vertex_descriptor,
graph_traits< Graph::graph_type >::vertex_descriptor >::iterator v_itr;
@@ -221,11 +213,8 @@ BOOST_AUTO_TEST_CASE(addVertices)
}
}
BOOST_AUTO_TEST_CASE(addEdge)
void addEdgeTest()
{
BOOST_TEST_MESSAGE("subgraph add edges");
typedef subgraph< adjacency_list< vecS, vecS, directedS, no_property,
property< edge_index_t, int > > >
Graph;
@@ -236,59 +225,59 @@ BOOST_AUTO_TEST_CASE(addEdge)
Graph& G1 = G0.create_subgraph();
Graph& G2 = G1.create_subgraph();
BOOST_CHECK(&G1.parent() == &G0);
BOOST_CHECK(&G2.parent() == &G1);
BOOST_TEST(&G1.parent() == &G0);
BOOST_TEST(&G2.parent() == &G1);
// add vertices
add_vertex(0, G2);
add_vertex(1, G2);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
// add edge to G0 which needs propagation
add_edge(0, 1, G0);
BOOST_CHECK(num_edges(G0) == 1);
BOOST_CHECK(num_edges(G1) == 1);
BOOST_CHECK(num_edges(G2) == 1);
BOOST_TEST(num_edges(G0) == 1);
BOOST_TEST(num_edges(G1) == 1);
BOOST_TEST(num_edges(G2) == 1);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
// add edge to G0 without propagation
add_edge(1, 2, G0);
BOOST_CHECK(num_edges(G0) == 2);
BOOST_CHECK(num_edges(G1) == 1);
BOOST_CHECK(num_edges(G2) == 1);
BOOST_TEST(num_edges(G0) == 2);
BOOST_TEST(num_edges(G1) == 1);
BOOST_TEST(num_edges(G2) == 1);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
// add vertex 2 to G2/G1 with edge propagation
Vertex n = add_vertex(2, G2);
BOOST_CHECK(G2.local_to_global(n) == 2);
BOOST_TEST(G2.local_to_global(n) == 2);
BOOST_CHECK(num_edges(G0) == 2);
BOOST_CHECK(num_edges(G1) == 2);
BOOST_CHECK(num_edges(G2) == 2);
BOOST_TEST(num_edges(G0) == 2);
BOOST_TEST(num_edges(G1) == 2);
BOOST_TEST(num_edges(G2) == 2);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 3);
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 3);
// add edge to G2 with propagation upwards
add_edge(0, 2, G2);
BOOST_CHECK(num_edges(G0) == 3);
BOOST_CHECK(num_edges(G1) == 3);
BOOST_CHECK(num_edges(G2) == 3);
BOOST_TEST(num_edges(G0) == 3);
BOOST_TEST(num_edges(G1) == 3);
BOOST_TEST(num_edges(G2) == 3);
// num_vertices stays the same
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 3);
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 3);
typedef std::map< graph_traits< Graph::graph_type >::vertex_descriptor,
graph_traits< Graph::graph_type >::vertex_descriptor >::iterator v_itr;
@@ -324,3 +313,11 @@ BOOST_AUTO_TEST_CASE(addEdge)
std::cerr << source(e, G2) << "->" << target(e, G2) << std::endl;
}
}
int main()
{
simpleGraphTest();
addVerticesTest();
addEdgeTest();
return boost::report_errors();
}
@@ -7,16 +7,14 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#define BOOST_TEST_MODULE successive_shortest_path_nonnegative_weights_test
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>
#include "min_cost_max_flow_utils.hpp"
BOOST_AUTO_TEST_CASE(path_augmentation_def_test)
void path_augmentation_def_test()
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -25,10 +23,10 @@ BOOST_AUTO_TEST_CASE(path_augmentation_def_test)
boost::successive_shortest_path_nonnegative_weights(g, s, t);
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 29);
BOOST_TEST_EQ(cost, 29);
}
BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
void path_augmentation_def_test2()
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -37,10 +35,10 @@ BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
boost::successive_shortest_path_nonnegative_weights(g, s, t);
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 7);
BOOST_TEST_EQ(cost, 7);
}
BOOST_AUTO_TEST_CASE(path_augmentation_test)
void path_augmentation_test()
{
boost::SampleGraph::vertex_descriptor s, t;
typedef boost::SampleGraph::Graph Graph;
@@ -66,5 +64,13 @@ BOOST_AUTO_TEST_CASE(path_augmentation_test)
.vertex_index_map(idx));
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 29);
BOOST_TEST_EQ(cost, 29);
}
int main()
{
path_augmentation_def_test();
path_augmentation_def_test2();
path_augmentation_test();
return boost::report_errors();
}