Revision d5b7a27f custompackages/graphparser/src/graph_manager.cpp
custompackages/graphparser/src/graph_manager.cpp  

1  1 
#include "graph_manager.h" 
2  2  
3  3 
// CONSTRUCTOR 
4 
GraphManager::GraphManager() { 

4 
GraphManager::GraphManager(bool weighted_graph) : weighted_graph_(weighted_graph) {


5  5 
v_index_pmap_ = VertexIndexPMap(v_index_std_map_); 
6  6 
e_index_pmap_ = EdgeIndexPMap(e_index_std_map_); 
7  7 
} 
8  8  
9  9 
GraphManager::GraphManager(const GraphManager& other) { 
10 
cout << "\n\n*******COPY CONSTRUCTOR******\n\n";


10 
// cout << "\n*******COPY CONSTRUCTOR******\n";


11  11 
g_ = other.g_; 
12 
weighted_graph_ = other.weighted_graph_; 

12  13 
ResetVerticesAndEdgesIndexMap(); 
13  14 
} 
14  15  
15 
GraphManager& GraphManager::operator=(GraphManager& rhs) { 

16 
cout << "\n\n*******ASSIGNMENT OPERATOR******\n\n";


16 
GraphManager& GraphManager::operator=(const GraphManager& rhs) {


17 
// cout << "\n*******ASSIGNMENT OPERATOR******\n";


17  18 
g_ = rhs.g_; 
19 
weighted_graph_ = rhs.weighted_graph_; 

18  20 
ResetVerticesAndEdgesIndexMap(); 
19  21  
20  22 
return *this; 
...  ...  
32  34 
return v_id_index_map_; 
33  35 
} 
34  36  
37 
bool GraphManager::weighted_graph() const { 

38 
return weighted_graph_; 

39 
} 

40  
35  41 
// UPDATE GRAPHS 
36  42 
void GraphManager::AddEdge(VertexProperties vp1, VertexProperties vp2, EdgeProperties ep) { 
37  43 
// cout << "add edge GM " << vp1.label << "  " << vp2.label << endl; 
...  ...  
110  116 
bool connected = graphext::is_connected(g_, v_index_pmap_); 
111  117 
cout << "Connected = " << connected << endl; 
112  118  
119 
cout << "Is this a weighted graph?\n"; 

120 
cout << "is weighted = " << weighted_graph_ << endl; 

121  
113  122 
cout << "v_id_index_map:\n"; 
114  123 
outops::operator<< <int>(cout, v_id_index_map_); 
115  124 
} 
Also available in: Unified diff