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
  • molecuilder/src/molecules.cpp

    r169b24 r2b79c3  
    22732273
    22742274  // ===== 8a. translate list into global numbers (i.e. ones that are valid in "this" molecule, not in MolecularWalker->Leaf)
    2275   MolecularWalker = Subgraphs;
    2276   FragmentCounter = 0;
    2277   while (MolecularWalker->next != NULL) {
    2278     MolecularWalker = MolecularWalker->next;
    2279     KeySet *TempSet = new KeySet;
    2280     for(Graph::iterator runner = FragmentList[FragmentCounter]->begin(); runner != FragmentList[FragmentCounter]->end(); runner++) {
    2281       for(KeySet::iterator sprinter = (*runner).first.begin(); sprinter != (*runner).first.end(); sprinter++)
    2282         TempSet->insert((MolecularWalker->Leaf->FindAtom(*sprinter))->GetTrueFather()->nr);
    2283       TotalGraph.insert(GraphPair(*TempSet, pair<int,double>(TotalNumberOfKeySets++, (*runner).second.second)));
    2284       TempSet->clear();
    2285     }
    2286     delete(TempSet);
    2287     delete(FragmentList[FragmentCounter]);
    2288     FragmentCounter++;
    2289   }
    2290   Free((void **)&FragmentList, "molecule::FragmentMolecule - **FragmentList");
     2275  Subgraphs->next->TranslateIndicesToGlobalIDs(out, FragmentList, (FragmentCounter = 0), TotalNumberOfKeySets, TotalGraph);
     2276 
    22912277  // free subgraph memory again
    22922278  delete(ParsedFragmentList);
     2279  FragmentCounter = 0;
    22932280  if (Subgraphs != NULL) {
    22942281    while (Subgraphs->next != NULL) {
    22952282      Subgraphs = Subgraphs->next;
     2283      delete(FragmentList[FragmentCounter++]);
    22962284      delete(Subgraphs->previous);
    22972285    }
    22982286    delete(Subgraphs);
    22992287  }
     2288  Free((void **)&FragmentList, "molecule::FragmentMolecule - **FragmentList");
    23002289
    23012290  // ===== 8b. gather keyset lists (graphs) from all subgraphs and transform into MoleculeListClass =====
Note: See TracChangeset for help on using the changeset viewer.