-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning up includes part-3 #483
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
#include <vector> | ||
#include "./contractGraph_driver.h" | ||
#include "./contract_function.h" | ||
#include "./../../common/src/baseGraph.hpp" | ||
|
||
// #define DEBUG | ||
|
||
|
@@ -64,7 +65,11 @@ do_pgr_contractGraph( | |
size_t *return_count, | ||
char ** err_msg){ | ||
std::ostringstream log; | ||
std::ostringstream graphnameStream,edgeStream,removedEStream,removedVStream,psuedoEStream; | ||
std::ostringstream contracted_graph_name; | ||
std::ostringstream contracted_graph_blob; | ||
std::ostringstream removedEdges; | ||
std::ostringstream removedVertices; | ||
std::ostringstream psuedoEdges; | ||
try { | ||
|
||
if (total_tuples == 1) { | ||
|
@@ -78,7 +83,6 @@ do_pgr_contractGraph( | |
graphType gType = directed? DIRECTED: UNDIRECTED; | ||
const int initial_size = total_tuples; | ||
|
||
std::deque< Path >paths; | ||
log << "Level" << level << "\n"; | ||
if (directed) { | ||
log << "Working with directed Graph\n"; | ||
|
@@ -87,28 +91,52 @@ do_pgr_contractGraph( | |
#ifdef DEBUG | ||
digraph.print_graph(log); | ||
#endif | ||
//pgr_dijkstra(digraph, paths, start_vid, end_vertices, false); | ||
/* | ||
Function call to get the contracted graph. | ||
|
||
fetch_contracted_graph(digraph,level, | ||
contracted_graph_name,contracted_graph_blob,removedEdges, | ||
removedVertices,psuedoEdges | ||
); | ||
return_tuples = get_memory (1, pgr_contracted_blob); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This goes out of the if then else, |
||
return_tuples->contracted_graph_name=strdup(contracted_graph_name.str().c_str()); | ||
return_tuples->contracted_graph_blob=strdup(contracted_graph_blob.str().c_str()); | ||
return_tuples->removedVertices=strdup(removedVertices.str().c_str()); | ||
return_tuples->removedEdges=strdup(removedEdges.str().c_str()); | ||
return_tuples->psuedoEdges=strdup(psuedoEdges.str().c_str()); | ||
|
||
|
||
*/ | ||
|
||
|
||
} else { | ||
log << "Working with Undirected Graph\n"; | ||
Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size); | ||
undigraph.graph_insert_data(data_edges, total_tuples); | ||
#ifdef DEBUG | ||
undigraph.print_graph(log); | ||
#endif | ||
//pgr_dijkstra(undigraph, paths, start_vid, end_vertices, false); | ||
} | ||
|
||
size_t count(count_tuples(paths)); | ||
|
||
if (count == 0) { | ||
(*return_tuples) = NULL; | ||
(*return_count) = 0; | ||
log << | ||
"No paths found between Starting and any of the Ending vertices\n"; | ||
*err_msg = strdup(log.str().c_str()); | ||
return; | ||
/* | ||
Function call to get the contracted graph. | ||
|
||
return_tuples = get_memory (1, pgr_contracted_blob); | ||
fetch_contracted_graph(undigraph,level, | ||
contracted_graph_name,contracted_graph_blob,removedEdges, | ||
removedVertices,psuedoEStream | ||
); | ||
(return_tuples)->contracted_graph_name=strdup(contracted_graph_name.str().c_str()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This goes out of the if then else, and of course only once. |
||
(return_tuples)->contracted_graph_blob=strdup(contracted_graph_blob.str().c_str()); | ||
(return_tuples)->removedVertices=strdup(removedVertices.str().c_str()); | ||
(return_tuples)->removedEdges=strdup(removedEdges.str().c_str()); | ||
(return_tuples)->psuedoEdges=strdup(psuedoEdges.str().c_str()); | ||
*/ | ||
|
||
} | ||
|
||
|
||
|
||
(*return_tuples) = NULL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once you put the code of : (you forgot the the include of the memory function... check the history of skype) (you forgot the call to get_memory) |
||
(*return_count) = 0; | ||
#if 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ones go inside the try
only log is outside the try