Ignore:
Timestamp:
May 8, 2008, 3:39:36 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
d88597
Parents:
169b24
Message:

new function MoleculeLeafClass::TranslateIndicesToGlobalIDs() used in molecule::FragmentMolecule()

MoleculeLeafClass::TranslateIndicesToGlobalIDs() abstractizes translation of local atom::nr returned by BOSSANOVA per fragment into one list of global indices that can be used to store fragment configs and globally valid keyset file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified molecuilder/src/moleculelist.cpp

    r169b24 r2b79c3  
    540540};
    541541
     542/** Translate list into global numbers (i.e. ones that are valid in "this" molecule, not in MolecularWalker->Leaf)
     543 * \param *out output stream for debugging
     544 * \param **FragmentList Graph with local numbers per fragment
     545 * \param &FragmentCounter counts the fragments as we move along the list
     546 * \param &TotalNumberOfKeySets global key set counter
     547 * \param &TotalGraph Graph to be filled with global numbers
     548 */
     549void MoleculeLeafClass::TranslateIndicesToGlobalIDs(ofstream *out, Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph)
     550{
     551  KeySet *TempSet = new KeySet;
     552  for(Graph::iterator runner = FragmentList[FragmentCounter]->begin(); runner != FragmentList[FragmentCounter]->end(); runner++) {
     553    for(KeySet::iterator sprinter = (*runner).first.begin(); sprinter != (*runner).first.end(); sprinter++)
     554      TempSet->insert((Leaf->FindAtom(*sprinter))->GetTrueFather()->nr);
     555    TotalGraph.insert(GraphPair(*TempSet, pair<int,double>(TotalNumberOfKeySets++, (*runner).second.second)));
     556    TempSet->clear();
     557  }
     558  delete(TempSet);
     559  if (next != NULL)
     560    next->TranslateIndicesToGlobalIDs(out, FragmentList, ++FragmentCounter, TotalNumberOfKeySets, TotalGraph);
     561  FragmentCounter--;
     562};
     563
    542564/** Simply counts the number of items in the list, from given MoleculeLeafClass.
    543565 * \return number of items
Note: See TracChangeset for help on using the changeset viewer.