Compare commits

..

1 Commits

Author SHA1 Message Date
Louis Dionne e63940fea1 [hawick] Support passing std::reference_wrapper to boost::hawick_circuits
Reported as ldionne/hawick_circuits#1.
2021-04-14 16:25:43 -04:00
56 changed files with 856 additions and 996 deletions
-164
View File
@@ -1,164 +0,0 @@
# 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 03", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '03', }, 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),
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),
osx_cxx("XCode-7.3 14", "clang++", packages="", buildtype="boost", xcode_version="7.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
osx_cxx("XCode-7.3 1z", "clang++", packages="", buildtype="boost", xcode_version="7.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '1z', }, 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
@@ -1,3 +0,0 @@
#!/bin/bash
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
-42
View File
@@ -1,42 +0,0 @@
#!/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
-223
View File
@@ -1,223 +0,0 @@
# 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:
compiler: [ g++-9, g++-10, 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 g++-10 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-latest
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-latest
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
+334
View File
@@ -0,0 +1,334 @@
# 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
@@ -1,80 +0,0 @@
# 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()
+5 -5
View File
@@ -1,5 +1,4 @@
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)
Boost Graph Library [![Build Status](https://travis-ci.org/boostorg/graph.svg?branch=develop)](https://travis-ci.org/boostorg/graph)
===================
A generic interface for traversing graphs, using C++ templates.
@@ -15,7 +14,7 @@ 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)
* 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).
@@ -26,8 +25,9 @@ There is no mailing-list specific to Boost Graph, although you can use the gener
| | 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) |
| Travis | [![Build Status](https://travis-ci.org/boostorg/graph.svg?branch=master)](https://travis-ci.org/boostorg/graph) | [![Build Status](https://travis-ci.org/boostorg/graph.svg)](https://travis-ci.org/boostorg/graph) |
| Appveyor | [![Build status](https://ci.appveyor.com/api/projects/status/78gegk21tc1g3v8d/branch/master?svg=true)](https://ci.appveyor.com/project/jzmaddock/graph/branch/master) | [![Build status](https://ci.appveyor.com/api/projects/status/78gegk21tc1g3v8d/branch/develop?svg=true)](https://ci.appveyor.com/project/jzmaddock/graph/branch/develop) |
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)):
+64
View File
@@ -0,0 +1,64 @@
# 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 an interface for efficient access
The AdjacencyGraph concept provides and 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
+21 -20
View File
@@ -69,6 +69,7 @@ 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>
@@ -102,16 +103,17 @@ 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>
@@ -134,7 +136,7 @@ Example of an undirected graph.</CAPTION>
<P>
Now for some more graph terminology. If some edge <i>(u,v)</i> is in
graph <i>G</i>, then vertex <i>v</i> is <a
graph , 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
@@ -173,7 +175,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 vertices in the path are the same. A graph with no cycles
first and last vertex in the path are the same. A graph with no cycles
is <a name="def:acyclic"><I>acyclic</I></a>.
<P>
@@ -351,12 +353,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 <i>s</i> are visited, we visit the
neighbors of <i>s</i>). Once both neighbors of 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
@@ -402,8 +404,7 @@ 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>
@@ -423,7 +424,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 i h g
order of finish: d f c e b a
parenthesis: (a (b (e (d d) (c (f f) c) e) b) a) (g (h (i i) h) g)
</PRE>
@@ -441,7 +442,8 @@ 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>.
<!--
@@ -478,7 +480,7 @@ of a path</I><BR>
<p></p>
<DIV ALIGN="left">
<i>w(p) = sum of w(v<sub>i-1</sub>,v<sub>i</sub>) for i=1..k</i>
<i>w(p) = sum from i=1..k of w(v<sub>i-1</sub>,v<sub>i</sub>)</i>
</DIV>
<BR CLEAR="ALL"><P></P>
@@ -493,7 +495,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 whose path weight is equal to the
A <I>shortest path</I> is any path who's path weight is equal to the
<I>shortest path weight</I>.
<P>
@@ -507,12 +509,12 @@ problem that are asymptotically faster than algorithms that solve the
single-source problem.
<P>
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
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
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>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
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
result of a single-source algorithm is a shortest-paths tree.
<P>
@@ -530,7 +532,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 v in V - {s,t}</i> (Flow conservation)
<i>sum<sub>v in V</sub> f(u,v) = 0 for all u in V - {s,t}</i> (Flow conservation)
<p>
The <b><i>flow</i></b> of the network is the net flow entering the
@@ -551,8 +553,7 @@ 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>
+4
View File
@@ -49,6 +49,10 @@ edges are not desired.</p>
<p>For example, if a circuit <code>u -&gt; v -&gt; w -&gt; u</code> exists in the graph, the
visitor will be called with a sequence consisting of <code>(u, v, w)</code>.</p>
Note that if <code>visitor</code> is a <code>std::reference_wrapper</code>,
it will be unwrapped before the <code>.cycle</code> method being called on it.
This allows passing a visitor that shouldn't be copied.
</blockquote>
<p><strong>IN:</strong> <code>VertexIndexMap const&amp; vim = get(vertex_index, graph)</code></p>
+1 -1
View File
@@ -17,7 +17,7 @@
alt="C++ Boost" width="277" height="86">
<h1>The Boost Graph Library (BGL)
<a href="https://www.informit.com/store/boost-graph-library-user-guide-and-reference-manual-9780132651837">
<a href="http://www.awprofessional.com/title/0201729148">
<img src="bgl-cover.jpg" alt="BGL Book" align="RIGHT"></a>
</h1>
+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="https://www.informit.com/store/boost-graph-library-user-guide-and-reference-manual-9780132651837">
<a href="http://www.awprofessional.com/title/0201729148">
<img src="bgl-cover.jpg" ALT="BGL Book" ALIGN="RIGHT"></a>
</h1>
+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 : [ 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 ] ;
exe fr_layout : fr_layout.cpp ;
run gerdemann.cpp ;
run graph.cpp ;
run graph_as_tree.cpp ;
-4
View File
@@ -20,11 +20,7 @@ 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 >
+19 -21
View File
@@ -7,7 +7,7 @@
// Author: Douglas Gregor
#include <boost/graph/graphviz.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/test/minimal.hpp>
#include <string>
#include <fstream>
#include <boost/graph/iteration_macros.hpp>
@@ -25,18 +25,16 @@ typedef boost::adjacency_list< vecS, vecS, undirectedS,
void test_graph_read_write(const std::string& filename)
{
std::ifstream in(filename.c_str());
if (!BOOST_TEST(in)) {
return;
}
BOOST_REQUIRE(in);
Graph g;
dynamic_properties dp;
dp.property("id", get(vertex_name, g));
dp.property("weight", get(edge_weight, g));
BOOST_TEST(read_graphviz(in, g, dp, "id"));
BOOST_CHECK(read_graphviz(in, g, dp, "id"));
BOOST_TEST(num_vertices(g) == 4);
BOOST_TEST(num_edges(g) == 4);
BOOST_CHECK(num_vertices(g) == 4);
BOOST_CHECK(num_edges(g) == 4);
typedef graph_traits< Graph >::vertex_descriptor Vertex;
@@ -45,27 +43,27 @@ void test_graph_read_write(const std::string& filename)
name_to_vertex[get(vertex_name, g, v)] = v;
// Check vertices
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());
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());
// Check edges
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(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(get(edge_weight, g,
BOOST_CHECK(get(edge_weight, g,
edge(name_to_vertex["0"], name_to_vertex["1"], g).first)
== 3.14159);
BOOST_TEST(get(edge_weight, g,
BOOST_CHECK(get(edge_weight, g,
edge(name_to_vertex["1"], name_to_vertex["foo"], g).first)
== 2.71828);
BOOST_TEST(get(edge_weight, g,
BOOST_CHECK(get(edge_weight, g,
edge(name_to_vertex["foo"], name_to_vertex["bar"], g).first)
== 10.0);
BOOST_TEST(get(edge_weight, g,
BOOST_CHECK(get(edge_weight, g,
edge(name_to_vertex["1"], name_to_vertex["bar"], g).first)
== 10.0);
@@ -73,9 +71,9 @@ void test_graph_read_write(const std::string& filename)
write_graphviz_dp(std::cout, g, dp, std::string("id"));
}
int main(int argc, char* argv[])
int test_main(int argc, char* argv[])
{
test_graph_read_write(argc >= 2 ? argv[1] : "graphviz_example.dot");
return boost::report_errors();
return 0;
}
+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 <iterator>
#include <boost/detail/iterator.hpp>
#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 std::iterator_traits< OutEdgeIter >::difference_type
typename boost::detail::iterator_traits< OutEdgeIter >::difference_type
difference_type;
public:
@@ -81,7 +81,7 @@ template < class Graph,
class inv_adjacency_iterator_generator
{
typedef
typename std::iterator_traits< InEdgeIter >::difference_type
typename boost::detail::iterator_traits< InEdgeIter >::difference_type
difference_type;
public:
+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
= *boost::first_max_element(edges_iters.first, edges_iters.second, cmp);
= *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,6 +20,7 @@
#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
{
+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,7 +21,6 @@
#include <boost/range/irange.hpp>
#include <boost/graph/graph_traits.hpp>
#include <memory>
#include <iterator>
#include <algorithm>
#include <boost/limits.hpp>
@@ -2371,7 +2370,7 @@ namespace detail
typedef typename OutEdgeList::size_type degree_size_type;
typedef typename OutEdgeList::iterator OutEdgeIter;
typedef std::iterator_traits< OutEdgeIter >
typedef boost::detail::iterator_traits< OutEdgeIter >
OutEdgeIterTraits;
typedef
typename OutEdgeIterTraits::iterator_category OutEdgeIterCat;
@@ -2399,7 +2398,7 @@ namespace detail
// Edge Iterator
typedef std::iterator_traits< EdgeIter > EdgeIterTraits;
typedef boost::detail::iterator_traits< EdgeIter > EdgeIterTraits;
typedef typename EdgeIterTraits::iterator_category EdgeIterCat;
typedef typename EdgeIterTraits::difference_type EdgeIterDiff;
@@ -21,6 +21,7 @@
#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
+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
+12 -12
View File
@@ -18,6 +18,7 @@
#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>
@@ -26,7 +27,6 @@
#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;
}
~parse_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE { return statement.c_str(); }
virtual ~parse_error() throw() {}
virtual const char* what() const throw() { return statement.c_str(); }
std::string statement;
std::string error;
};
@@ -84,16 +84,16 @@ public:
{
}
bool is_directed() const BOOST_OVERRIDE
bool is_directed() const
{
return is_convertible<
typename graph_traits< MutableGraph >::directed_category,
directed_tag >::value;
}
any do_add_vertex() BOOST_OVERRIDE { return any(add_vertex(m_g)); }
virtual any do_add_vertex() { return any(add_vertex(m_g)); }
std::pair< any, bool > do_add_edge(any source, any target) BOOST_OVERRIDE
virtual std::pair< any, bool > do_add_edge(any source, any target)
{
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);
}
void set_graph_property(const std::string& name,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
virtual void set_graph_property(const std::string& name,
const std::string& value, const std::string& value_type)
{
bool type_found = false;
try
@@ -123,8 +123,8 @@ public:
}
}
void set_vertex_property(const std::string& name, any vertex,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
virtual void set_vertex_property(const std::string& name, any vertex,
const std::string& value, const std::string& value_type)
{
bool type_found = false;
try
@@ -146,8 +146,8 @@ public:
}
}
void set_edge_property(const std::string& name, any edge,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
virtual void set_edge_property(const std::string& name, any edge,
const std::string& value, const std::string& value_type)
{
bool type_found = false;
try
+38 -40
View File
@@ -11,11 +11,11 @@
#define BOOST_GRAPHVIZ_HPP
#include <boost/config.hpp>
#include <cstdio> // for FILE
#include <fstream>
#include <iostream>
#include <map>
#include <string>
#include <map>
#include <iostream>
#include <fstream>
#include <stdio.h> // for FILE
#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
{
~graph_exception() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE = 0;
virtual ~graph_exception() throw() {}
virtual const char* what() const throw() = 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
{
}
~bad_parallel_edge() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
virtual ~bad_parallel_edge() throw() {}
const char* what() const throw()
{
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
{
~directed_graph_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
virtual ~directed_graph_error() throw() {}
virtual const char* what() const throw()
{
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
{
~undirected_graph_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
virtual ~undirected_graph_error() throw() {}
virtual const char* what() const throw()
{
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() BOOST_OVERRIDE { return errmsg.c_str(); }
~bad_graphviz_syntax() throw() BOOST_OVERRIDE {}
const char* what() const throw() { return errmsg.c_str(); }
~bad_graphviz_syntax() throw() {};
};
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() BOOST_OVERRIDE {}
~mutate_graph_impl() {}
bool is_directed() const BOOST_OVERRIDE
bool is_directed() const
{
return boost::is_convertible<
typename boost::graph_traits<
@@ -784,7 +784,7 @@ namespace detail
boost::directed_tag >::value;
}
void do_add_vertex(const node_t& node) BOOST_OVERRIDE
virtual void do_add_vertex(const node_t& node)
{
// 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) BOOST_OVERRIDE
void do_add_edge(
const edge_t& edge, const node_t& source, const node_t& target)
{
std::pair< bgl_edge_t, bool > result
= add_edge(bgl_nodes[source], bgl_nodes[target], graph_);
@@ -814,26 +814,25 @@ namespace detail
}
}
void set_node_property(const id_t& key, const node_t& node,
const id_t& value) BOOST_OVERRIDE
void set_node_property(
const id_t& key, const node_t& node, const id_t& value)
{
put(key, dp_, bgl_nodes[node], value);
}
void set_edge_property(const id_t& key, const edge_t& edge,
const id_t& value) BOOST_OVERRIDE
void set_edge_property(
const id_t& key, const edge_t& edge, const id_t& value)
{
put(key, dp_, bgl_edges[edge], value);
}
void set_graph_property(const id_t& key,
const id_t& value) BOOST_OVERRIDE
void set_graph_property(const id_t& key, const id_t& value)
{
/* RG: pointer to graph prevents copying */
put(key, dp_, &graph_, value);
}
void finish_building_graph() BOOST_OVERRIDE {}
void finish_building_graph() {}
protected:
MutableGraph& graph_;
@@ -870,9 +869,9 @@ namespace detail
{
}
~mutate_graph_impl() BOOST_OVERRIDE {}
~mutate_graph_impl() {}
void finish_building_graph() BOOST_OVERRIDE
void finish_building_graph()
{
typedef compressed_sparse_row_graph< directedS, no_property,
bgl_edge_t, GraphProperty, Vertex, EdgeIndex >
@@ -903,14 +902,14 @@ namespace detail
}
}
bool is_directed() const BOOST_OVERRIDE
bool is_directed() const
{
return boost::is_convertible<
typename boost::graph_traits< CSRGraph >::directed_category,
boost::directed_tag >::value;
}
void do_add_vertex(const node_t& node) BOOST_OVERRIDE
virtual void do_add_vertex(const node_t& node)
{
// Add the node to the graph.
bgl_vertex_t v = vertex_count++;
@@ -924,8 +923,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) BOOST_OVERRIDE
void do_add_edge(
const edge_t& edge, const node_t& source, const node_t& target)
{
bgl_edge_t result = edges_to_add.size();
edges_to_add.push_back(
@@ -933,22 +932,21 @@ 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) BOOST_OVERRIDE
void set_node_property(
const id_t& key, const node_t& node, const id_t& value)
{
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) BOOST_OVERRIDE
void set_edge_property(
const id_t& key, const edge_t& edge, const id_t& value)
{
edge_props.push_back(
boost::make_tuple(key, bgl_edges[edge], value));
}
void set_graph_property(const id_t& key,
const id_t& value) BOOST_OVERRIDE
void set_graph_property(const id_t& key, const id_t& value)
{
/* RG: pointer to graph prevents copying */
put(key, dp_, &graph_, value);
@@ -1027,6 +1025,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,6 +15,7 @@
#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>
+15 -1
View File
@@ -21,6 +21,7 @@
#include <boost/tuple/tuple.hpp> // for boost::tie
#include <boost/type_traits/remove_reference.hpp>
#include <boost/utility/result_of.hpp>
#include <functional> // for std::reference_wrapper
#include <set>
#include <utility> // for std::pair
#include <vector>
@@ -89,6 +90,18 @@ namespace hawick_circuits_detail
return std::find(boost::begin(c), boost::end(c), v) != boost::end(c);
}
template < typename T >
struct unwrap_reference_wrapper {
typedef T type;
};
#if __cplusplus >= 201103L
template < typename T >
struct unwrap_reference_wrapper<std::reference_wrapper<T> > {
typedef T& type;
};
#endif
/*!
* @internal
* Algorithm finding all the cycles starting from a given vertex.
@@ -301,8 +314,9 @@ namespace hawick_circuits_detail
typedef std::vector< Vertex > Stack;
typedef std::vector< std::vector< Vertex > > ClosedMatrix;
typedef typename unwrap_reference_wrapper<Visitor>::type VisitorNoRef;
typedef hawick_circuits_from< Graph, Visitor, VertexIndexMap, Stack,
typedef hawick_circuits_from< Graph, VisitorNoRef, VertexIndexMap, Stack,
ClosedMatrix, GetAdjacentVertices >
SubAlgorithm;
+2 -9
View File
@@ -10,11 +10,9 @@
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <limits>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/bind.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/concept_check.hpp>
@@ -23,7 +21,6 @@
#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.
@@ -241,11 +238,9 @@ 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
= boost::first_max_element(oei, oeie,
= std::max_element(oei, oeie,
boost::bind(m_cmp,
boost::bind(&EdgeWeight1::operator[], m_ew1m, _1),
boost::bind(&EdgeWeight1::operator[], m_ew1m, _2)));
@@ -356,8 +351,6 @@ 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/tuple/tuple.hpp>
#include <boost/detail/iterator.hpp>
#include <boost/graph/detail/incremental_components.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/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 std::iterator_traits< ParentIterator >::difference_type
typename boost::detail::iterator_traits< ParentIterator >::difference_type
component_count(ParentIterator first, ParentIterator last)
{
std::ptrdiff_t count = 0;
-7
View File
@@ -11,12 +11,7 @@
#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>
@@ -49,8 +44,6 @@ 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
+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
+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
+2 -11
View File
@@ -13,7 +13,7 @@
#include <algorithm> // for std::min and std::max
#include <functional>
#include <boost/config.hpp>
#include <boost/bind/bind.hpp>
#include <boost/bind.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/topological_sort.hpp>
#include <boost/graph/graph_concepts.hpp>
@@ -131,8 +131,6 @@ 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);
@@ -158,16 +156,9 @@ 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::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
std::not1(detail::subscript(in_a_chain)));
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
+2 -1
View File
@@ -6,7 +6,8 @@
// 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
+1 -2
View File
@@ -12,6 +12,5 @@
],
"maintainers": [
"K. Noel Belcourt <kbelco -at- sandia.gov>"
],
"cxxstd": "03"
]
}
+2 -5
View File
@@ -18,9 +18,6 @@
#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;
@@ -165,8 +162,8 @@ public:
std::string local_directed
= edge.second.get(path("<xmlattr>/directed"), "");
bool is_directed
= (local_directed.empty() ? default_directed
: local_directed == "true");
= (local_directed == "" ? default_directed
: local_directed == "true");
if (is_directed != m_g.is_directed())
{
if (is_directed)
+6 -7
View File
@@ -33,18 +33,19 @@
#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>
@@ -333,8 +334,6 @@ 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 "
@@ -828,7 +827,7 @@ namespace read_graphviz_detail
get();
if (peek().type != token::identifier)
error("Wanted identifier as port angle");
if (!id.angle.empty())
if (id.angle != "")
error("Duplicate port angle");
id.angle = get().normalized_value;
goto parse_more;
+10 -10
View File
@@ -9,7 +9,6 @@
import modules ;
import path ;
import ../../config/checks/config : requires ;
path-constant TEST_DIR : . ;
@@ -70,11 +69,12 @@ 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 : : : [ 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 gursoy_atun_layout_test.cpp ]
[ run layout_test.cpp : : : <test-info>always_show_run_output <toolset>intel:<debug-symbols>off ]
[ 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_DIR) ]
[ run subgraph_add.cpp ../../test/build//boost_unit_test_framework/<link>static : $(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_DIR) ]
[ run stoer_wagner_test.cpp : $(TEST_DIR) ]
[ 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) ]
[ 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 ]
[ run cycle_canceling_test.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 strong_components_test.cpp ]
[ run find_flow_cost_bundled_properties_and_named_params_test.cpp ]
[ run max_flow_algorithms_bundled_properties_and_named_params.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 delete_edge.cpp ]
[ run johnson-test.cpp ]
[ run lvalue_pmap.cpp ]
+9 -15
View File
@@ -7,14 +7,16 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <boost/core/lightweight_test.hpp>
#define BOOST_TEST_MODULE cycle_canceling_test
#include <boost/test/unit_test.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/edmonds_karp_max_flow.hpp>
#include "min_cost_max_flow_utils.hpp"
void cycle_canceling_def_test()
BOOST_AUTO_TEST_CASE(cycle_canceling_def_test)
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -24,10 +26,10 @@ void cycle_canceling_def_test()
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
BOOST_TEST_EQ(cost, 29);
BOOST_CHECK_EQUAL(cost, 29);
}
void path_augmentation_def_test2()
BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -37,10 +39,10 @@ void path_augmentation_def_test2()
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
BOOST_TEST_EQ(cost, 7);
BOOST_CHECK_EQUAL(cost, 7);
}
void cycle_canceling_test()
BOOST_AUTO_TEST_CASE(cycle_canceling_test)
{
boost::SampleGraph::vertex_descriptor s, t;
typedef boost::SampleGraph::Graph Graph;
@@ -64,13 +66,5 @@ void cycle_canceling_test()
.vertex_index_map(idx));
int cost = boost::find_flow_cost(g);
BOOST_TEST_EQ(cost, 29);
}
int main()
{
cycle_canceling_def_test();
path_augmentation_def_test2();
cycle_canceling_test();
return boost::report_errors();
BOOST_CHECK_EQUAL(cost, 29);
}
@@ -1,4 +1,7 @@
#include <boost/core/lightweight_test.hpp>
#define BOOST_TEST_MODULE \
find_flow_cost_bundled_properties_and_named_params_test
#include <boost/test/unit_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"
@@ -26,7 +29,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
void using_bundled_properties_with_find_max_flow_test()
BOOST_AUTO_TEST_CASE(using_bundled_properties_with_find_max_flow_test)
{
Graph g;
traits::vertex_descriptor s, t;
@@ -56,12 +59,13 @@ void 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_TEST_EQ(flow_cost, 29);
BOOST_CHECK_EQUAL(flow_cost, 29);
}
// Unit test written in order to fails (at compile time) if the find_flow_cost()
// is not properly handling bundled properties
void using_named_params_and_bundled_properties_with_find_max_flow_test()
BOOST_AUTO_TEST_CASE(
using_named_params_and_bundled_properties_with_find_max_flow_test)
{
Graph g;
traits::vertex_descriptor s, t;
@@ -95,12 +99,5 @@ void using_named_params_and_bundled_properties_with_find_max_flow_test()
boost::capacity_map(capacity)
.residual_capacity_map(residual_capacity)
.weight_map(cost));
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();
BOOST_CHECK_EQUAL(flow_cost, 29);
}
+42 -71
View File
@@ -12,6 +12,7 @@
// 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>
@@ -20,29 +21,15 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/property_map/dynamic_property_map.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.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;
@@ -105,7 +92,7 @@ bool test_graph(std::istream& dotfile, graph_t& graph,
{
#endif
// check correct vertex count
BOOST_TEST_EQ(num_vertices(graph), correct_num_vertices);
BOOST_CHECK_EQUAL(num_vertices(graph), correct_num_vertices);
// check masses
if (!masses.empty())
{
@@ -118,10 +105,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_TEST(masses.find(node_name) != masses.end());
BOOST_CHECK(masses.find(node_name) != masses.end());
float ref_mass = masses.find(node_name)->second;
// - compare the mass to the result in the table
BOOST_TEST_WITH(node_mass, ref_mass, close_to<float>(0.01f));
BOOST_CHECK_CLOSE(node_mass, ref_mass, 0.01f);
}
}
// check weights
@@ -137,16 +124,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_TEST(weights.find(edge_name) != weights.end());
BOOST_CHECK(weights.find(edge_name) != weights.end());
double ref_weight = weights.find(edge_name)->second;
// - compare the weight to teh result in the table
BOOST_TEST_WITH(edge_weight, ref_weight, close_to<double>(0.01));
BOOST_CHECK_CLOSE(edge_weight, ref_weight, 0.01);
}
}
if (!g_name.empty())
{
std::string parsed_name = get_property(graph, graph_name);
BOOST_TEST(parsed_name == g_name);
BOOST_CHECK(parsed_name == g_name);
}
}
else
@@ -179,27 +166,27 @@ struct edge_p_bundled
};
// Basic directed graph tests
void test_basic_directed_graph_1()
BOOST_AUTO_TEST_CASE(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_TEST((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
BOOST_CHECK((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
}
void test_basic_directed_graph_2()
BOOST_AUTO_TEST_CASE(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_TEST((test_graph< graph_t >(gs, 2, masses, weight_map_t())));
BOOST_CHECK((test_graph< graph_t >(gs, 2, masses, weight_map_t())));
}
void test_basic_directed_graph_3()
BOOST_AUTO_TEST_CASE(basic_directed_graph_3)
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)(
@@ -210,33 +197,33 @@ void test_basic_directed_graph_3()
"d ->e->a [weight=.5]}");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_TEST((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
BOOST_CHECK((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
}
// undirected graph with alternate node_id property name
void test_undirected_graph_alternate_node_id()
BOOST_AUTO_TEST_CASE(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_TEST(
BOOST_CHECK(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "nodenames")));
}
// Basic undirected graph tests
void test_basic_undirected_graph_1()
BOOST_AUTO_TEST_CASE(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_TEST((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
BOOST_CHECK((test_graph< graph_t >(gs, 3, masses, weight_map_t())));
}
void test_basic_undirected_graph_2()
BOOST_AUTO_TEST_CASE(basic_undirected_graph_2)
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)(
@@ -245,11 +232,11 @@ void test_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_TEST((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
BOOST_CHECK((test_graph< graph_t >(gs, 6, mass_map_t(), weights)));
}
// Mismatch directed graph test
void test_mismatch_directed_graph()
BOOST_AUTO_TEST_CASE(mismatch_directed_graph)
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
@@ -273,7 +260,7 @@ void test_mismatch_directed_graph()
}
// Mismatch undirected graph test
void test_mismatch_undirected_graph()
BOOST_AUTO_TEST_CASE(mismatch_undirected_graph)
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 7.7f)("e", 6.66f);
@@ -292,8 +279,9 @@ void test_mismatch_undirected_graph()
}
// Complain about parallel edges
void test_complain_about_parallel_edges()
BOOST_AUTO_TEST_CASE(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] }");
@@ -311,18 +299,18 @@ void test_complain_about_parallel_edges()
}
// Handle parallel edges gracefully
void test_handle_parallel_edges_gracefully()
BOOST_AUTO_TEST_CASE(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_TEST((test_graph< graph_t >(gs, 2, mass_map_t(), weights)));
BOOST_CHECK((test_graph< graph_t >(gs, 2, mass_map_t(), weights)));
}
// Graph Property Test 1
void test_graph_property_test_1()
BOOST_AUTO_TEST_CASE(graph_property_test_1)
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 0.0f)("e", 6.66f);
@@ -331,12 +319,12 @@ void test_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_TEST(
BOOST_CHECK(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "", graph_name)));
}
// Graph Property Test 2
void test_graph_property_test_2()
BOOST_AUTO_TEST_CASE(graph_property_test_2)
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 0.0f)("e", 6.66f);
@@ -344,12 +332,12 @@ void test_graph_property_test_2()
std::string graph_name("foo");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_TEST(
BOOST_CHECK(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "", graph_name)));
}
// Graph Property Test 3 (HTML)
void test_graph_property_test_3()
BOOST_AUTO_TEST_CASE(graph_property_test_3)
{
mass_map_t masses;
insert(masses)("a", 0.0f)("c", 0.0f)("e", 6.66f);
@@ -359,12 +347,12 @@ void test_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_TEST(
BOOST_CHECK(
(test_graph< graph_t >(gs, 3, masses, weight_map_t(), "", graph_name)));
}
// Comments embedded in strings
void test_comments_embedded_in_strings()
BOOST_AUTO_TEST_CASE(comments_embedded_in_strings)
{
gs_t gs("digraph { "
"a0 [ label = \"//depot/path/to/file_14#4\" ];"
@@ -373,11 +361,11 @@ void test_comments_embedded_in_strings()
"}");
typedef adjacency_list< vecS, vecS, directedS, vertex_p, edge_p, graph_p >
graph_t;
BOOST_TEST((test_graph< graph_t >(gs, 2, mass_map_t(), weight_map_t())));
BOOST_CHECK((test_graph< graph_t >(gs, 2, mass_map_t(), weight_map_t())));
}
#if 0 // Currently broken
void test_basic_csr_directed_graph() {
BOOST_AUTO_TEST_CASE (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)
@@ -386,11 +374,11 @@ void test_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_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)));
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)));
}
#endif
void test_basic_csr_directed_graph_ext_props()
BOOST_AUTO_TEST_CASE(basic_csr_directed_graph_ext_props)
{
weight_map_t weights;
insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)(
@@ -412,26 +400,9 @@ void test_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_TEST((test_graph(gs, g, 6, mass_map_t(), weights, "node_id", "",
BOOST_CHECK((test_graph(gs, g, 6, mass_map_t(), weights, "node_id", "",
vertex_name, vertex_color, edge_weight)));
}
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();
}
// return 0;
// }
+36
View File
@@ -6,6 +6,8 @@
#include "cycle_test.hpp"
#include <boost/graph/hawick_circuits.hpp>
#include <cstddef>
#include <functional>
#include <iostream>
struct call_hawick_circuits
@@ -26,6 +28,20 @@ struct call_hawick_unique_circuits
}
};
struct not_copyable
{
not_copyable() { }
template < typename Path, typename Graph >
void cycle(Path const&, Graph const&)
{
}
private:
not_copyable(not_copyable const&);
};
int main()
{
std::cout << "---------hawick_circuits---------\n";
@@ -33,4 +49,24 @@ int main()
std::cout << "\n\n---------hawick_unique_circuits---------\n";
cycle_test(call_hawick_unique_circuits());
// Make sure we can pass a reference_wrapper to the algorithm.
#if __cplusplus >= 201103L
{
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS> Graph;
typedef std::pair<std::size_t, std::size_t> Pair;
Pair edges[3] = {
Pair(0, 1), // a->b
Pair(1, 2), // b->c
Pair(2, 0), // c->a
};
Graph G(3);
for (int i = 0; i < 3; ++i)
add_edge(edges[i].first, edges[i].second, G);
not_copyable visitor;
boost::hawick_circuits(G, std::ref(visitor));
}
#endif // >= C++11
}
+34 -31
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/core/lightweight_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
@@ -37,6 +37,19 @@ 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;
@@ -98,7 +111,7 @@ private:
// Check various implementations of the ArgPack where
// the weights are provided in it, and one case where
// they are not.
void test0()
BOOST_AUTO_TEST_CASE(test0)
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -146,9 +159,9 @@ void test0()
.vertex_assignment_map(assignments)
.max_priority_queue(pq));
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_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);
test_vis.clear();
boost::maximum_adjacency_search(g,
@@ -157,17 +170,17 @@ void test0()
.root_vertex(*vertices(g).first)
.max_priority_queue(pq));
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_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);
test_vis.clear();
boost::maximum_adjacency_search(
g, boost::weight_map(weights).visitor(test_vis).max_priority_queue(pq));
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_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::maximum_adjacency_search(g,
boost::weight_map(weights).visitor(
@@ -183,14 +196,14 @@ void test0()
boost::make_constant_property< edge_descriptor >(weight_type(1)))
.visitor(test_vis)
.max_priority_queue(pq));
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);
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);
}
// Check the unweighted case
// with and without providing a weight_map
void test1()
BOOST_AUTO_TEST_CASE(test1)
{
typedef boost::graph_traits<
undirected_unweighted_graph >::vertex_descriptor vertex_descriptor;
@@ -235,9 +248,9 @@ void test1()
.visitor(test_vis)
.max_priority_queue(pq));
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));
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));
weight_type ws[] = { 2, 3, 4, 3, 2, 2, 2, 2, 2, 3, 1, 3 };
std::map< edge_descriptor, weight_type > wm;
@@ -253,19 +266,9 @@ void test1()
boost::maximum_adjacency_search(
g, boost::weight_map(ws_map).visitor(test_vis).max_priority_queue(pq));
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));
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));
}
#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,5 +1,8 @@
#define BOOST_TEST_MODULE \
max_flow_algorithms_named_parameters_and_bundled_params_test
#include <boost/graph/adjacency_list.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/graph/edmonds_karp_max_flow.hpp>
#include "min_cost_max_flow_utils.hpp"
@@ -26,7 +29,8 @@ typedef boost::adjacency_list< boost::listS, boost::vecS, boost::directedS,
node_t, edge_t >
Graph;
void using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test()
BOOST_AUTO_TEST_CASE(
using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test)
{
Graph g;
traits::vertex_descriptor s, t;
@@ -56,11 +60,5 @@ void using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test()
.color_map(col)
.predecessor_map(pred));
BOOST_TEST_EQ(flow_value, 4);
}
int main()
{
using_named_parameters_and_bundled_params_on_edmonds_karp_max_flow_test();
return boost::report_errors();
BOOST_CHECK_EQUAL(flow_value, 4);
}
+63 -65
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/core/lightweight_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/tuple/tuple.hpp>
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS,
@@ -35,6 +35,19 @@ 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;
@@ -42,7 +55,7 @@ struct edge_t
};
// the example from Stoer & Wagner (1997)
void test0()
BOOST_AUTO_TEST_CASE(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 } };
@@ -54,25 +67,25 @@ void 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_TEST_EQ(w, 4);
BOOST_CHECK_EQUAL(w, 4);
const bool parity0 = get(parities, 0);
BOOST_TEST_EQ(parity0, get(parities, 1));
BOOST_TEST_EQ(parity0, get(parities, 4));
BOOST_TEST_EQ(parity0, get(parities, 5));
BOOST_CHECK_EQUAL(parity0, get(parities, 1));
BOOST_CHECK_EQUAL(parity0, get(parities, 4));
BOOST_CHECK_EQUAL(parity0, get(parities, 5));
const bool parity2 = get(parities, 2);
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_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));
}
void test1()
BOOST_AUTO_TEST_CASE(test1)
{
{ // if only one vertex, can't run `boost::stoer_wagner_min_cut`
undirected_graph g;
add_vertex(g);
BOOST_TEST_THROWS(
BOOST_CHECK_THROW(
boost::stoer_wagner_min_cut(g, get(boost::edge_weight, g)),
boost::bad_graph);
}
@@ -94,15 +107,15 @@ void test1()
assignments(assignment);
int w = boost::stoer_wagner_min_cut(g, weights,
boost::parity_map(parities).vertex_assignment_map(assignments));
BOOST_TEST_EQ(w, 3);
BOOST_CHECK_EQUAL(w, 3);
const bool parity2 = get(parities, 2), parity0 = get(parities, 0);
BOOST_TEST_NE(parity2, parity0);
BOOST_TEST_EQ(parity0, get(parities, 1));
BOOST_CHECK_NE(parity2, parity0);
BOOST_CHECK_EQUAL(parity0, get(parities, 1));
}
}
// example by Daniel Trebbien
void test2()
BOOST_AUTO_TEST_CASE(test2)
{
edge_t edges[] = { { 5, 2 }, { 0, 6 }, { 5, 6 }, { 3, 1 }, { 0, 1 },
{ 6, 3 }, { 4, 6 }, { 2, 4 }, { 5, 3 } };
@@ -113,19 +126,19 @@ void 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_TEST_EQ(w, 3);
BOOST_CHECK_EQUAL(w, 3);
const bool parity2 = get(parities, 2);
BOOST_TEST_EQ(parity2, get(parities, 4));
BOOST_CHECK_EQUAL(parity2, get(parities, 4));
const bool parity5 = get(parities, 5);
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));
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));
}
// example by Daniel Trebbien
void test3()
BOOST_AUTO_TEST_CASE(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 },
@@ -138,19 +151,19 @@ void 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_TEST_EQ(w, 7);
BOOST_CHECK_EQUAL(w, 7);
const bool parity1 = get(parities, 1);
BOOST_TEST_EQ(parity1, get(parities, 5));
BOOST_CHECK_EQUAL(parity1, get(parities, 5));
const bool parity0 = get(parities, 0);
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_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));
}
void test4()
BOOST_AUTO_TEST_CASE(test4)
{
typedef boost::graph_traits<
undirected_unweighted_graph >::vertex_descriptor vertex_descriptor;
@@ -172,16 +185,16 @@ void 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_TEST_EQ(w, 2);
BOOST_CHECK_EQUAL(w, 2);
const bool parity0 = get(parities, 0);
BOOST_TEST_EQ(parity0, get(parities, 1));
BOOST_TEST_EQ(parity0, get(parities, 4));
BOOST_TEST_EQ(parity0, get(parities, 5));
BOOST_CHECK_EQUAL(parity0, get(parities, 1));
BOOST_CHECK_EQUAL(parity0, get(parities, 4));
BOOST_CHECK_EQUAL(parity0, get(parities, 5));
const bool parity2 = get(parities, 2);
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_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));
}
// The input for the `test_prgen` family of tests comes from a program, named
@@ -197,7 +210,7 @@ void test4()
// weight of the min-cut is verified.
// 3 min-cuts
void test_prgen_20_70_2()
BOOST_AUTO_TEST_CASE(test_prgen_20_70_2)
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -212,7 +225,7 @@ void test_prgen_20_70_2()
boost::associative_property_map<
std::map< vertex_descriptor, std::size_t > >
components(component);
BOOST_TEST_EQ(boost::connected_components(g, components),
BOOST_CHECK_EQUAL(boost::connected_components(g, components),
1U); // verify the connectedness assumption
typedef boost::shared_array_property_map< weight_type,
@@ -234,11 +247,11 @@ void test_prgen_20_70_2()
int w = boost::stoer_wagner_min_cut(
g, get(boost::edge_weight, g), boost::max_priority_queue(pq));
BOOST_TEST_EQ(w, 3407);
BOOST_CHECK_EQUAL(w, 3407);
}
// 7 min-cuts
void test_prgen_50_40_2()
BOOST_AUTO_TEST_CASE(test_prgen_50_40_2)
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -253,15 +266,15 @@ void test_prgen_50_40_2()
boost::associative_property_map<
std::map< vertex_descriptor, std::size_t > >
components(component);
BOOST_TEST_EQ(boost::connected_components(g, components),
BOOST_CHECK_EQUAL(boost::connected_components(g, components),
1U); // verify the connectedness assumption
int w = boost::stoer_wagner_min_cut(g, get(boost::edge_weight, g));
BOOST_TEST_EQ(w, 10056);
BOOST_CHECK_EQUAL(w, 10056);
}
// 6 min-cuts
void test_prgen_50_70_2()
BOOST_AUTO_TEST_CASE(test_prgen_50_70_2)
{
typedef boost::graph_traits< undirected_graph >::vertex_descriptor
vertex_descriptor;
@@ -276,24 +289,9 @@ void test_prgen_50_70_2()
boost::associative_property_map<
std::map< vertex_descriptor, std::size_t > >
components(component);
BOOST_TEST_EQ(boost::connected_components(g, components),
BOOST_CHECK_EQUAL(boost::connected_components(g, components),
1U); // verify the connectedness assumption
int w = boost::stoer_wagner_min_cut(g, get(boost::edge_weight, g));
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();
test_prgen_20_70_2();
test_prgen_50_70_2();
}
return boost::report_errors();
BOOST_CHECK_EQUAL(w, 21755);
}
+81 -78
View File
@@ -10,11 +10,13 @@
*
*/
#define BOOST_TEST_MODULE subgraph_add
// std lib includes
#include <iostream>
// include boost components
#include <boost/core/lightweight_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/iteration_macros.hpp>
@@ -23,8 +25,11 @@
using namespace boost;
void simpleGraphTest()
BOOST_AUTO_TEST_CASE(simpleGraph)
{
BOOST_TEST_MESSAGE("simple subgraph");
typedef subgraph< adjacency_list< vecS, vecS, directedS, no_property,
property< edge_index_t, int > > >
Graph;
@@ -45,8 +50,8 @@ void simpleGraphTest()
Graph& G1 = G0.create_subgraph();
Graph& G2 = G1.create_subgraph();
BOOST_TEST(&G1.parent() == &G0);
BOOST_TEST(&G2.parent() == &G1);
BOOST_CHECK(&G1.parent() == &G0);
BOOST_CHECK(&G2.parent() == &G1);
enum
{
@@ -68,10 +73,10 @@ void simpleGraphTest()
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_TEST(num_vertices(G0) == 6);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G0) == 6);
BOOST_CHECK(num_vertices(G1) == 3);
std::cerr << num_vertices(G1) << std::endl;
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
// add edges to root graph
add_edge(A, B, G0);
@@ -79,23 +84,26 @@ void simpleGraphTest()
add_edge(B, D, G0);
add_edge(E, F, G0);
BOOST_TEST(num_edges(G0) == 4);
BOOST_TEST(num_edges(G1) == 1);
BOOST_TEST(num_edges(G2) == 0);
BOOST_CHECK(num_edges(G0) == 4);
BOOST_CHECK(num_edges(G1) == 1);
BOOST_CHECK(num_edges(G2) == 0);
// add edges to G1
add_edge(A1, B1, G1);
BOOST_TEST(num_edges(G0) == 5);
BOOST_TEST(num_edges(G1) == 2);
BOOST_TEST(num_edges(G2) == 1);
BOOST_CHECK(num_edges(G0) == 5);
BOOST_CHECK(num_edges(G1) == 2);
BOOST_CHECK(num_edges(G2) == 1);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 6);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 6);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 2);
}
void addVerticesTest()
BOOST_AUTO_TEST_CASE(addVertices)
{
BOOST_TEST_MESSAGE("subgraph add edges");
typedef subgraph< adjacency_list< vecS, vecS, directedS, no_property,
property< edge_index_t, int > > >
Graph;
@@ -106,8 +114,8 @@ void addVerticesTest()
Graph& G1 = G0.create_subgraph();
Graph& G2 = G1.create_subgraph();
BOOST_TEST(&G1.parent() == &G0);
BOOST_TEST(&G2.parent() == &G1);
BOOST_CHECK(&G1.parent() == &G0);
BOOST_CHECK(&G2.parent() == &G1);
// add vertices to G2
Vertex n1 = add_vertex(0, G2);
@@ -115,7 +123,7 @@ void addVerticesTest()
// check if the global vertex 2 is equal to the returned local vertex
if (G2.find_vertex(0).second)
{
BOOST_TEST(G2.find_vertex(0).first == n1);
BOOST_CHECK(G2.find_vertex(0).first == n1);
}
else
{
@@ -123,7 +131,7 @@ void addVerticesTest()
}
if (G2.find_vertex(1).second)
{
BOOST_TEST(G2.find_vertex(1).first == n2);
BOOST_CHECK(G2.find_vertex(1).first == n2);
}
else
{
@@ -132,7 +140,7 @@ void addVerticesTest()
// and check if this vertex is also present in G1
if (G1.find_vertex(0).second)
{
BOOST_TEST(G1.local_to_global(G1.find_vertex(0).first) == 0);
BOOST_CHECK(G1.local_to_global(G1.find_vertex(0).first) == 0);
}
else
{
@@ -140,7 +148,7 @@ void addVerticesTest()
}
if (G1.find_vertex(0).second)
{
BOOST_TEST(G1.local_to_global(G1.find_vertex(1).first) == 1);
BOOST_CHECK(G1.local_to_global(G1.find_vertex(1).first) == 1);
}
else
{
@@ -148,50 +156,50 @@ void addVerticesTest()
}
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(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_TEST(G1.find_vertex(2).first == n3);
BOOST_CHECK(G1.find_vertex(2).first == n3);
}
else
{
BOOST_ERROR("vertex not found!");
}
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(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_TEST(G0.find_vertex(G1.local_to_global(n4)).second);
BOOST_CHECK(G0.find_vertex(G1.local_to_global(n4)).second);
// check if the new local vertex is not in the subgraphs
BOOST_TEST(!G2.find_vertex(n4).second);
BOOST_CHECK(!G2.find_vertex(n4).second);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 4);
BOOST_TEST(num_vertices(G1) == 4);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 4);
BOOST_CHECK(num_vertices(G1) == 4);
BOOST_CHECK(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_TEST(!G1.find_vertex(n5).second);
BOOST_TEST(!G2.find_vertex(n5).second);
BOOST_CHECK(!G1.find_vertex(n5).second);
BOOST_CHECK(!G2.find_vertex(n5).second);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 5);
BOOST_TEST(num_vertices(G1) == 4);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 5);
BOOST_CHECK(num_vertices(G1) == 4);
BOOST_CHECK(num_vertices(G2) == 2);
typedef std::map< graph_traits< Graph::graph_type >::vertex_descriptor,
graph_traits< Graph::graph_type >::vertex_descriptor >::iterator v_itr;
@@ -213,8 +221,11 @@ void addVerticesTest()
}
}
void addEdgeTest()
BOOST_AUTO_TEST_CASE(addEdge)
{
BOOST_TEST_MESSAGE("subgraph add edges");
typedef subgraph< adjacency_list< vecS, vecS, directedS, no_property,
property< edge_index_t, int > > >
Graph;
@@ -225,59 +236,59 @@ void addEdgeTest()
Graph& G1 = G0.create_subgraph();
Graph& G2 = G1.create_subgraph();
BOOST_TEST(&G1.parent() == &G0);
BOOST_TEST(&G2.parent() == &G1);
BOOST_CHECK(&G1.parent() == &G0);
BOOST_CHECK(&G2.parent() == &G1);
// add vertices
add_vertex(0, G2);
add_vertex(1, G2);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
// add edge to G0 which needs propagation
add_edge(0, 1, G0);
BOOST_TEST(num_edges(G0) == 1);
BOOST_TEST(num_edges(G1) == 1);
BOOST_TEST(num_edges(G2) == 1);
BOOST_CHECK(num_edges(G0) == 1);
BOOST_CHECK(num_edges(G1) == 1);
BOOST_CHECK(num_edges(G2) == 1);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
// add edge to G0 without propagation
add_edge(1, 2, G0);
BOOST_TEST(num_edges(G0) == 2);
BOOST_TEST(num_edges(G1) == 1);
BOOST_TEST(num_edges(G2) == 1);
BOOST_CHECK(num_edges(G0) == 2);
BOOST_CHECK(num_edges(G1) == 1);
BOOST_CHECK(num_edges(G2) == 1);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 2);
BOOST_TEST(num_vertices(G2) == 2);
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 2);
BOOST_CHECK(num_vertices(G2) == 2);
// add vertex 2 to G2/G1 with edge propagation
Vertex n = add_vertex(2, G2);
BOOST_TEST(G2.local_to_global(n) == 2);
BOOST_CHECK(G2.local_to_global(n) == 2);
BOOST_TEST(num_edges(G0) == 2);
BOOST_TEST(num_edges(G1) == 2);
BOOST_TEST(num_edges(G2) == 2);
BOOST_CHECK(num_edges(G0) == 2);
BOOST_CHECK(num_edges(G1) == 2);
BOOST_CHECK(num_edges(G2) == 2);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 3);
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 3);
// add edge to G2 with propagation upwards
add_edge(0, 2, G2);
BOOST_TEST(num_edges(G0) == 3);
BOOST_TEST(num_edges(G1) == 3);
BOOST_TEST(num_edges(G2) == 3);
BOOST_CHECK(num_edges(G0) == 3);
BOOST_CHECK(num_edges(G1) == 3);
BOOST_CHECK(num_edges(G2) == 3);
// num_vertices stays the same
BOOST_TEST(num_vertices(G0) == 3);
BOOST_TEST(num_vertices(G1) == 3);
BOOST_TEST(num_vertices(G2) == 3);
BOOST_CHECK(num_vertices(G0) == 3);
BOOST_CHECK(num_vertices(G1) == 3);
BOOST_CHECK(num_vertices(G2) == 3);
typedef std::map< graph_traits< Graph::graph_type >::vertex_descriptor,
graph_traits< Graph::graph_type >::vertex_descriptor >::iterator v_itr;
@@ -313,11 +324,3 @@ void addEdgeTest()
std::cerr << source(e, G2) << "->" << target(e, G2) << std::endl;
}
}
int main()
{
simpleGraphTest();
addVerticesTest();
addEdgeTest();
return boost::report_errors();
}
@@ -7,14 +7,16 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <boost/core/lightweight_test.hpp>
#define BOOST_TEST_MODULE successive_shortest_path_nonnegative_weights_test
#include <boost/test/unit_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"
void path_augmentation_def_test()
BOOST_AUTO_TEST_CASE(path_augmentation_def_test)
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -23,10 +25,10 @@ void path_augmentation_def_test()
boost::successive_shortest_path_nonnegative_weights(g, s, t);
int cost = boost::find_flow_cost(g);
BOOST_TEST_EQ(cost, 29);
BOOST_CHECK_EQUAL(cost, 29);
}
void path_augmentation_def_test2()
BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -35,10 +37,10 @@ void path_augmentation_def_test2()
boost::successive_shortest_path_nonnegative_weights(g, s, t);
int cost = boost::find_flow_cost(g);
BOOST_TEST_EQ(cost, 7);
BOOST_CHECK_EQUAL(cost, 7);
}
void path_augmentation_test()
BOOST_AUTO_TEST_CASE(path_augmentation_test)
{
boost::SampleGraph::vertex_descriptor s, t;
typedef boost::SampleGraph::Graph Graph;
@@ -64,13 +66,5 @@ void path_augmentation_test()
.vertex_index_map(idx));
int cost = boost::find_flow_cost(g);
BOOST_TEST_EQ(cost, 29);
}
int main()
{
path_augmentation_def_test();
path_augmentation_def_test2();
path_augmentation_test();
return boost::report_errors();
BOOST_CHECK_EQUAL(cost, 29);
}