Skip to content

Commit 60b4e71

Browse files
committed
More fixes from issues found by rabbit
1 parent b82fbc9 commit 60b4e71

7 files changed

Lines changed: 13 additions & 7 deletions

File tree

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To see all issues & pull requests closed by this release see the
2424
* [#3086](https://github.com/pgRouting/pgrouting/issues/3086): MaxFlow: create and use a process and driver
2525
* [#3089](https://github.com/pgRouting/pgrouting/issues/3089): edgeDisjoint and bellmanFord use shortestPath driver and
2626
process
27-
* [#3100](https://github.com/pgRouting/pgrouting/issues/3100): Coloring: create an use a process & driver
27+
* [#3100](https://github.com/pgRouting/pgrouting/issues/3100): Coloring: create and use a process & driver
2828

2929
**Bug Fixes**
3030

doc/src/release_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To see all issues & pull requests closed by this release see the
4949
* :issue:`3086`: MaxFlow: create and use a process and driver
5050
* :issue:`3089`: edgeDisjoint and bellmanFord use shortestPath driver and
5151
process
52-
* :issue:`3100`: Coloring: create an use a process & driver
52+
* :issue:`3100`: Coloring: create and use a process & driver
5353

5454
.. rubric:: Bug Fixes
5555

include/coloring/edgeColoring.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3939
namespace pgrouting {
4040
namespace functions {
4141

42-
std::vector<II_t_rt> edgeColoring(pgrouting::UndirectedGraph);
42+
std::vector<II_t_rt> edgeColoring(const pgrouting::UndirectedGraph&);
4343

4444

4545
} // namespace functions

pgtap/coloring/edgeColoring/edge_cases.pg

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ FROM (VALUES
113113
(1, 3, 6, 20, 15),
114114
(2, 3, 8, 10, -10),
115115
(3, 6, 8, -1, 12))
116-
AS t(id, source, target, cost, reverse_cost);
116+
AS t(id, source, target, cost, reverse_cost)
117+
ORDER BY id ASC;
117118

118119
RETURN QUERY
119120
SELECT CASE WHEN min_lib_version('4.1.0') THEN
@@ -256,7 +257,10 @@ FROM (VALUES
256257
AS t(id, source, target, cost, reverse_cost);
257258

258259
RETURN QUERY
259-
SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q15')), 1, 'q15: One color is used');
260+
SELECT ok(
261+
(SELECT count(*) = 2 AND count(DISTINCT color) = 1 FROM pgr_edgeColoring('q15')),
262+
'q15: Two rows are returned and one color is used'
263+
);
260264

261265
END;
262266
$BODY$

src/coloring/bipartite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ std::vector<II_t_rt> get_bipartition(const pgrouting::UndirectedGraph &graph) {
4343
using V_i = pgrouting::UndirectedGraph::V_i;
4444

4545
std::vector<II_t_rt> results;
46-
std::vector<boost::default_color_type> partition(graph.num_vertices());
46+
std::vector<boost::default_color_type> partition(boost::num_vertices(graph.graph));
4747
auto partition_map =
4848
make_iterator_property_map(partition.begin(), boost::get(boost::vertex_index, graph.graph));
4949

src/coloring/coloring_driver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ void do_coloring(
6060
std::ostringstream &notice,
6161
std::ostringstream &err) {
6262
std::string hint = "";
63+
return_tuples = nullptr;
64+
return_count = 0;
6365

6466
try {
6567
if (edges_sql.empty()) {

src/coloring/edgeColoring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace pgrouting {
4646
namespace functions {
4747

4848
std::vector<II_t_rt>
49-
edgeColoring(const pgrouting::UndirectedGraph g) {
49+
edgeColoring(const pgrouting::UndirectedGraph &g) {
5050
std::vector<II_t_rt> results(boost::num_edges(g.graph));
5151
using B_G = pgrouting::UndirectedGraph::B_G;
5252
using E = pgrouting::UndirectedGraph::E;

0 commit comments

Comments
 (0)