Ignore:
Timestamp:
Nov 4, 2009, 7:56:04 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
4ef101, aa8542
Parents:
ec70ec
Message:

Huge change from ofstream * (const) out --> Log().

  • first shift was done via regular expressions
  • then via error messages from the code
  • note that class atom, class element and class molecule kept in parts their output stream, was they print to file.
  • make check runs fine
  • MISSING: Verbosity is not fixed for everything (i.e. if no endl; is present and next has Verbose(0) ...)

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/graph.cpp

    rec70ec r543ce4  
    1111#include "config.hpp"
    1212#include "graph.hpp"
     13#include "log.hpp"
    1314#include "molecule.hpp"
    1415
     
    7879 * \param factor energy factor for the fragment
    7980 */
    80 void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment)
     81void InsertFragmentIntoGraph(struct UniqueFragments *Fragment)
    8182{
    8283  GraphTestPair testGraphInsert;
     
    8485  testGraphInsert = Fragment->Leaflet->insert(GraphPair (*Fragment->FragmentSet,pair<int,double>(Fragment->FragmentCounter,Fragment->TEFactor)));  // store fragment number and current factor
    8586  if (testGraphInsert.second) {
    86     *out << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl;
     87    Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl;
    8788    Fragment->FragmentCounter++;
    8889  } else {
    89     *out << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;
     90    Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;
    9091    ((*(testGraphInsert.first)).second).second += Fragment->TEFactor;  // increase the "created" counter
    91     *out << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl;
     92    Log() << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl;
    9293  }
    9394};
    94 //void inline InsertIntoGraph(ofstream *out, KeyStack &stack, Graph &graph, int *counter, double factor)
     95//void inline InsertIntoGraph(KeyStack &stack, Graph &graph, int *counter, double factor)
    9596//{
    9697//  // copy stack contents to set and call overloaded function again
     
    9899//  for(KeyStack::iterator runner = stack.begin(); runner != stack.begin(); runner++)
    99100//    set.insert((*runner));
    100 //  InsertIntoGraph(out, set, graph, counter, factor);
     101//  InsertIntoGraph(set, graph, counter, factor);
    101102//};
    102103
     
    107108 * \param *counter keyset counter that gets increased
    108109 */
    109 void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter)
     110void InsertGraphIntoGraph(Graph &graph1, Graph &graph2, int *counter)
    110111{
    111112  GraphTestPair testGraphInsert;
     
    114115    testGraphInsert = graph1.insert(GraphPair ((*runner).first,pair<int,double>((*counter)++,((*runner).second).second)));  // store fragment number and current factor
    115116    if (testGraphInsert.second) {
    116       *out << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl;
     117      Log() << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl;
    117118    } else {
    118       *out << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;
     119      Log() << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;
    119120      ((*(testGraphInsert.first)).second).second += (*runner).second.second;
    120       *out << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl;
     121      Log() << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl;
    121122    }
    122123  }
Note: See TracChangeset for help on using the changeset viewer.