diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index eb3cfffa2c5..0b72fb727d2 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: boost_minor: [56] - old_pgr: [3.7.0, 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.5.1, 3.5.0, 3.4.2, 3.4.1, 3.4.0, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0, 3.2.1, 3.2.2] + old_pgr: [3.7.1, 3.7.0, 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.5.1, 3.5.0, 3.4.2, 3.4.1, 3.4.0, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0, 3.2.1, 3.2.2] steps: - uses: actions/checkout@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index e06dbff9464..d1fbd6f9856 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.12 FATAL_ERROR) if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "In-source builds not allowed. @@ -6,6 +6,16 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) You may need to remove CMakeCache.txt." ) endif() +if(POLICY CMP0144) + cmake_policy(SET CMP0144 OLD) +endif() + +if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) +endif() + +cmake_policy(SET CMP0148 OLD) + #--------------------------------------------- # Setting kind of build #--------------------------------------------- @@ -33,6 +43,7 @@ string(TIMESTAMP COMPILATION_DATE "%Y/%m/%d" UTC) set(MINORS 4.0 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.6) set(OLD_SIGNATURES + 3.7.1 3.7.0 3.6.3 3.6.2 diff --git a/NEWS.md b/NEWS.md index ab8c842bfc5..6fd4a2299cf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -21,6 +21,27 @@ ## pgRouting 3.7 +### pgRouting 3.7.2 Release Notes + +To see all issues & pull requests closed by this release see the [Git closed +milestone for 3.7.2 +](https://github.com/pgRouting/pgrouting/issues?utf8=%E2%9C%93&q=milestone%3A%22Release%203.7.2%22) + +**Build** + +* [#2713](https://github.com/pgRouting/pgrouting/pull/2713) cmake missing + some policies and min version + + - Using OLD policies: CMP0148, CMP0144, CMP0167 + - Minimum cmake version 3.12 + +**Bug fixes** + +* [#2707](https://github.com/pgRouting/pgrouting/pull/2707) Build failure in + pgRouting 3.7.1 on Alpine +* [#2706](https://github.com/pgRouting/pgrouting/pull/2706) winnie crashing + on pgr_betweennessCentrality + ### pgRouting 3.7.1 Release Notes To see all issues & pull requests closed by this release see the [Git closed diff --git a/README.md b/README.md index 3b4a0e0b175..29e6f151099 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ The latest documentation: https://docs.pgrouting.org/latest * Postgresql = Supported [version](https://www.postgresql.org/support/versioning/) by PostgreSQL * Not supporting v12 & under * The Boost Graph Library (BGL) >= 1.56 -* CMake >= 3.2 +* CMake >= 3.12 * 7.0 > Sphinx >= 4.0.0 ### User's requirements diff --git a/ci/winnie/build_pgrouting.sh b/ci/winnie/build_pgrouting.sh index 72ca229af9a..bf820df0d74 100644 --- a/ci/winnie/build_pgrouting.sh +++ b/ci/winnie/build_pgrouting.sh @@ -20,185 +20,164 @@ # File used in Jenkis setup #------------------------- -JENKINS_DEBUG=1 - -#----------------- -# variables setup -# Variables recived by jenkins setup -#----------------- -#export OS_BUILD= -#export PG_VER= -#export PGHOST= -#export PGPORT= -#export PGROUTING_VER= -#export POSTIGS_VER= -#GCC_TYPE= -#export GIT_COMMIT= +# Setting defaults +if [[ "${OS_BUILD}" == '' ]] ; then + OS_BUILD=64 +fi; +if [[ "${PG_VER}" == '' ]] ; then + PG_VER=14 +fi; + +if [[ "${PGPORT}" == '' ]] ; then + PGPORT=54613 +fi; + +if [[ "${PGROUTING_VER}" == '' ]] ; then + PGROUTING_VER=cvvergara +fi; + +if [[ "${POSTGIS_VER}" == '' ]] ; then + POSTGIS_VER=3.3.2 +fi; + +if [[ "${GCC_TYPE}" == '' ]] ; then + GCC_TYPE=gcc81 +fi; + +if [[ "${BOOST_VER}" == '' ]] ; then + BOOST_VER=1.78.0 +fi; +BOOST_VER_WU=$(echo "${BOOST_VER//./_}") + +echo "DEBUG ${DEBUG}" + +# debugging options +if [[ "$DEBUG" == 'true' ]] +then + JENKINS_DEBUG=1 + VERBOSE=ON + BUILD_TYPE=Debug +else + JENKINS_DEBUG=0 + VERBOSE=OFF + BUILD_TYPE=Release +fi + +TAPTEST=${TAPTEST%%*([[:blank:]])} +TAPTEST=${TAPTEST##*([[:blank:]])} + +echo "GIT_COMMIT ${GIT_COMMIT}" if [ $JENKINS_DEBUG -eq 1 ] then - #--------------- echo echo "***************************" - echo Recived variables + echo Recived variables used in this script echo "**************************" - #--------------- + echo "OS_BUILD ${OS_BUILD}" echo "PG_VER ${PG_VER}" - echo "PGHOST ${PGHOST}" echo "PGPORT ${PGPORT}" echo "PGROUTING_VER ${PGROUTING_VER}" echo "POSTGIS_VER ${POSTGIS_VER}" echo "GCC_TYPE ${GCC_TYPE}" - echo "GIT_COMMIT ${GIT_COMMIT}" + echo "BOOST_VER ${BOOST_VER}" + echo "calculated BOOST_VER_WU ${BOOST_VER_WU}" + echo "TAPTEST ${TAPTEST}" + echo "DEBUG ${DEBUG}" fi -#--------------- -echo -echo "***************************" -echo Deduced variables -echo "***************************" -#--------------- - export PGUSER=postgres export PROJECTS=/projects -export PGPATHEDB=${PROJECTS}/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE}edb #this is so winnie know's where to copy the dlls for vc++ edb compiled postgresql testing + +#this is so winnie know's where to copy the dlls for vc++ edb compiled postgresql testing +export PGPATHEDB=${PROJECTS}/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE}edb + export PGPATH=${PROJECTS}/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE} -export PATHOLD=$PATH -#export PATHOLD="/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows" export PGWINVER=${PG_VER}w${OS_BUILD}${GCC_TYPE}edb -export PATH="${PATHOLD}:/usr/bin:${PGPATH}/bin:${PGPATH}/lib:${PGPATH}/include" +export BOOSTROOT_PATH="${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE}" +export PATH="${PATH}:/usr/bin:${PGPATH}/bin:${PGPATH}/lib:${PGPATH}/include" export PATH="${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/include:${PATH}" +export PATH="${PATH}:${BOOSTROOT_PATH}/lib" +export PATH="${PATH}:/cmake/bin" +export PATH="${PATH}:.:/bin:/include" + if [ $JENKINS_DEBUG -eq 1 ] then + echo "***************************" + echo Paths + echo "***************************" + echo "PGUSER ${PGUSER}" echo "PROJECTS ${PROJECTS}" echo "PGPATHEDB ${PGPATHEDB}" echo "PGPATH ${PGPATH}" - echo "PATHOLD ${PATHOLD}" echo "PGWINVER ${PGWINVER}" echo "PATH ${PATH}" + echo "BOOSTROOT_PATH ${BOOSTROOT_PATH}" fi -BOOST_VER=1.78.0 -BOOST_VER_WU=1_78_0 -BOOST_VER_WUM=1_78 -ZLIB_VER=1.2.13 -echo "${BOOST_VER}" +#--------------- +echo "Cleanup ${PGPATH} & ${PGPATHEDB}" +rm -f ${PGPATH}/lib/libpgrouting* +rm -f ${PGPATH}/share/extension/pgrouting* +rm -f ${PGPATHEDB}/lib/libpgrouting* +rm -f ${PGPATHEDB}/share/extension/pgrouting* if [ $JENKINS_DEBUG -eq 1 ] then - echo "BOOST_VER_WU ${BOOST_VER_WU}" - echo "BOOST_VER_WUM ${BOOST_VER_WUM}" - echo "ZLIB_VER ${ZLIB_VER}" + echo "${PGPATH} & ${PGPATHEDB} pgrouting related files" + ls ${PGPATH}/lib/libpgrouting* 2>/dev/null + ls ${PGPATH}/share/extension/pgrouting* 2>/dev/null + ls ${PGPATHEDB}/lib/libpgrouting* 2>/dev/null + ls ${PGPATHEDB}/share/extension/pgrouting* 2>/dev/null fi -#zlib -ZLIB_PATH="${PROJECTS}/zlib/rel-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}" -PATH="${PATH}:${ZLIB_PATH}/include:${ZLIB_PATH}/lib:${ZLIB_PATH}/bin" - -#boost -BOOSTROOT_PATH="${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE}" -PATH="${PATH}:${BOOSTROOT_PATH}/lib" - -#cmake -export PATH="${PATH}:/cmake/bin" -export PATH="${PATH}:.:/bin:/include" - cmake --version -echo "PATH ${PATH}" - cd "${PROJECTS}/pgrouting" || exit 1 +DATABASE="___pgr___test___" +PGR_VERSION=$(grep -Po '(?<=project\(PGROUTING VERSION )[^;]+' "branches/${PGROUTING_VER}/CMakeLists.txt") +if [ $JENKINS_DEBUG -eq 1 ] +then + echo "pgRouting VERSION ${PGR_VERSION}" +fi + rm -rf "build${PGROUTING_VER}w${OS_BUILD}${GCC_TYPE}" mkdir "build${PGROUTING_VER}w${OS_BUILD}${GCC_TYPE}" cd "build${PGROUTING_VER}w${OS_BUILD}${GCC_TYPE}" || exit 1 - -#--------------- -echo -echo "***************************" -echo "Current contents of PGPATH ${PGPATH}" -echo "***************************" -#--------------- -ls ${PGPATH}/lib/libpgrouting* -ls ${PGPATH}/share/extension/pgrouting* - -#--------------- -echo -echo "***************************" -echo "Current contents of PGPATHEDB ${PGPATHEDB}" -echo "***************************" -#--------------- -ls ${PGPATHEDB}/lib/libpgrouting* -ls ${PGPATHEDB}/share/extension/pgrouting* - -rm ${PGPATH}/lib/libpgrouting* -rm ${PGPATH}/share/extension/pgrouting* -rm ${PGPATHEDB}/lib/libpgrouting -rm ${PGPATHEDB}/share/extension/pgrouting* - -#--------------- -echo -echo "***************************" -echo "After removing in PGPATH ${PGPATH}" -echo "***************************" -#--------------- -ls ${PGPATH}/lib/libpgrouting* -ls ${PGPATH}/share/extension/pgrouting* - -#--------------- -echo -echo "***************************" -echo "After removing in PGPATHEDB ${PGPATHEDB}" -echo "***************************" -#--------------- -ls ${PGPATHEDB}/lib/libpgrouting* -ls ${PGPATHEDB}/share/extension/pgrouting* -cmake --version - -cmake -G "MSYS Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON \ +cmake -G "MSYS Makefiles" -DCMAKE_VERBOSE_MAKEFILE="${VERBOSE}" \ -DBOOST_ROOT:PATH="${BOOSTROOT_PATH}" \ -DBoost_USE_STATIC_LIBS=ON \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ "../branches/${PGROUTING_VER}" #--------------- echo echo "***************************" -echo make -echo "***************************" -#--------------- -make - -#--------------- -echo -echo "***************************" -echo make install +echo Building and installing echo "***************************" #--------------- make install -#--------------- -echo -echo "***************************" -echo "Current contents of PGPATH ${PGPATH}" -echo "***************************" -#--------------- -ls ${PGPATH}/lib/libpgrouting* -ls ${PGPATH}/share/extension/pgrouting* +if [ $JENKINS_DEBUG -eq 1 ] +then + echo "***************************" + echo "Installation on PGPATH ${PGPATH}" + echo "***************************" + ls ${PGPATH}/lib/libpgrouting* + ls ${PGPATH}/share/extension/pgrouting* -#--------------- -echo -echo "***************************" -echo "Current contents of PGPATHEDB ${PGPATHEDB}" -echo Should be empty -echo "***************************" -#--------------- -ls ${PGPATHEDB}/lib/libpgrouting* -ls ${PGPATHEDB}/share/extension/pgrouting* + echo "***************************" + echo "Current contents of PGPATHEDB ${PGPATHEDB}" + echo Should be empty + echo "***************************" + ls ${PGPATHEDB}/lib/libpgrouting* + ls ${PGPATHEDB}/share/extension/pgrouting* +fi #we need uninstall and reinstall copy to VC++ EDB instance if we want to test on standard Windows installed versions @@ -207,36 +186,37 @@ cp -r ${PGPATH}/lib/libpgrouting*.dll ${PGPATHEDB}/lib/ cp -r ${PGPATH}/share/extension/pgrouting*.sql ${PGPATHEDB}/share/extension/ cp -r ${PGPATH}/share/extension/pgrouting.control ${PGPATHEDB}/share/extension/ -#--------------- -echo -echo "***************************" -echo "After copying to PGPATHEDB ${PGPATHEDB}" -echo "***************************" -#--------------- -ls ${PGPATHEDB}/lib/libpgrouting* -ls ${PGPATHEDB}/share/extension/pgrouting* +if [ $JENKINS_DEBUG -eq 1 ] +then + echo + echo "***************************" + echo "Installation on PGPATHEDB ${PGPATHEDB}" + echo "***************************" + ls ${PGPATHEDB}/lib/libpgrouting* + ls ${PGPATHEDB}/share/extension/pgrouting* +fi cd "${PROJECTS}/pgrouting/branches/${PGROUTING_VER}" || exit 1 -#perl tools/test-runner.pl -pgver ${PG_VER} -pgport "${PGPORT}" -clean -#perl tools/testers/doc_queries_generator.pl -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" -alg common -clean -v -#perl tools/testers/doc_queries_generator.pl -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" -alg dijkstra -clean -v -#perl tools/testers/doc_queries_generator.pl -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" -alg contraction - -#perl tools/testers/doc_queries_generator.pl -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" +echo "***************************" +# Testing +echo "***************************" -if [ "${OS_BUILD}" -eq 32 ] +if [ -n "${TAPTEST}" ] then - perl tools/testers/doc_queries_generator.pl -pgver "${PG_VER}" -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" + psql -c "CREATE DATABASE ${DATABASE}" + bash tools/testers/setup_db.sh "${PGPORT}" "${DATABASE}" "${PGUSER}" "${PGR_VERSION}" + pg_prove -v --normalize --directives --recurse -p "${PGPORT}" -d "${DATABASE}" "${TAPTEST}" + psql -c "DROP DATABASE ${DATABASE}" -else +fi - psql -c "CREATE DATABASE ___pgr___test___" - tools/testers/pg_prove_tests.sh "${PGUSER}" "${PGPORT}" - psql -c "DROP DATABASE ___pgr___test___" -fi +psql -c "CREATE DATABASE ${DATABASE}" +tools/testers/pg_prove_tests.sh "${PGUSER}" "${PGPORT}" +psql -c "DROP DATABASE ${DATABASE}" + cd "${PROJECTS}/pgrouting/build${PGROUTING_VER}w${OS_BUILD}${GCC_TYPE}/lib" || exit 1 strip ./*.dll diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index d9476785dab..e4bad28aa24 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -60,6 +60,28 @@ pgRouting 3.7 :local: :depth: 1 +pgRouting 3.7.2 Release Notes +------------------------------------------------------------------------------- + +To see all issues & pull requests closed by this release see the `Git closed +milestone for 3.7.2 +`__ + +.. rubric:: Build + +* `#2713 `__ cmake missing + some policies and min version + + - Using OLD policies: CMP0148, CMP0144, CMP0167 + - Minimum cmake version 3.12 + +.. rubric:: Bug fixes + +* `#2707 `__ Build failure in + pgRouting 3.7.1 on Alpine +* `#2706 `__ winnie crashing + on pgr_betweennessCentrality + pgRouting 3.7.1 Release Notes ------------------------------------------------------------------------------- diff --git a/include/astar/astar.hpp b/include/astar/astar.hpp index 32736025f01..c00ec0c00d3 100644 --- a/include/astar/astar.hpp +++ b/include/astar/astar.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include diff --git a/include/bdAstar/bdAstar.hpp b/include/bdAstar/bdAstar.hpp index cbaa86a308b..3c0e160aa2f 100644 --- a/include/bdAstar/bdAstar.hpp +++ b/include/bdAstar/bdAstar.hpp @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/bidirectional.hpp" #include "cpp_common/basePath_SSEC.hpp" diff --git a/include/bellman_ford/bellman_ford.hpp b/include/bellman_ford/bellman_ford.hpp index 06e704cfcc1..3134c5bf9cf 100644 --- a/include/bellman_ford/bellman_ford.hpp +++ b/include/bellman_ford/bellman_ford.hpp @@ -38,6 +38,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include + #include #include #include diff --git a/include/bellman_ford/edwardMoore.hpp b/include/bellman_ford/edwardMoore.hpp index d85ef2e2d7c..d5fe38680e1 100644 --- a/include/bellman_ford/edwardMoore.hpp +++ b/include/bellman_ford/edwardMoore.hpp @@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/basePath_SSEC.hpp" #include "cpp_common/base_graph.hpp" diff --git a/include/bgraph/graph_to_edges.hpp b/include/bgraph/graph_to_edges.hpp index 05e805e375e..945c2b9989c 100644 --- a/include/bgraph/graph_to_edges.hpp +++ b/include/bgraph/graph_to_edges.hpp @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/bgraph/line_graph.hpp b/include/bgraph/line_graph.hpp index 4d6435e5179..bb9567190fa 100644 --- a/include/bgraph/line_graph.hpp +++ b/include/bgraph/line_graph.hpp @@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_BGRAPH_LINE_GRAPH_HPP_ #include +#include #include #include diff --git a/include/breadthFirstSearch/binaryBreadthFirstSearch.hpp b/include/breadthFirstSearch/binaryBreadthFirstSearch.hpp index 605733b53be..a3026be2c22 100644 --- a/include/breadthFirstSearch/binaryBreadthFirstSearch.hpp +++ b/include/breadthFirstSearch/binaryBreadthFirstSearch.hpp @@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/basePath_SSEC.hpp" #include "cpp_common/base_graph.hpp" diff --git a/include/breadthFirstSearch/breadthFirstSearch.hpp b/include/breadthFirstSearch/breadthFirstSearch.hpp index 83e139ad583..32c43814f3e 100644 --- a/include/breadthFirstSearch/breadthFirstSearch.hpp +++ b/include/breadthFirstSearch/breadthFirstSearch.hpp @@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include #include diff --git a/include/chinese/chinesePostman.hpp b/include/chinese/chinesePostman.hpp index 501769a1113..dc6adba91e9 100644 --- a/include/chinese/chinesePostman.hpp +++ b/include/chinese/chinesePostman.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "max_flow/minCostMaxFlow.hpp" #include "c_types/path_rt.h" diff --git a/include/coloring/bipartite_driver.hpp b/include/coloring/bipartite_driver.hpp index 10589a5523e..038690ef8bc 100644 --- a/include/coloring/bipartite_driver.hpp +++ b/include/coloring/bipartite_driver.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/coloring/edgeColoring.hpp b/include/coloring/edgeColoring.hpp index 897b3f4aceb..119c77eb0ad 100644 --- a/include/coloring/edgeColoring.hpp +++ b/include/coloring/edgeColoring.hpp @@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/coloring/sequentialVertexColoring.hpp b/include/coloring/sequentialVertexColoring.hpp index d9d3d117aa7..87753aba988 100644 --- a/include/coloring/sequentialVertexColoring.hpp +++ b/include/coloring/sequentialVertexColoring.hpp @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/components/components.hpp b/include/components/components.hpp index 350bcc1738c..ff5ebebecf0 100644 --- a/include/components/components.hpp +++ b/include/components/components.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/components/componentsResult.hpp b/include/components/componentsResult.hpp index a91883f0cca..5e13852aaa3 100644 --- a/include/components/componentsResult.hpp +++ b/include/components/componentsResult.hpp @@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include +#include #include "c_types/ii_t_rt.h" diff --git a/include/components/makeConnected.hpp b/include/components/makeConnected.hpp index 89dbc3272bd..69b4efc69d9 100644 --- a/include/components/makeConnected.hpp +++ b/include/components/makeConnected.hpp @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/contraction/contract.hpp b/include/contraction/contract.hpp index 474b6f5fa54..c270e483906 100644 --- a/include/contraction/contract.hpp +++ b/include/contraction/contract.hpp @@ -33,13 +33,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include -#include "cpp_common/assert.hpp" +#include #include "contraction/contractionGraph.hpp" #include "contraction/ch_graphs.hpp" #include "contraction/linearContraction.hpp" #include "contraction/deadEndContraction.hpp" +#include "cpp_common/assert.hpp" + namespace pgrouting { namespace contraction { diff --git a/include/contraction/contractionGraph.hpp b/include/contraction/contractionGraph.hpp index 75cd790ec97..7268aaa258a 100644 --- a/include/contraction/contractionGraph.hpp +++ b/include/contraction/contractionGraph.hpp @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include @@ -58,7 +59,7 @@ class Pgr_contractionGraph : public Pgr_base_graph() + explicit Pgr_contractionGraph() : Pgr_base_graph() { } diff --git a/include/contraction/linearContraction.hpp b/include/contraction/linearContraction.hpp index 704d0f34f6d..ff165f37436 100644 --- a/include/contraction/linearContraction.hpp +++ b/include/contraction/linearContraction.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/cpp_common/basePath_SSEC.hpp b/include/cpp_common/basePath_SSEC.hpp index aa7d4017fc7..82e1ac293e9 100644 --- a/include/cpp_common/basePath_SSEC.hpp +++ b/include/cpp_common/basePath_SSEC.hpp @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/undefPostgresDefine.hpp" diff --git a/include/cpp_common/base_graph.hpp b/include/cpp_common/base_graph.hpp index 72efb41d136..d0115001e70 100644 --- a/include/cpp_common/base_graph.hpp +++ b/include/cpp_common/base_graph.hpp @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include @@ -265,7 +266,7 @@ class Pgr_base_graph { - inserts the vertices - The vertices must be checked (if necessary) before calling the constructor */ - explicit Pgr_base_graph( + explicit Pgr_base_graph( const std::vector &vertices) : graph(vertices.size()), m_is_directed(t_directed), @@ -295,7 +296,7 @@ class Pgr_base_graph { /** Prepares the _graph_ to be of type gtype with 0 vertices */ - explicit Pgr_base_graph() + explicit Pgr_base_graph() : graph(0), m_is_directed(t_directed), vertIndex(boost::get(boost::vertex_index, graph)), diff --git a/include/cpp_common/basic_edge.hpp b/include/cpp_common/basic_edge.hpp index 5353ebf0149..9ba784466d7 100644 --- a/include/cpp_common/basic_edge.hpp +++ b/include/cpp_common/basic_edge.hpp @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_CPP_COMMON_BASIC_EDGE_HPP_ #pragma once -#include +#include namespace pgrouting { diff --git a/include/cpp_common/basic_vertex.hpp b/include/cpp_common/basic_vertex.hpp index e4300311e2e..e5c4fa99c49 100644 --- a/include/cpp_common/basic_vertex.hpp +++ b/include/cpp_common/basic_vertex.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include "cpp_common/edge_t.hpp" diff --git a/include/cpp_common/bidirectional.hpp b/include/cpp_common/bidirectional.hpp index ded4d8129b0..307a34affa3 100644 --- a/include/cpp_common/bidirectional.hpp +++ b/include/cpp_common/bidirectional.hpp @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/cpp_common/ch_edge.hpp b/include/cpp_common/ch_edge.hpp index 879b9dd7a95..2c7466d7955 100644 --- a/include/cpp_common/ch_edge.hpp +++ b/include/cpp_common/ch_edge.hpp @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include + #include "cpp_common/ch_vertex.hpp" namespace pgrouting { diff --git a/include/cpp_common/ch_vertex.hpp b/include/cpp_common/ch_vertex.hpp index 2de3697d5b6..ec7053cc771 100644 --- a/include/cpp_common/ch_vertex.hpp +++ b/include/cpp_common/ch_vertex.hpp @@ -28,9 +28,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ #ifndef INCLUDE_CPP_COMMON_CH_VERTEX_HPP_ #define INCLUDE_CPP_COMMON_CH_VERTEX_HPP_ + #include #include #include +#include #include "cpp_common/edge_t.hpp" #include "cpp_common/identifiers.hpp" diff --git a/include/cpp_common/get_data.hpp b/include/cpp_common/get_data.hpp index b9b93393c0f..91c6bc43887 100644 --- a/include/cpp_common/get_data.hpp +++ b/include/cpp_common/get_data.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include "cpp_common/info_t.hpp" #include "cpp_common/get_check_data.hpp" diff --git a/include/cpp_common/identifier.hpp b/include/cpp_common/identifier.hpp index 8606a4d5562..073752ba9a1 100644 --- a/include/cpp_common/identifier.hpp +++ b/include/cpp_common/identifier.hpp @@ -31,10 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_CPP_COMMON_IDENTIFIER_HPP_ #pragma once -#if defined(__MINGW32__) || defined(_MSC_VER) -#include -#endif - +#include #include namespace pgrouting { diff --git a/include/cpp_common/identifiers.hpp b/include/cpp_common/identifiers.hpp index 4cc68806c38..3a6d75dda72 100644 --- a/include/cpp_common/identifiers.hpp +++ b/include/cpp_common/identifiers.hpp @@ -54,15 +54,15 @@ class Identifiers { //! @name constructors //@{ - Identifiers() = default; - Identifiers(const std::set& data) : m_ids(data) { + Identifiers() = default; + explicit Identifiers(const std::set& data) : m_ids(data) { } /* @brief initializes with {1 ~ number} * * @params [in] number */ - explicit Identifiers(const size_t number) { + explicit Identifiers(const size_t number) { size_t i(0); std::generate_n(std::inserter(m_ids, m_ids.begin()), number, diff --git a/include/cpp_common/line_vertex.hpp b/include/cpp_common/line_vertex.hpp index f5f6a3c519e..983ab3f0ddd 100644 --- a/include/cpp_common/line_vertex.hpp +++ b/include/cpp_common/line_vertex.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include "cpp_common/edge_t.hpp" diff --git a/include/cpp_common/path_t.hpp b/include/cpp_common/path_t.hpp index 5e862bab73e..ff2b8048a36 100644 --- a/include/cpp_common/path_t.hpp +++ b/include/cpp_common/path_t.hpp @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_CPP_COMMON_PATH_T_HPP_ #pragma once -#include +#include struct Path_t { int64_t node; diff --git a/include/cpp_common/pgdata_fetchers.hpp b/include/cpp_common/pgdata_fetchers.hpp index 5a435476b63..46adc6b60bb 100644 --- a/include/cpp_common/pgdata_fetchers.hpp +++ b/include/cpp_common/pgdata_fetchers.hpp @@ -45,6 +45,7 @@ extern "C" { } #include +#include #include "cpp_common/undefPostgresDefine.hpp" diff --git a/include/cpp_common/to_postgres.hpp b/include/cpp_common/to_postgres.hpp new file mode 100644 index 00000000000..c671cbdd7ab --- /dev/null +++ b/include/cpp_common/to_postgres.hpp @@ -0,0 +1,75 @@ +/*PGR-GNU***************************************************************** +File: to_postgres.hpp + +Copyright (c) 2015 pgRouting developers +Mail: project@pgrouting.org + +------ + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +********************************************************************PGR-GNU*/ + +#ifndef INCLUDE_CPP_COMMON_TO_POSTGRES_HPP_ +#define INCLUDE_CPP_COMMON_TO_POSTGRES_HPP_ +#pragma once + +#include +#include + +#include "c_types/iid_t_rt.h" + +#include "cpp_common/base_graph.hpp" +#include "cpp_common/alloc.hpp" + +namespace pgrouting { +namespace to_postgres { + +/** @brief Stored results on a vector are saved on a C array + * + * @param[in] graph Created graph with the base Graph + * @param[in] results results[i] -> the ith element of the vector contains the results + * @param[out] result_count The size of the vector + * @param[out] result_tuples The C array of + * + * = < i , 0, results[i] > + * + * Currently works for pgr_betweennessCentrality + */ +template +void vector_to_tuple( + const G &graph, + const std::vector results, + size_t &result_count, + IID_t_rt **result_tuples) { + result_count = results.size(); + *result_tuples = pgrouting::pgr_alloc(result_count, (*result_tuples)); + + size_t seq = 0; + for (typename G::V v_i = 0; v_i < graph.num_vertices(); ++v_i) { + (*result_tuples)[seq].from_vid = graph[v_i].id; + /* + * These 2 lines are specifically for pgr_betweennessCentrality + */ + (*result_tuples)[seq].to_vid = 0; + (*result_tuples)[seq].cost = graph.is_directed()? results[v_i] / 2.0 : results[v_i]; + seq++; + } +} + +} // namespace to_postgres +} // namespace pgrouting + +#endif // INCLUDE_CPP_COMMON_TO_POSTGRES_HPP_ diff --git a/include/cpp_common/trsp_pgfetch.hpp b/include/cpp_common/trsp_pgfetch.hpp index cfecff79e02..32885aaeb28 100644 --- a/include/cpp_common/trsp_pgfetch.hpp +++ b/include/cpp_common/trsp_pgfetch.hpp @@ -57,6 +57,8 @@ extern "C" { } #include +#include + #include "cpp_common/undefPostgresDefine.hpp" using Edge_t = struct Edge_rt; diff --git a/include/cpp_common/xy_vertex.hpp b/include/cpp_common/xy_vertex.hpp index 50b475aeac1..baff1e4dbf6 100644 --- a/include/cpp_common/xy_vertex.hpp +++ b/include/cpp_common/xy_vertex.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include +#include #include "cpp_common/bpoint.hpp" #include "cpp_common/edge_xy_t.hpp" diff --git a/include/dagShortestPath/dagShortestPath.hpp b/include/dagShortestPath/dagShortestPath.hpp index 89797f13009..e15eecc66ce 100644 --- a/include/dagShortestPath/dagShortestPath.hpp +++ b/include/dagShortestPath/dagShortestPath.hpp @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/dijkstra/dijkstra.hpp b/include/dijkstra/dijkstra.hpp index a51505d7fa0..7ba860d9bf9 100644 --- a/include/dijkstra/dijkstra.hpp +++ b/include/dijkstra/dijkstra.hpp @@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/dijkstra/dijkstraVia.hpp b/include/dijkstra/dijkstraVia.hpp index 0287870f90c..d135c942582 100644 --- a/include/dijkstra/dijkstraVia.hpp +++ b/include/dijkstra/dijkstraVia.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "dijkstra/dijkstra.hpp" diff --git a/include/dijkstra/drivingDist.hpp b/include/dijkstra/drivingDist.hpp index 39858e4bf51..897cd4ef627 100644 --- a/include/dijkstra/drivingDist.hpp +++ b/include/dijkstra/drivingDist.hpp @@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include diff --git a/include/dominator/lengauerTarjanDominatorTree_driver.hpp b/include/dominator/lengauerTarjanDominatorTree_driver.hpp index 52c1d844a8a..9b73984bdf8 100644 --- a/include/dominator/lengauerTarjanDominatorTree_driver.hpp +++ b/include/dominator/lengauerTarjanDominatorTree_driver.hpp @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include #include diff --git a/include/lineGraph/lineGraphFull.hpp b/include/lineGraph/lineGraphFull.hpp index a6cf3dff594..b7f5ba5967c 100644 --- a/include/lineGraph/lineGraphFull.hpp +++ b/include/lineGraph/lineGraphFull.hpp @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include"c_types/line_graph_full_rt.h" #include "cpp_common/base_graph.hpp" @@ -55,12 +56,12 @@ class Pgr_lineGraphFull : public Pgr_base_graph { typedef typename boost::graph_traits < G >::in_edge_iterator EI_i; - explicit Pgr_lineGraphFull< G, T_V, T_E, t_directed>() + explicit Pgr_lineGraphFull() : Pgr_base_graph(), m_num_edges(0) { } - explicit Pgr_lineGraphFull(const pgrouting::DirectedGraph &digraph) + explicit Pgr_lineGraphFull(const pgrouting::DirectedGraph &digraph) : Pgr_base_graph() { apply_transformation(digraph); store_edge_costs(digraph); diff --git a/include/max_flow/flowgraph.hpp b/include/max_flow/flowgraph.hpp index dfd9b2fe36f..8510d8f8294 100644 --- a/include/max_flow/flowgraph.hpp +++ b/include/max_flow/flowgraph.hpp @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_MAX_FLOW_FLOWGRAPH_HPP_ #pragma once +#include + #include #include diff --git a/include/max_flow/maxflow.hpp b/include/max_flow/maxflow.hpp index ba8d4456e2f..ba67cda6fe0 100644 --- a/include/max_flow/maxflow.hpp +++ b/include/max_flow/maxflow.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "max_flow/flowgraph.hpp" #include diff --git a/include/max_flow/maximumcardinalitymatching.hpp b/include/max_flow/maximumcardinalitymatching.hpp index f10b2bd0e77..e081d3e4689 100644 --- a/include/max_flow/maximumcardinalitymatching.hpp +++ b/include/max_flow/maximumcardinalitymatching.hpp @@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/max_flow/minCostMaxFlow.hpp b/include/max_flow/minCostMaxFlow.hpp index 3d91bb26835..35a4ad0231c 100644 --- a/include/max_flow/minCostMaxFlow.hpp +++ b/include/max_flow/minCostMaxFlow.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/metrics/betweennessCentrality.hpp b/include/metrics/betweennessCentrality.hpp index 8b145c09865..080dc16490e 100644 --- a/include/metrics/betweennessCentrality.hpp +++ b/include/metrics/betweennessCentrality.hpp @@ -30,115 +30,53 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include -#include -#include #include #include -#include #include -#include #include "c_types/iid_t_rt.h" -#include "cpp_common/basePath_SSEC.hpp" #include "cpp_common/base_graph.hpp" #include "cpp_common/interruption.hpp" -#include "cpp_common/alloc.hpp" namespace pgrouting { -template class Pgr_metrics; +namespace metrics { template -void -pgr_betweennesscentrality( - G &graph, - size_t &result_tuple_count, - IID_t_rt **postgres_rows) { - Pgr_metrics fn_centrality; - fn_centrality.betweennessCentrality(graph, result_tuple_count, postgres_rows); -} - -template -class Pgr_metrics { - public: - using Graph = typename G::B_G; - using V = typename G::V; - using E = typename G::E; - typedef typename boost::graph_traits::directed_category directed_category; - - void betweennessCentrality( - const G &graph, - size_t &result_tuple_count, - IID_t_rt **postgres_rows) { - // required parameters - std::vector centrality(boost::num_vertices(graph.graph), 0.0); - auto centrality_map = boost::make_iterator_property_map(centrality.begin(), - boost::get(boost::vertex_index, graph.graph)); - std::vector distance(boost::num_vertices(graph.graph), 0.0); - auto distance_map = boost::make_iterator_property_map(distance.begin(), - boost::get(boost::vertex_index, graph.graph)); - // dummy parameters - std::vector edge_centrality(boost::num_edges(graph.graph), 0.0); - auto edge_centrality_map = boost::make_iterator_property_map(edge_centrality.begin(), - boost::get(&pgrouting::Basic_edge::cost, - graph.graph)); - std::vector> incoming(boost::num_vertices(graph.graph)); - auto incoming_map = boost::make_iterator_property_map(incoming.begin(), - boost::get(boost::vertex_index, graph.graph), - std::vector()); - std::vector dependency(boost::num_vertices(graph.graph), 0.0); - auto dependency_map = boost::make_iterator_property_map(dependency.begin(), - boost::get(boost::vertex_index, graph.graph)); - std::vector path_count(boost::num_vertices(graph.graph), 0); - auto path_count_map = boost::make_iterator_property_map(path_count.begin(), - boost::get(boost::vertex_index, graph.graph)); - auto vertex_index = boost::get(boost::vertex_index, graph.graph); - - /* abort in case of an interruption occurs (e.g. the query is being cancelled) */ - CHECK_FOR_INTERRUPTS(); - - boost::brandes_betweenness_centrality( +std::vector betweennessCentrality( + const G &graph + ) { + std::vector centrality(boost::num_vertices(graph.graph), 0.0); + auto centrality_map = boost::make_iterator_property_map(centrality.begin(), + boost::get(boost::vertex_index, graph.graph)); + + CHECK_FOR_INTERRUPTS(); + + try { + boost::brandes_betweenness_centrality( + graph.graph, + centrality_map); + + if (boost::num_vertices(graph.graph) > 2) { + boost::relative_betweenness_centrality( graph.graph, - centrality_map, - edge_centrality_map, - incoming_map, - distance_map, - dependency_map, - path_count_map, - vertex_index, - get(&pgrouting::Basic_edge::cost, graph.graph)); - - if (boost::num_vertices(graph.graph) > 2) { - boost::relative_betweenness_centrality( - graph.graph, - centrality_map); + centrality_map); + } + } catch (boost::exception const& ex) { + (void)ex; + throw; + } catch (std::exception &e) { + (void)e; + throw; + } catch (...) { + throw; } - generate_results(graph, centrality, result_tuple_count, postgres_rows); - } + return centrality; +} - private: - void generate_results( - const G &graph, - const std::vector centrality_results, - size_t &result_tuple_count, - IID_t_rt **postgres_rows) const { - result_tuple_count = centrality_results.size(); - *postgres_rows = pgr_alloc(result_tuple_count, (*postgres_rows)); - - size_t seq = 0; - for (typename G::V v_i = 0; v_i < graph.num_vertices(); ++v_i) { - (*postgres_rows)[seq].from_vid = graph[v_i].id; - (*postgres_rows)[seq].to_vid = 0; - (*postgres_rows)[seq].cost = centrality_results[v_i]; - if (std::is_same::value) { - (*postgres_rows)[seq].cost = centrality_results[v_i]/2.0; - } - seq++; - } - } -}; +} // namespace metrics } // namespace pgrouting #endif // INCLUDE_METRICS_BETWEENNESSCENTRALITY_HPP_ diff --git a/include/ordering/cuthillMckeeOrdering.hpp b/include/ordering/cuthillMckeeOrdering.hpp index 29997bf3fd0..121b4b3258d 100644 --- a/include/ordering/cuthillMckeeOrdering.hpp +++ b/include/ordering/cuthillMckeeOrdering.hpp @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/planar/boyerMyrvold.hpp b/include/planar/boyerMyrvold.hpp index 2c8258df5b0..c57333d8af3 100644 --- a/include/planar/boyerMyrvold.hpp +++ b/include/planar/boyerMyrvold.hpp @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include +#include #include #include diff --git a/include/spanningTree/details.hpp b/include/spanningTree/details.hpp index 8cc64f36973..b67f64b5de2 100644 --- a/include/spanningTree/details.hpp +++ b/include/spanningTree/details.hpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include +#include + #include "c_types/mst_rt.h" namespace pgrouting { diff --git a/include/spanningTree/kruskal.hpp b/include/spanningTree/kruskal.hpp index 23d588301ae..1f6131709c7 100644 --- a/include/spanningTree/kruskal.hpp +++ b/include/spanningTree/kruskal.hpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include +#include + #include #include "spanningTree/mst.hpp" #include "cpp_common/interruption.hpp" diff --git a/include/spanningTree/mst.hpp b/include/spanningTree/mst.hpp index af0e24b426a..1dda2c6bf60 100644 --- a/include/spanningTree/mst.hpp +++ b/include/spanningTree/mst.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/spanningTree/prim.hpp b/include/spanningTree/prim.hpp index 48b21a6452b..2c4726a21ae 100644 --- a/include/spanningTree/prim.hpp +++ b/include/spanningTree/prim.hpp @@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include #include diff --git a/include/traversal/depthFirstSearch.hpp b/include/traversal/depthFirstSearch.hpp index 30c10b708bf..76327df136e 100644 --- a/include/traversal/depthFirstSearch.hpp +++ b/include/traversal/depthFirstSearch.hpp @@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include #include diff --git a/include/trsp/edgeInfo.hpp b/include/trsp/edgeInfo.hpp index d015008c9cb..d131511b8f1 100644 --- a/include/trsp/edgeInfo.hpp +++ b/include/trsp/edgeInfo.hpp @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_TRSP_EDGEINFO_HPP_ #include +#include #include "cpp_common/edge_t.hpp" diff --git a/include/trsp/trspHandler.hpp b/include/trsp/trspHandler.hpp index 772f6666972..7888831556f 100644 --- a/include/trsp/trspHandler.hpp +++ b/include/trsp/trspHandler.hpp @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/basePath_SSEC.hpp" diff --git a/include/tsp/tsp.hpp b/include/tsp/tsp.hpp index 9f35c6ea223..93786f426ca 100644 --- a/include/tsp/tsp.hpp +++ b/include/tsp/tsp.hpp @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include #include diff --git a/include/visitors/dfs_visitor.hpp b/include/visitors/dfs_visitor.hpp index 3ddd341b757..0a4fcc1c758 100644 --- a/include/visitors/dfs_visitor.hpp +++ b/include/visitors/dfs_visitor.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include diff --git a/include/vrp/dnode.hpp b/include/vrp/dnode.hpp index 9954b6a8578..955a0292e4b 100644 --- a/include/vrp/dnode.hpp +++ b/include/vrp/dnode.hpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include + #include "cpp_common/identifier.hpp" #include "cpp_common/messages.hpp" diff --git a/include/vrp/order.hpp b/include/vrp/order.hpp index 3d77aaaeb67..e63b4943420 100644 --- a/include/vrp/order.hpp +++ b/include/vrp/order.hpp @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include +#include + #include "cpp_common/identifier.hpp" #include "cpp_common/identifiers.hpp" #include "vrp/vehicle_node.hpp" diff --git a/include/vrp/tw_node.hpp b/include/vrp/tw_node.hpp index 812edfff8a3..484bd77dcc3 100644 --- a/include/vrp/tw_node.hpp +++ b/include/vrp/tw_node.hpp @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include +#include #include "cpp_common/orders_t.hpp" #include "cpp_common/vehicle_t.hpp" diff --git a/include/vrp/vehicle.hpp b/include/vrp/vehicle.hpp index f35c6af705e..5c08f0826b2 100644 --- a/include/vrp/vehicle.hpp +++ b/include/vrp/vehicle.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/identifier.hpp" diff --git a/include/vrp/vehicle_pickDeliver.hpp b/include/vrp/vehicle_pickDeliver.hpp index bb6a816e7fb..166a8fe7951 100644 --- a/include/vrp/vehicle_pickDeliver.hpp +++ b/include/vrp/vehicle_pickDeliver.hpp @@ -29,6 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #pragma once #include +#include + #include "vrp/order.hpp" #include "vrp/pd_orders.hpp" #include "vrp/tw_node.hpp" diff --git a/include/withPoints/withPoints.hpp b/include/withPoints/withPoints.hpp index 6fa13398b2a..05b3fc788c9 100644 --- a/include/withPoints/withPoints.hpp +++ b/include/withPoints/withPoints.hpp @@ -29,7 +29,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #ifndef INCLUDE_WITHPOINTS_WITHPOINTS_HPP_ #define INCLUDE_WITHPOINTS_WITHPOINTS_HPP_ #pragma once + #include +#include #include "cpp_common/point_on_edge_t.hpp" #include "cpp_common/messages.hpp" diff --git a/include/yen/ksp.hpp b/include/yen/ksp.hpp index 11b10e36d76..ce610d9b22f 100644 --- a/include/yen/ksp.hpp +++ b/include/yen/ksp.hpp @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "dijkstra/dijkstra.hpp" #include "cpp_common/assert.hpp" diff --git a/include/yen/turnRestrictedPath.hpp b/include/yen/turnRestrictedPath.hpp index a314b3a4625..d6b737b15df 100644 --- a/include/yen/turnRestrictedPath.hpp +++ b/include/yen/turnRestrictedPath.hpp @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "yen/ksp.hpp" #include "cpp_common/assert.hpp" diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index b287a0abb5c..3774321f69a 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -15522,6 +15522,12 @@ msgstr "" msgid "pgRouting 3.7" msgstr "" +msgid "pgRouting 3.7.2 Release Notes" +msgstr "" + +msgid "No Changes Yet" +msgstr "" + msgid "pgRouting 3.7.1 Release Notes" msgstr "" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index 00c9f9ea234..7f2025caf8e 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -13189,6 +13189,12 @@ msgstr "" msgid "pgRouting 3.7" msgstr "" +msgid "pgRouting 3.7.2 Release Notes" +msgstr "" + +msgid "No Changes Yet" +msgstr "" + msgid "pgRouting 3.7.1 Release Notes" msgstr "" diff --git a/pgtap/metrics/betweennessCentrality/edge_cases.pg b/pgtap/metrics/betweennessCentrality/edge_cases.pg index d4582a48891..14bc11acb38 100644 --- a/pgtap/metrics/betweennessCentrality/edge_cases.pg +++ b/pgtap/metrics/betweennessCentrality/edge_cases.pg @@ -75,7 +75,7 @@ RETURN QUERY SELECT lives_ok('idless4_q'); RETURN QUERY -SELECT results_eq('idless4_q', 'idless4_r'); +SELECT results_eq('idless4_q', 'idless4_r', 'test 4'); PREPARE idless3_q AS @@ -95,7 +95,7 @@ RETURN QUERY SELECT lives_ok('idless3_q'); RETURN QUERY -SELECT results_eq('idless3_q', 'idless3_r'); +SELECT results_eq('idless3_q', 'idless3_r', 'test 6'); PREPARE idless2_q AS SELECT * FROM pgr_betweennessCentrality( @@ -120,7 +120,7 @@ SELECT results_eq('idless2_q', 'idless2_r'); PREPARE idless5ud_q AS SELECT * FROM pgr_betweennessCentrality( 'SELECT id, source, target, cost, reverse_cost - FROM edges WHERE id < 5', directed => false ) ORDER BY vid; + FROM edges WHERE id < 5', directed => false ) ORDER BY vid; PREPARE idless5ud_r AS SELECT * FROM (VALUES @@ -135,18 +135,20 @@ RETURN QUERY SELECT lives_ok('idless5ud_q'); RETURN QUERY -SELECT results_eq('idless5ud_q', 'idless5ud_r'); +SELECT results_eq('idless5ud_q', 'idless5ud_r', 'test 10'); + PREPARE idless4ud_q AS SELECT * FROM pgr_betweennessCentrality( 'SELECT id, source, target, cost, reverse_cost - FROM edges WHERE id < 4', directed => false ) ORDER BY vid; + FROM edges WHERE id < 4', directed => false) ORDER BY vid; PREPARE idless4ud_r AS SELECT * FROM (VALUES (5::BIGINT , 0::FLOAT), (6 , 0.6666666666666666), - (10 , 0.6666666666666666), (15 , 0)) + (10 , 0.6666666666666666), + (15 , 0)) AS t(vid, centrality); RETURN QUERY @@ -159,7 +161,7 @@ SELECT results_eq('idless4ud_q', 'idless4ud_r'); PREPARE idless3ud_q AS SELECT * FROM pgr_betweennessCentrality( 'SELECT id, source, target, cost, reverse_cost - FROM edges WHERE id < 3', directed => false ) ORDER BY vid; + FROM edges WHERE id < 3', directed => false) ORDER BY vid; PREPARE idless3ud_r AS SELECT * FROM (VALUES @@ -172,7 +174,7 @@ RETURN QUERY SELECT lives_ok('idless3ud_q'); RETURN QUERY -SELECT results_eq('idless3ud_q', 'idless3ud_r'); +SELECT results_eq('idless3ud_q', 'idless3ud_r', 'test 14'); PREPARE idless2ud_q AS SELECT * FROM pgr_betweennessCentrality( @@ -190,7 +192,7 @@ RETURN QUERY SELECT lives_ok('idless2ud_q'); RETURN QUERY -SELECT results_eq('idless2ud_q', 'idless2ud_r'); +SELECT results_eq('idless2ud_q', 'idless2ud_r', 'test 16'); /* Explicit Directed Cases */ @@ -198,7 +200,7 @@ SELECT results_eq('idless2ud_q', 'idless2ud_r'); PREPARE idless5d_q AS SELECT * FROM pgr_betweennessCentrality( 'SELECT id, source, target, cost, reverse_cost - FROM edges WHERE id < 5', directed => true ) ORDER BY vid; + FROM edges WHERE id < 5', directed => true ) ORDER BY vid; PREPARE idless5d_r AS SELECT * FROM (VALUES @@ -213,13 +215,13 @@ RETURN QUERY SELECT lives_ok('idless5d_q'); RETURN QUERY -SELECT results_eq('idless5d_q', 'idless5d_r'); +SELECT results_eq('idless5d_q', 'idless5d_r', 'test 18'); PREPARE idless4d_q AS SELECT * FROM pgr_betweennessCentrality( 'SELECT id, source, target, cost, reverse_cost - FROM edges WHERE id < 4', directed => true ) ORDER BY vid; + FROM edges WHERE id < 4', directed => true) ORDER BY vid; PREPARE idless4d_r AS SELECT * FROM (VALUES @@ -233,13 +235,13 @@ RETURN QUERY SELECT lives_ok('idless4d_q'); RETURN QUERY -SELECT results_eq('idless4d_q', 'idless4d_r'); +SELECT results_eq('idless4d_q', 'idless4d_r', 'test 20'); PREPARE idless3d_q AS SELECT * FROM pgr_betweennessCentrality( 'SELECT id, source, target, cost, reverse_cost - FROM edges WHERE id < 3', directed => true ) ORDER BY vid; + FROM edges WHERE id < 3', directed => true) ORDER BY vid; PREPARE idless3d_r AS SELECT * FROM (VALUES @@ -252,7 +254,8 @@ RETURN QUERY SELECT lives_ok('idless3d_q'); RETURN QUERY -SELECT results_eq('idless3d_q', 'idless3d_r'); +SELECT results_eq('idless3d_q', 'idless3d_r', 'test 22'); + PREPARE idless2d_q AS SELECT * FROM pgr_betweennessCentrality( @@ -270,7 +273,7 @@ RETURN QUERY SELECT lives_ok('idless2d_q'); RETURN QUERY -SELECT results_eq('idless2d_q', 'idless2d_r'); +SELECT results_eq('idless2d_q', 'idless2d_r', 'test 24'); END; $BODY$ diff --git a/src/metrics/betweennessCentrality.c b/src/metrics/betweennessCentrality.c index bbebd4f3cd7..6890c259a93 100644 --- a/src/metrics/betweennessCentrality.c +++ b/src/metrics/betweennessCentrality.c @@ -60,7 +60,7 @@ process( result_count, &log_msg, &err_msg); - time_msg(" processing Centrality", start_t, clock()); + time_msg(" processing pgr_betweenessCentrality", start_t, clock()); if (err_msg && (*result_tuples)) { pfree(*result_tuples); diff --git a/src/metrics/betweennessCentrality_driver.cpp b/src/metrics/betweennessCentrality_driver.cpp index 5b71b132347..e015b2280b2 100644 --- a/src/metrics/betweennessCentrality_driver.cpp +++ b/src/metrics/betweennessCentrality_driver.cpp @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "metrics/betweennessCentrality.hpp" #include "cpp_common/pgdata_getters.hpp" - +#include "cpp_common/to_postgres.hpp" #include "cpp_common/assert.hpp" @@ -61,6 +61,9 @@ pgr_do_betweennessCentrality( pgassert(!(*return_tuples)); pgassert(*return_count == 0); + using pgrouting::metrics::betweennessCentrality; + using pgrouting::to_postgres::vector_to_tuple; + hint = edges_sql; auto edges = pgrouting::pgget::get_edges(std::string(edges_sql), true, true); @@ -73,12 +76,12 @@ pgr_do_betweennessCentrality( log << "Processing Directed graph\n"; pgrouting::DirectedGraph digraph; digraph.insert_edges(edges); - pgr_betweennesscentrality(digraph, *return_count, return_tuples); + vector_to_tuple(digraph, betweennessCentrality(digraph), *return_count, return_tuples); } else { log << "Processing Undirected graph\n"; pgrouting::UndirectedGraph undigraph; undigraph.insert_edges(edges); - pgr_betweennesscentrality(undigraph, *return_count, return_tuples); + vector_to_tuple(undigraph, betweennessCentrality(undigraph), *return_count, return_tuples); } diff --git a/tools/developer/taptest.sh b/tools/developer/taptest.sh index 25777967ecc..e5461cee292 100755 --- a/tools/developer/taptest.sh +++ b/tools/developer/taptest.sh @@ -38,7 +38,7 @@ QUIET="-q" PGDATABASE="___pgr___test___" PGRVERSION="3.6.1 3.6.0 3.5.1 3.5.0 3.2.0 3.1.3 3.0.6" -PGRVERSION="3.7.0" +PGRVERSION="3.7.2" for v in ${PGRVERSION} diff --git a/tools/scripts/test_shell.sh b/tools/scripts/test_shell.sh index e25fb3f7db6..d63fa74b8f4 100755 --- a/tools/scripts/test_shell.sh +++ b/tools/scripts/test_shell.sh @@ -29,7 +29,7 @@ do if [ "${f}" = "tools/developer/addNewVersionLink.sh" ] ; then result=$(shellcheck --exclude=SC2046,SC2016 "${f}") elif [ "${f}" = "ci/winnie/build_pgrouting.sh" ] ; then - result=$(shellcheck --exclude=SC2046,SC2016,SC2141,SC2086 "${f}") + result=$(shellcheck --exclude=SC2116,SC2046,SC2016,SC2141,SC2086 "${f}") else result=$(shellcheck --exclude=SC2141 "${f}") fi