From 10ea331909e212231f3add7293cd51385d08f479 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 15 Sep 2010 13:48:31 +0000 Subject: [PATCH] sorting input edges with multiple core if available --- DataStructures/StaticGraph.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DataStructures/StaticGraph.h b/DataStructures/StaticGraph.h index 918ab970f..903fa5f37 100644 --- a/DataStructures/StaticGraph.h +++ b/DataStructures/StaticGraph.h @@ -22,7 +22,11 @@ or see http://www.gnu.org/licenses/agpl.txt. #define STATICGRAPH_H_INCLUDED #include +#ifdef _GLIBCXX_PARALLEL +#include +#else #include +#endif #include "../typedefs.h" @@ -45,8 +49,11 @@ public: }; StaticGraph( int nodes, std::vector< InputEdge > &graph ) { - +#ifdef _GLIBCXX_PARALLEL + __gnu_parallel::sort( graph.begin(), graph.end() ); +#else std::sort( graph.begin(), graph.end() ); +#endif _numNodes = nodes; _numEdges = ( EdgeIterator ) graph.size(); _nodes.resize( _numNodes + 1);