Changeset 747b10
- Timestamp:
- Jul 28, 2008, 1:45:43 PM (17 years ago)
- Children:
- 39651f
- Parents:
- db3ea3
- Location:
- molecuilder/src
- Files:
-
- 2 edited
-
molecules.cpp (modified) (5 diffs)
-
molecules.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.cpp
rdb3ea3 r747b10 2367 2367 }; 2368 2368 2369 /** Checks whether the OrderAtSite is still be wloe\a Order at some site.2369 /** Checks whether the OrderAtSite is still below \a Order at some site. 2370 2370 * \param *out output stream for debugging 2371 2371 * \param *AtomMask defines true/false per global Atom::nr to mask in/out each nuclear site, used to activate given number of site to increment order adaptively 2372 2372 * \param *GlobalKeySetList list of keysets with global ids (valid in "this" molecule) needed for adaptive increase 2373 2373 * \param Order desired Order if positive, desired exponent in threshold criteria if negative (0 is single-step) 2374 * \param *MinimumRingSize array of max. possible order to avoid loops 2374 2375 * \param *path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative) 2375 2376 * \return true - needs further fragmentation, false - does not need fragmentation 2376 2377 */ 2377 bool molecule::CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, char *path)2378 bool molecule::CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path) 2378 2379 { 2379 2380 atom *Walker = start; … … 2466 2467 for(map<double, pair<int,int> >::iterator runner = FinalRootCandidates.upper_bound(pow(10.,Order)); runner != FinalRootCandidates.end(); runner++) { 2467 2468 No = (*runner).second.first; 2468 *out << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl; 2469 AtomMask[No] = true; 2470 status = true; 2469 Walker = FindAtom(No); 2470 if (Walker->AdaptiveOrder < MinimumRingSize[Walker->nr]) { 2471 *out << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl; 2472 AtomMask[No] = true; 2473 status = true; 2474 } else 2475 *out << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", however MinimumRingSize of " << MinimumRingSize[Walker->nr] << " does not allow further adaptive increase." << endl; 2471 2476 } 2472 2477 // close and done … … 2496 2501 { 2497 2502 AtomMask[Walker->nr] = true; // include all (non-hydrogen) atoms 2498 if ((Order != 0) && (Walker->AdaptiveOrder < Order) )2503 if ((Order != 0) && (Walker->AdaptiveOrder < Order) && (Walker->AdaptiveOrder < MinimumRingSize[Walker->nr])) 2499 2504 status = true; 2500 2505 } … … 2624 2629 KeyStack *RootStack = new KeyStack[Subgraphs->next->Count()]; 2625 2630 AtomMask = new bool[AtomCount+1]; 2626 while (CheckOrderAtSite(out, AtomMask, ParsedFragmentList, Order, configuration->configpath)) {2631 while (CheckOrderAtSite(out, AtomMask, ParsedFragmentList, Order, MinimumRingSize, configuration->configpath)) { 2627 2632 AtomMask[AtomCount] = true; // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite() 2628 2633 // ===== 6b. fill RootStack for each subgraph (second adaptivity check) ===== … … 3974 3979 // with the order along the cells as this: 5433222211111111 for BondOrder 5 needing 16=pow(2,5-1) cells (only we use bit-shifting which is faster) 3975 3980 RootNr = 0; // counts through the roots in RootStack 3976 while ( RootNr < UpgradeCount) {3981 while ((RootNr < UpgradeCount) && (!RootStack.empty())) { 3977 3982 RootKeyNr = RootStack.front(); 3978 3983 RootStack.pop_front(); 3979 3984 Walker = FindAtom(RootKeyNr); 3980 3985 // check cyclic lengths 3981 if ((MinimumRingSize[Walker->GetTrueFather()->nr] != -1) && (Walker->GetTrueFather()->AdaptiveOrder+1 > =MinimumRingSize[Walker->GetTrueFather()->nr])) {3986 if ((MinimumRingSize[Walker->GetTrueFather()->nr] != -1) && (Walker->GetTrueFather()->AdaptiveOrder+1 > MinimumRingSize[Walker->GetTrueFather()->nr])) { 3982 3987 *out << Verbose(0) << "Bond order " << Walker->GetTrueFather()->AdaptiveOrder << " of Root " << *Walker << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed." << endl; 3983 3988 } else { -
molecuilder/src/molecules.hpp
rdb3ea3 r747b10 242 242 /// Fragment molecule by two different approaches: 243 243 void FragmentMolecule(ofstream *out, int Order, config *configuration); 244 bool CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, char *path = NULL);244 bool CheckOrderAtSite(ofstream *out, bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL); 245 245 bool StoreAdjacencyToFile(ofstream *out, char *path); 246 246 bool CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms);
Note:
See TracChangeset
for help on using the changeset viewer.
