Changeset 08fd83
- Timestamp:
- May 8, 2008, 12:45:52 PM (17 years ago)
- Children:
- 84e88a
- Parents:
- 7b80a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.cpp
r7b80a5 r08fd83 2217 2217 *out << Verbose(0) << "Bond order " << Order << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed." << endl; 2218 2218 } else { 2219 FragmentList = (Graph **) Malloc(sizeof(Graph *)* FragmentCounter, "molecule::FragmentMolecule - **BondFragments");2219 FragmentList = (Graph **) Malloc(sizeof(Graph *)*Subgraphs->next->Count(), "molecule::FragmentMolecule - **BondFragments"); 2220 2220 2221 2221 // ===== 6a. fill RootStack for each subgraph (second adaptivity check) ===== 2222 2222 // NOTE: (keep this extern of following while loop, as lateron we may here look for which site to add to which subgraph) 2223 2223 // fill the root stack 2224 KeyStack RootStack[FragmentCounter]; 2225 2226 if (Order == -1) { // means we want to increase order adaptively 2227 cerr << "Adaptive chosing of sites not yet implemented!" << endl; 2228 } else { // means we just want to increase it at every site by one 2229 FragmentCounter = 0; 2230 MolecularWalker = Subgraphs; 2231 // count subgraphs and allocate fragments 2232 while (MolecularWalker->next != NULL) { 2233 MolecularWalker = MolecularWalker->next; 2234 // find first root candidates 2235 RootStack[FragmentCounter].clear(); 2236 Walker = MolecularWalker->Leaf->start; 2237 while (Walker->next != MolecularWalker->Leaf->end) { // go through all (non-hydrogen) atoms 2238 Walker = Walker->next; 2239 #ifdef ADDHYDROGEN 2240 if (Walker->type->Z != 1) // skip hydrogen 2241 #endif 2242 if (Walker->GetTrueFather()->AdaptiveOrder < Order) // only if Order is still greater 2243 RootStack[FragmentCounter].push_front(Walker->nr); 2244 } 2245 FragmentCounter++; 2246 } 2247 } 2224 KeyStack *RootStack = new KeyStack[Subgraphs->next->Count()]; 2225 Subgraphs->next->FillRootStackForSubgraphs(out, RootStack, Order, (FragmentCounter = 0)); 2248 2226 2249 2227 // ===== 6b. assign each keyset to its respective subgraph =====
Note:
See TracChangeset
for help on using the changeset viewer.