Changes in src/Fragmentation/Graph.cpp [94d5ac6:b4f72c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Graph.cpp
r94d5ac6 rb4f72c 64 64 * \param *counter keyset counter that gets increased 65 65 */ 66 void Graph::InsertGraph( Graph &graph, int *counter)66 void Graph::InsertGraph(const Graph &graph, int &counter) 67 67 { 68 68 GraphTestPair testGraphInsert; 69 69 70 for(Graph:: iterator runner = graph.begin(); runner != graph.end(); runner++) {71 testGraphInsert = insert(GraphPair ((*runner).first,pair<int,double>( (*counter)++,((*runner).second).second))); // store fragment number and current factor70 for(Graph::const_iterator runner = graph.begin(); runner != graph.end(); runner++) { 71 testGraphInsert = insert(GraphPair ((*runner).first,pair<int,double>(++counter,((*runner).second).second))); // store fragment number and current factor 72 72 if (testGraphInsert.second) { 73 LOG(2, "INFO: KeySet " << (*counter)-1 << " successfully inserted.");73 LOG(2, "INFO: KeySet " << counter-1 << " successfully inserted."); 74 74 } else { 75 LOG(2, "INFO: KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first);75 LOG(2, "INFO: KeySet " << counter-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first); 76 76 ((*(testGraphInsert.first)).second).second += (*runner).second.second; 77 77 LOG(2, "INFO: New factor is " << (*(testGraphInsert.first)).second.second << "."); … … 132 132 * \return true - file written successfully, false - writing failed 133 133 */ 134 bool Graph::StoreKeySetFile(std::string &path) 134 bool Graph::StoreKeySetFile(std::string &path) const 135 135 { 136 136 bool status = true; … … 141 141 LOG(1, "INFO: Saving key sets of the total graph ... "); 142 142 if(output.good()) { 143 for(Graph:: iterator runner = begin(); runner != end(); runner++) {144 for (KeySet:: iterator sprinter = (*runner).first.begin();sprinter != (*runner).first.end(); sprinter++) {143 for(Graph::const_iterator runner = begin(); runner != end(); runner++) { 144 for (KeySet::const_iterator sprinter = (*runner).first.begin();sprinter != (*runner).first.end(); sprinter++) { 145 145 if (sprinter != (*runner).first.begin()) 146 146 output << "\t"; … … 156 156 } 157 157 output.close(); 158 output.clear();159 158 160 159 return status; … … 210 209 * \return true - file written successfully, false - writing failed 211 210 */ 212 bool Graph::StoreTEFactorsFile(char *path) 211 bool Graph::StoreTEFactorsFile(char *path) const 213 212 { 214 213 ofstream output; … … 224 223 LOG(1, "INFO: Saving TEFactors of the total graph ... "); 225 224 if(output != NULL) { 226 for(Graph:: iterator runner = begin(); runner != end(); runner++)225 for(Graph::const_iterator runner = begin(); runner != end(); runner++) 227 226 output << (*runner).second.second << endl; 228 227 LOG(1, "INFO: done." << endl);
Note:
See TracChangeset
for help on using the changeset viewer.