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/moleculelist.cpp

    rec70ec r543ce4  
    1313#include "linkedcell.hpp"
    1414#include "lists.hpp"
     15#include "log.hpp"
    1516#include "molecule.hpp"
    1617#include "memoryallocator.hpp"
     
    3233MoleculeListClass::~MoleculeListClass()
    3334{
    34   cout << Verbose(3) << this << ": Freeing ListOfMolcules." << endl;
     35  Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl;
    3536  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
    36     cout << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl;
     37    Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl;
    3738    delete (*ListRunner);
    3839  }
    39   cout << Verbose(4) << "Freeing ListOfMolecules." << endl;
     40  Log() << Verbose(4) << "Freeing ListOfMolecules." << endl;
    4041  ListOfMolecules.clear(); // empty list
    4142};
     
    6566
    6667  // sort each atom list and put the numbers into a list, then go through
    67   //cout << "Comparing fragment no. " << *(molecule **)a << " to " << *(molecule **)b << "." << endl;
     68  //Log() << Verbose(0) << "Comparing fragment no. " << *(molecule **)a << " to " << *(molecule **)b << "." << endl;
    6869  if ((**(molecule **) a).AtomCount < (**(molecule **) b).AtomCount) {
    6970    return -1;
     
    141142
    142143  // header
    143   *out << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl;
    144   cout << Verbose(0) << "-----------------------------------------------" << endl;
     144  Log() << Verbose(0) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl;
     145  Log() << Verbose(0) << "-----------------------------------------------" << endl;
    145146  if (ListOfMolecules.size() == 0)
    146     *out << "\tNone" << endl;
     147    Log() << Verbose(0) << "\tNone" << endl;
    147148  else {
    148149    Origin.Zero();
     
    161162      }
    162163      // output Index, Name, number of atoms, chemical formula
    163       *out << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t";
     164      Log() << Verbose(0) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t";
    164165      Elemental = (*ListRunner)->elemente->end;
    165166      while(Elemental->previous != (*ListRunner)->elemente->start) {
    166167        Elemental = Elemental->previous;
    167168        if (Counts[Elemental->Z] != 0)
    168           *out << Elemental->symbol << Counts[Elemental->Z];
     169          Log() << Verbose(0) << Elemental->symbol << Counts[Elemental->Z];
    169170      }
    170171      // Center and size
    171       *out << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;
     172      Log() << Verbose(0) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;
    172173    }
    173174  }
     
    310311  Tesselation *TesselStruct = NULL;
    311312  if ((srcmol == NULL) || (mol == NULL)) {
    312     cout << Verbose(1) << "ERROR: Either fixed or variable molecule is given as NULL." << endl;
     313    Log() << Verbose(1) << "ERROR: Either fixed or variable molecule is given as NULL." << endl;
    313314    return false;
    314315  }
     
    316317  // calculate envelope for *mol
    317318  LCList = new LinkedCell(mol, 8.);
    318   FindNonConvexBorder((ofstream *)&cout, mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL);
     319  FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL);
    319320  if (TesselStruct == NULL) {
    320     cout << Verbose(1) << "ERROR: Could not tesselate the fixed molecule." << endl;
     321    Log() << Verbose(1) << "ERROR: Could not tesselate the fixed molecule." << endl;
    321322    return false;
    322323  }
     
    325326
    326327  // prepare index list for bonds
    327   srcmol->CountAtoms((ofstream *)&cout);
     328  srcmol->CountAtoms();
    328329  atom ** CopyAtoms = new atom*[srcmol->AtomCount];
    329330  for(int i=0;i<srcmol->AtomCount;i++)
     
    335336  while (Walker->next != srcmol->end) {
    336337    Walker = Walker->next;
    337     cout << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl;
    338     if (!TesselStruct->IsInnerPoint((ofstream *)&cout, Walker->x, LCList)) {
     338    Log() << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl;
     339    if (!TesselStruct->IsInnerPoint(Walker->x, LCList)) {
    339340      CopyAtoms[Walker->nr] = new atom(Walker);
    340341      mol->AddAtom(CopyAtoms[Walker->nr]);
     
    344345    }
    345346  }
    346   cout << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged.";
     347  Log() << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged.";
    347348
    348349  // go through all bonds and add as well
     
    350351  while(Binder->next != srcmol->last) {
    351352    Binder = Binder->next;
    352     cout << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;
     353    Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;
    353354    mol->AddBond(CopyAtoms[Binder->leftatom->nr], CopyAtoms[Binder->rightatom->nr], Binder->BondDegree);
    354355  }
     
    362363void MoleculeListClass::Output(ofstream *out)
    363364{
    364   *out << Verbose(1) << "MoleculeList: ";
     365  Log() << Verbose(1) << "MoleculeList: ";
    365366  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++)
    366     *out << *ListRunner << "\t";
    367   *out << endl;
     367    Log() << Verbose(0) << *ListRunner << "\t";
     368  Log() << Verbose(0) << endl;
    368369};
    369370
     
    375376 * \param *path path to file
    376377 */
    377 bool MoleculeListClass::AddHydrogenCorrection(ofstream *out, char *path)
     378bool MoleculeListClass::AddHydrogenCorrection(char *path)
    378379{
    379380  atom *Walker = NULL;
     
    391392  char *FragmentNumber = NULL;
    392393
    393   cout << Verbose(1) << "Saving hydrogen saturation correction ... ";
     394  Log() << Verbose(1) << "Saving hydrogen saturation correction ... ";
    394395  // 0. parse in fit constant files that should have the same dimension as the final energy files
    395396  // 0a. find dimension of matrices with constants
     
    401402  input.open(line.c_str());
    402403  if (input == NULL) {
    403     cerr << endl << "Unable to open " << line << ", is the directory correct?"
     404    eLog() << Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?"
    404405        << endl;
    405406    return false;
     
    419420    b++;
    420421  }
    421   cout << "I recognized " << a << " columns and " << b << " rows, ";
     422  Log() << Verbose(0) << "I recognized " << a << " columns and " << b << " rows, ";
    422423  input.close();
    423424
     
    440441    input.open(line.c_str());
    441442    if (input == NULL) {
    442       cerr << endl << "Unable to open " << line << ", is the directory correct?" << endl;
     443      eLog() << Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl;
    443444      return false;
    444445    }
     
    446447    while ((!input.eof()) && (k < b)) {
    447448      input.getline(ParsedLine, 1023);
    448       //cout << "Current Line: " << ParsedLine << endl;
     449      //Log() << Verbose(0) << "Current Line: " << ParsedLine << endl;
    449450      zeile.str(ParsedLine);
    450451      zeile.clear();
     
    452453      while ((!zeile.eof()) && (l < a)) {
    453454        zeile >> FitConstant[i][l][k];
    454         //cout << FitConstant[i][l][k] << "\t";
     455        //Log() << Verbose(0) << FitConstant[i][l][k] << "\t";
    455456        l++;
    456457      }
    457       //cout << endl;
     458      //Log() << Verbose(0) << endl;
    458459      k++;
    459460    }
     
    461462  }
    462463  for (int k = 0; k < 3; k++) {
    463     cout << "Constants " << k << ":" << endl;
     464    Log() << Verbose(0) << "Constants " << k << ":" << endl;
    464465    for (int j = 0; j < b; j++) {
    465466      for (int i = 0; i < a; i++) {
    466         cout << FitConstant[k][i][j] << "\t";
     467        Log() << Verbose(0) << FitConstant[k][i][j] << "\t";
    467468      }
    468       cout << endl;
    469     }
    470     cout << endl;
     469      Log() << Verbose(0) << endl;
     470    }
     471    Log() << Verbose(0) << endl;
    471472  }
    472473
     
    486487    while (Walker->next != (*ListRunner)->end) {
    487488      Walker = Walker->next;
    488       //cout << Verbose(1) << "Walker: " << *Walker << " with first bond " << *(Walker->ListOfBonds.begin()) << "." << endl;
     489      //Log() << Verbose(1) << "Walker: " << *Walker << " with first bond " << *(Walker->ListOfBonds.begin()) << "." << endl;
    489490      if ((Walker->type->Z == 1) && ((Walker->father == NULL)
    490491          || (Walker->father->type->Z != 1))) { // if it's a hydrogen
     
    492493        while (Runner->next != (*ListRunner)->end) {
    493494          Runner = Runner->next;
    494           //cout << Verbose(2) << "Runner: " << *Runner << " with first bond " << *(Walker->ListOfBonds.begin()) << "." << endl;
     495          //Log() << Verbose(2) << "Runner: " << *Runner << " with first bond " << *(Walker->ListOfBonds.begin()) << "." << endl;
    495496          // 3. take every other hydrogen that is the not the first and not bound to same bonding partner
    496497          Binder = *(Runner->ListOfBonds.begin());
     
    498499            // 4. evaluate the morse potential for each matrix component and add up
    499500            distance = Runner->x.Distance(&Walker->x);
    500             //cout << "Fragment " << (*ListRunner)->name << ": " << *Runner << "<= " << distance << "=>" << *Walker << ":" << endl;
     501            //Log() << Verbose(0) << "Fragment " << (*ListRunner)->name << ": " << *Runner << "<= " << distance << "=>" << *Walker << ":" << endl;
    501502            for (int k = 0; k < a; k++) {
    502503              for (int j = 0; j < b; j++) {
     
    511512                };
    512513                correction[k][j] -= tmp; // ground state is actually lower (disturbed by additional interaction)
    513                 //cout << tmp << "\t";
     514                //Log() << Verbose(0) << tmp << "\t";
    514515              }
    515               //cout << endl;
     516              //Log() << Verbose(0) << endl;
    516517            }
    517             //cout << endl;
     518            //Log() << Verbose(0) << endl;
    518519          }
    519520        }
     
    556557  }
    557558  Free(&FitConstant);
    558   cout << "done." << endl;
     559  Log() << Verbose(0) << "done." << endl;
    559560  return true;
    560561};
     
    566567 * \return true - file written successfully, false - writing failed
    567568 */
    568 bool MoleculeListClass::StoreForcesFile(ofstream *out, char *path,
     569bool MoleculeListClass::StoreForcesFile(char *path,
    569570    int *SortIndex)
    570571{
     
    576577
    577578  // open file for the force factors
    578   *out << Verbose(1) << "Saving  force factors ... ";
     579  Log() << Verbose(1) << "Saving  force factors ... ";
    579580  line << path << "/" << FRAGMENTPREFIX << FORCESFILE;
    580581  ForcesFile.open(line.str().c_str(), ios::out);
    581582  if (ForcesFile != NULL) {
    582     //cout << Verbose(1) << "Final AtomicForcesList: ";
     583    //Log() << Verbose(1) << "Final AtomicForcesList: ";
    583584    //output << prefix << "Forces" << endl;
    584585    for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
     
    592593            if (Walker->type->Z == runner->Z) {
    593594              if ((Walker->GetTrueFather() != NULL) && (Walker->GetTrueFather() != Walker)) {// if there is a rea
    594                 //cout << "Walker is " << *Walker << " with true father " << *( Walker->GetTrueFather()) << ", it
     595                //Log() << Verbose(0) << "Walker is " << *Walker << " with true father " << *( Walker->GetTrueFather()) << ", it
    595596                ForcesFile << SortIndex[Walker->GetTrueFather()->nr] << "\t";
    596597              } else
     
    604605    }
    605606    ForcesFile.close();
    606     *out << Verbose(1) << "done." << endl;
     607    Log() << Verbose(1) << "done." << endl;
    607608  } else {
    608609    status = false;
    609     *out << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     610    Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
    610611  }
    611612  ForcesFile.close();
     
    622623 * \return true - success (each file was written), false - something went wrong.
    623624 */
    624 bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex)
     625bool MoleculeListClass::OutputConfigForListOfFragments(config *configuration, int *SortIndex)
    625626{
    626627  ofstream outputFragment;
     
    643644      strcpy(PathBackup, path);
    644645    else
    645       cerr << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl;
     646      eLog() << Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl;
    646647
    647648    // correct periodic
    648     (*ListRunner)->ScanForPeriodicCorrection(out);
     649    (*ListRunner)->ScanForPeriodicCorrection();
    649650
    650651    // output xyz file
     
    652653    sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    653654    outputFragment.open(FragmentName, ios::out);
    654     *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ...";
     655    Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ...";
    655656    if ((intermediateResult = (*ListRunner)->OutputXYZ(&outputFragment)))
    656       *out << " done." << endl;
     657      Log() << Verbose(0) << " done." << endl;
    657658    else
    658       *out << " failed." << endl;
     659      Log() << Verbose(0) << " failed." << endl;
    659660    result = result && intermediateResult;
    660661    outputFragment.close();
     
    662663
    663664    // list atoms in fragment for debugging
    664     *out << Verbose(2) << "Contained atoms: ";
     665    Log() << Verbose(2) << "Contained atoms: ";
    665666    Walker = (*ListRunner)->start;
    666667    while (Walker->next != (*ListRunner)->end) {
    667668      Walker = Walker->next;
    668       *out << Walker->Name << " ";
    669     }
    670     *out << endl;
     669      Log() << Verbose(0) << Walker->Name << " ";
     670    }
     671    Log() << Verbose(0) << endl;
    671672
    672673    // center on edge
    673     (*ListRunner)->CenterEdge(out, &BoxDimension);
     674    (*ListRunner)->CenterEdge(&BoxDimension);
    674675    (*ListRunner)->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary
    675676    int j = -1;
     
    692693    // and save as config
    693694    sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    694     *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ...";
     695    Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ...";
    695696    if ((intermediateResult = configuration->Save(FragmentName, (*ListRunner)->elemente, (*ListRunner))))
    696       *out << " done." << endl;
     697      Log() << Verbose(0) << " done." << endl;
    697698    else
    698       *out << " failed." << endl;
     699      Log() << Verbose(0) << " failed." << endl;
    699700    result = result && intermediateResult;
    700701
     
    704705    // and save as mpqc input file
    705706    sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    706     *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ...";
     707    Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ...";
    707708    if ((intermediateResult = configuration->SaveMPQC(FragmentName, (*ListRunner))))
    708       *out << " done." << endl;
     709      Log() << Verbose(2) << " done." << endl;
    709710    else
    710       *out << " failed." << endl;
     711      Log() << Verbose(0) << " failed." << endl;
    711712
    712713    result = result && intermediateResult;
     
    715716    Free(&FragmentNumber);
    716717  }
    717   cout << " done." << endl;
     718  Log() << Verbose(0) << " done." << endl;
    718719
    719720  // printing final number
    720   *out << "Final number of fragments: " << FragmentCounter << "." << endl;
     721  Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl;
    721722
    722723  return result;
     
    739740 * \param *configuration config with BondGraph
    740741 */
    741 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(ofstream * const out, molecule * const mol, config * const configuration)
     742void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(molecule * const mol, config * const configuration)
    742743{
    743744  // 1. dissect the molecule into connected subgraphs
    744   configuration ->BG->ConstructBondGraph(out, mol);
     745  configuration ->BG->ConstructBondGraph(mol);
    745746
    746747  // 2. scan for connected subgraphs
    747748  MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    748749  class StackClass<bond *> *BackEdgeStack = NULL;
    749   Subgraphs = mol->DepthFirstSearchAnalysis(out, BackEdgeStack);
     750  Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
    750751  delete(BackEdgeStack);
    751752
     
    783784    Walker = mol->start->next;
    784785    if ((Walker->nr <0) || (Walker->nr >= mol->AtomCount)) {
    785       cerr << "Index of atom " << *Walker << " is invalid!" << endl;
     786      eLog() << Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl;
    786787      performCriticalExit();
    787788    }
    788789    FragmentCounter = MolMap[Walker->nr];
    789790    if (FragmentCounter != 0) {
    790       cout << Verbose(3) << "Re-linking " << *Walker << "..." << endl;
     791      Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl;
    791792      unlink(Walker);
    792793      molecules[FragmentCounter-1]->AddAtom(Walker);    // counting starts at 1
    793794    } else {
    794       cerr << "Atom " << *Walker << " not associated to molecule!" << endl;
     795      eLog() << Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl;
    795796      performCriticalExit();
    796797    }
     
    806807  Free(&MolMap);
    807808  Free(&molecules);
    808   cout << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl;
     809  Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl;
    809810};
    810811
     
    888889 * \return true - success, false - faoilure
    889890 */
    890 bool MoleculeLeafClass::FillBondStructureFromReference(ofstream *out, const molecule * const reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList)
     891bool MoleculeLeafClass::FillBondStructureFromReference(const molecule * const reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList)
    891892{
    892893  atom *Walker = NULL;
     
    896897  int AtomNo;
    897898
    898   *out << Verbose(1) << "Begin of FillBondStructureFromReference." << endl;
     899  Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl;
    899900  // fill ListOfLocalAtoms if NULL was given
    900   if (!FillListOfLocalAtoms(out, ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
    901     *out << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
     901  if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
     902    Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
    902903    return false;
    903904  }
    904905
    905906  if (status) {
    906     *out << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl;
     907    Log() << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl;
    907908    // remove every bond from the list
    908909    bond *Binder = NULL;
     
    925926            Leaf->AddBond(Walker, OtherWalker, (*Runner)->BondDegree);
    926927        } else {
    927           *out << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl;
     928          Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl;
    928929          status = false;
    929930        }
     
    938939      Free(&ListOfLocalAtoms);
    939940  }
    940   *out << Verbose(1) << "End of FillBondStructureFromReference." << endl;
     941  Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl;
    941942  return status;
    942943};
     
    950951 * \return true - stack is non-empty, fragmentation necessary, false - stack is empty, no more sites to update
    951952 */
    952 bool MoleculeLeafClass::FillRootStackForSubgraphs(ofstream *out,
    953     KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter)
     953bool MoleculeLeafClass::FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter)
    954954{
    955955  atom *Walker = NULL, *Father = NULL;
     
    970970      }
    971971      if (next != NULL)
    972         next->FillRootStackForSubgraphs(out, RootStack, AtomMask, ++FragmentCounter);
     972        next->FillRootStackForSubgraphs(RootStack, AtomMask, ++FragmentCounter);
    973973    } else {
    974       *out << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl;
     974      Log() << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl;
    975975      return false;
    976976    }
     
    978978    return true;
    979979  } else {
    980     *out << Verbose(1) << "Rootstack is NULL." << endl;
     980    Log() << Verbose(1) << "Rootstack is NULL." << endl;
    981981    return false;
    982982  }
     
    991991 * \return true - success, false - failure
    992992 */
    993 bool MoleculeLeafClass::FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList)
     993bool MoleculeLeafClass::FillListOfLocalAtoms(atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList)
    994994{
    995995  bool status = true;
     
    10061006
    10071007  if ((ListOfLocalAtoms != NULL) && (ListOfLocalAtoms[FragmentCounter] == NULL)) { // allocate and fill list of this fragment/subgraph
    1008     status = status && CreateFatherLookupTable(out, Leaf->start, Leaf->end, ListOfLocalAtoms[FragmentCounter], GlobalAtomCount);
     1008    status = status && CreateFatherLookupTable(Leaf->start, Leaf->end, ListOfLocalAtoms[FragmentCounter], GlobalAtomCount);
    10091009    FreeList = FreeList && true;
    10101010  }
     
    10231023 * \retuen true - success, false - failure
    10241024 */
    1025 bool MoleculeLeafClass::AssignKeySetsToFragment(ofstream *out,
    1026     molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms,
    1027     Graph **&FragmentList, int &FragmentCounter, bool FreeList)
     1025bool MoleculeLeafClass::AssignKeySetsToFragment(molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList)
    10281026{
    10291027  bool status = true;
    10301028  int KeySetCounter = 0;
    10311029
    1032   *out << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl;
     1030  Log() << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl;
    10331031  // fill ListOfLocalAtoms if NULL was given
    1034   if (!FillListOfLocalAtoms(out, ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
    1035     *out << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
     1032  if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
     1033    Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
    10361034    return false;
    10371035  }
     
    10611059    delete (TempSet);
    10621060    if (KeySetCounter == 0) {// if there are no keysets, delete the list
    1063       *out << Verbose(1) << "KeySetCounter is zero, deleting FragmentList." << endl;
     1061      Log() << Verbose(1) << "KeySetCounter is zero, deleting FragmentList." << endl;
    10641062      delete (FragmentList[FragmentCounter]);
    10651063    } else
    1066       *out << Verbose(1) << KeySetCounter << " keysets were assigned to subgraph " << FragmentCounter << "." << endl;
     1064      Log() << Verbose(1) << KeySetCounter << " keysets were assigned to subgraph " << FragmentCounter << "." << endl;
    10671065    FragmentCounter++;
    10681066    if (next != NULL)
    1069       next->AssignKeySetsToFragment(out, reference, KeySetList, ListOfLocalAtoms, FragmentList, FragmentCounter, FreeList);
     1067      next->AssignKeySetsToFragment(reference, KeySetList, ListOfLocalAtoms, FragmentList, FragmentCounter, FreeList);
    10701068    FragmentCounter--;
    10711069  } else
    1072     *out << Verbose(1) << "KeySetList is NULL or empty." << endl;
     1070    Log() << Verbose(1) << "KeySetList is NULL or empty." << endl;
    10731071
    10741072  if ((FreeList) && (ListOfLocalAtoms != NULL)) {
     
    10781076      Free(&ListOfLocalAtoms);
    10791077  }
    1080   *out << Verbose(1) << "End of AssignKeySetsToFragment." << endl;
     1078  Log() << Verbose(1) << "End of AssignKeySetsToFragment." << endl;
    10811079  return status;
    10821080};
     
    10891087 * \param &TotalGraph Graph to be filled with global numbers
    10901088 */
    1091 void MoleculeLeafClass::TranslateIndicesToGlobalIDs(ofstream *out,
    1092     Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets,
    1093     Graph &TotalGraph)
    1094 {
    1095   *out << Verbose(1) << "Begin of TranslateIndicesToGlobalIDs." << endl;
     1089void MoleculeLeafClass::TranslateIndicesToGlobalIDs(Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph)
     1090{
     1091  Log() << Verbose(1) << "Begin of TranslateIndicesToGlobalIDs." << endl;
    10961092  KeySet *TempSet = new KeySet;
    10971093  if (FragmentList[FragmentCounter] != NULL) {
     
    11041100    delete (TempSet);
    11051101  } else {
    1106     *out << Verbose(1) << "FragmentList is NULL." << endl;
     1102    Log() << Verbose(1) << "FragmentList is NULL." << endl;
    11071103  }
    11081104  if (next != NULL)
    1109     next->TranslateIndicesToGlobalIDs(out, FragmentList, ++FragmentCounter, TotalNumberOfKeySets, TotalGraph);
     1105    next->TranslateIndicesToGlobalIDs(FragmentList, ++FragmentCounter, TotalNumberOfKeySets, TotalGraph);
    11101106  FragmentCounter--;
    1111   *out << Verbose(1) << "End of TranslateIndicesToGlobalIDs." << endl;
     1107  Log() << Verbose(1) << "End of TranslateIndicesToGlobalIDs." << endl;
    11121108};
    11131109
Note: See TracChangeset for help on using the changeset viewer.