Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
old_pgr: [3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0, 3.2.1, 3.2.1]
old_pgr: [3.3.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0, 3.2.1, 3.2.1]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Test old version after update
run: |
sudo service postgresql start
sudo -u postgres psql -p 5432 -d ___pgr___test___ -c "ALTER EXTENSION pgrouting UPDATE TO '3.3.0';"
sudo -u postgres psql -p 5432 -d ___pgr___test___ -c "ALTER EXTENSION pgrouting UPDATE TO '3.3.1';"
sudo -u postgres psql -p 5432 -d ___pgr___test___ -c "SELECT * FROM pgr_full_version();"
sudo -u postgres bash ./tools/testers/pg_prove_tests.sh postgres 5432
sudo -u postgres dropdb -p 5432 ___pgr___test___
Expand All @@ -113,6 +113,6 @@ jobs:

- name: Test old version with new lib after update
run: |
sudo -u postgres psql -p 5432 -d ___pgr___test___ -c "ALTER EXTENSION pgrouting UPDATE TO '3.3.0';"
sudo -u postgres psql -p 5432 -d ___pgr___test___ -c "ALTER EXTENSION pgrouting UPDATE TO '3.3.1';"
sudo -u postgres psql -p 5432 -d ___pgr___test___ -c "SELECT * FROM pgr_full_version();"
sudo -u postgres bash ./tools/testers/pg_prove_tests.sh postgres 5432
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: |
mkdir build
cd build
cmake -DPOSTGRESQL_BIN=${{ env.POSTGRESQL_DIR }}\bin -DPOSTGRESQL_INCLUDE_DIR="${{ env.POSTGRESQL_DIR }}\include;${{ env.POSTGRESQL_DIR }}\include\server" -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF ..
cmake -DPOSTGRESQL_BIN=${{ env.POSTGRESQL_DIR }}\bin -DPOSTGRESQL_INCLUDE_DIR="${{ env.POSTGRESQL_DIR }}\include;${{ env.POSTGRESQL_DIR }}\include\server" -G"Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF ..
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include(pgr/BuildType)
#---------------------------------------------
#---------------------------------------------

project(PGROUTING VERSION 3.3.0
project(PGROUTING VERSION 3.3.1
LANGUAGES C CXX )
set(PROJECT_VERSION_DEV "")
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
Expand All @@ -33,6 +33,7 @@ string(TIMESTAMP COMPILATION_DATE "%Y/%m/%d")

set(MINORS 3.3 3.2 3.1 3.0 2.6)
set(OLD_SIGNATURES
3.3.0
3.2.2 3.2.1 3.2.0
3.1.4 3.1.3 3.1.2 3.1.1 3.1.0
3.0.6 3.0.5 3.0.4 3.0.3 3.0.2 3.0.1 3.0.0
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on Github.
**Issue fixes**

* [#2216](https://github.com/pgRouting/pgrouting/issues/2216): Warnings when using clang
* [#2266](https://github.com/pgRouting/pgrouting/issues/2266): Error processing restrictions


pgRouting 3.3.0 Release Notes
-------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ pdf_style_path = ['.', '_styles']
linkcheck_ignore = [
'https://docs.pgrouting.org/latest/en/pgr_edgeColoring.html',


# link failing used in contraction-family
'https://algo2.iti.kit.edu/documents/routeplanning/geisberger_dipl.pdf'

# FIXME: tmp disable due to Retry-After header for rate-limiting by Github not respected
# (see: https://github.com/sphinx-doc/sphinx/issues/7388)
Expand Down
2 changes: 2 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ on Github.
.. rubric:: Issue fixes

* `#2216 <https://github.com/pgRouting/pgrouting/issues/2216>`__: Warnings when using clang
* `#2266 <https://github.com/pgRouting/pgrouting/issues/2266>`__: Error processing restrictions


pgRouting 3.3.0 Release Notes
-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docqueries/version/doc-full_version.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SET
SELECT version, library FROM pgr_full_version();
version | library
---------+-----------------
3.3.0 | pgrouting-3.3.0
3.3.1 | pgrouting-3.3.1
(1 row)

/* -- q2 */
Expand Down
2 changes: 1 addition & 1 deletion docqueries/version/doc-version.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SET
SELECT pgr_version();
pgr_version
-------------
3.3.0
3.3.1
(1 row)

/* -- q2 */
Expand Down
2 changes: 2 additions & 0 deletions include/cpp_common/basePath_SSEC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>

#include "c_types/path_rt.h"
#include "cpp_common/path_t.h"
Expand Down Expand Up @@ -77,6 +78,7 @@ class Path {
const Path_t& operator[](size_t i) const {return path[i];}
Path_t& operator[](size_t i) {return path[i];}
Path& renumber_vertices(int64_t value);
Path& renumber_vertices(const std::map<int64_t, int64_t>&);

pthIt begin() {return path.begin();}
pthIt end() {return path.end();}
Expand Down
27 changes: 18 additions & 9 deletions include/trsp/pgr_trspHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <utility>
#include <functional>
#include <limits>
#include <set>


#include "cpp_common/basePath_SSEC.hpp"
Expand Down Expand Up @@ -114,6 +115,10 @@ class Pgr_trspHandler {
const int64_t start_vertex,
const int64_t end_vertex);

std::deque<Path> process(
const std::map<int64_t,
std::set<int64_t>> &combinations);

std::deque<Path> process(
const std::vector<int64_t> sources,
const std::vector<int64_t> targets);
Expand All @@ -127,6 +132,10 @@ class Pgr_trspHandler {
const size_t edge_count,
const bool directed);

void add_point_edges(
const std::vector<Edge_t> &new_edges,
const bool directed);

int initialize_restrictions(
const std::vector<Rule> &ruleList);

Expand All @@ -138,7 +147,6 @@ class Pgr_trspHandler {
EdgeInfo dijkstra_exploration();



void explore(
int64_t cur_node,
const EdgeInfo cur_edge,
Expand All @@ -148,7 +156,7 @@ class Pgr_trspHandler {
int64_t cur_node,
const EdgeInfo &new_edge,
bool isStart);
bool addEdge(const Edge_t edgeIn);
bool addEdge(Edge_t edgeIn, bool);

void connectStartEdge(
size_t firstEdge_idx,
Expand All @@ -160,10 +168,8 @@ class Pgr_trspHandler {

double construct_path(int64_t ed_id, Position pos);


int64_t renumber_edges(
Edge_t *edges,
const size_t edge_count) const;
void renumber_edges(Edge_t*, const size_t);
void renumber_edges(Edge_t*, const size_t, std::vector<Edge_t>&);

void add_to_que(
double cost,
Expand All @@ -180,7 +186,8 @@ class Pgr_trspHandler {

/**
* Used only to veryfy that there are no reppetitions inserted
* the way it orks, repeating edges id is not allowed
* the way it works, repeating edges id is not allowed
* TODO when using points edges id are repeated
*/
std::map<int64_t, int64_t> m_mapEdgeId2Index;

Expand All @@ -189,6 +196,10 @@ class Pgr_trspHandler {
*/
std::map<int64_t, std::vector<size_t>> m_adjacency;

/* id -> idx */
std::map<int64_t, int64_t> m_id_to_idx;
/* idx -> id */
std::map<int64_t, int64_t> m_idx_to_id;

int64_t m_start_vertex;
int64_t m_end_vertex;
Expand All @@ -198,8 +209,6 @@ class Pgr_trspHandler {
*/
int64_t current_node;

int64_t m_min_id;

Path m_path;

std::vector<Predecessor> m_parent;
Expand Down
2 changes: 1 addition & 1 deletion pgtap/coloring/edgeColoring/edge-cases.sql
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ PREPARE edgeColoring6 AS
SELECT * FROM pgr_edgeColoring('q6');

RETURN QUERY
SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q6')), 3, 'Three colors are expected');
SELECT ok((SELECT count(DISTINCT color_id) <= 3 FROM pgr_edgeColoring('q6')), 'At most three colors are expected');

-- changing the order of the edges will change the number of colors expected

Expand Down
9 changes: 9 additions & 0 deletions src/common/basePath_SSEC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <iostream>
#include <algorithm>
#include <utility>
#include <map>

#include "c_types/path_rt.h"
#include "cpp_common/pgr_assert.h"

Path& Path::renumber_vertices(const std::map<int64_t, int64_t>& idx_to_id) {
for (auto &r : path) {
r.node = idx_to_id.at(r.node);
}
m_start_id = idx_to_id.at(m_start_id);
m_end_id = idx_to_id.at(m_end_id);
return *this;
}

Path& Path::renumber_vertices(int64_t value) {
for (auto &r : path) {
Expand Down
14 changes: 7 additions & 7 deletions src/trsp/new_trsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ void compute_trsp(
size_t total_restrictions = 0;
pgr_get_restrictions(restrictions_sql, &restrictions, &total_restrictions);


if (total_edges == 0) {
pgr_SPI_finish();
return;
}

size_t size_start_vidsArr = 0;
int64_t* start_vidsArr = (int64_t*)
pgr_get_bigIntArray(&size_start_vidsArr, starts);
Expand Down Expand Up @@ -137,15 +143,9 @@ _trsp(PG_FUNCTION_ARGS) {
PG_GETARG_BOOL(4),
&result_tuples, &result_count);

//-----------------------------------------------

#if PGSQL_VERSION > 95
funcctx->max_calls = result_count;
#else
funcctx->max_calls = (uint32_t)result_count;
#endif

funcctx->user_fctx = result_tuples;

if (get_call_result_type(fcinfo, NULL, &tuple_desc)
!= TYPEFUNC_COMPOSITE) {
ereport(ERROR,
Expand Down
Loading