/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * Graph.cpp * * Created on: Oct 20, 2011 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "Graph.hpp" #include "CodePatterns/Log.hpp" /** Constructor for class Graph. * */ Graph::Graph() {} /** Destructor for class Graph. * */ Graph::~Graph() {} /** Inserts each KeySet in \a graph into \a this. * \param graph1 graph whose KeySet are inserted into \this graph * \param *counter keyset counter that gets increased */ void Graph::InsertGraph(Graph &graph, int *counter) { GraphTestPair testGraphInsert; for(Graph::iterator runner = graph.begin(); runner != graph.end(); runner++) { testGraphInsert = insert(GraphPair ((*runner).first,pair((*counter)++,((*runner).second).second))); // store fragment number and current factor if (testGraphInsert.second) { LOG(2, "INFO: KeySet " << (*counter)-1 << " successfully inserted."); } else { LOG(2, "INFO: KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first); ((*(testGraphInsert.first)).second).second += (*runner).second.second; LOG(2, "INFO: New factor is " << (*(testGraphInsert.first)).second.second << "."); } } };