Changeset d760bb for src/Fragmentation
- Timestamp:
- Feb 24, 2013, 12:59:18 PM (12 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- c91572
- Parents:
- b6b5b8
- git-author:
- Frederik Heber <heber@…> (02/19/13 12:42:38)
- git-committer:
- Frederik Heber <heber@…> (02/24/13 12:59:18)
- Location:
- src/Fragmentation
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Fragmentation/AdaptivityMap.cpp ¶
rb6b5b8 rd760bb 155 155 if (Walker != NULL) { 156 156 //if ((*runner).second.second >= Walker->AdaptiveOrder) { // only insert if this is an "active" root site for the current order 157 if ( !Walker->MaxOrder) {157 if (Walker->MaxOrder > Walker->AdaptiveOrder) { 158 158 LOG(2, "(" << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "])"); 159 159 FinalRootCandidates->insert( make_pair( (*runner).second.first, pair<int,int>((*runner).first, (*runner).second.second) ) ); -
TabularUnified src/Fragmentation/BondsPerShortestPath.cpp ¶
rb6b5b8 rd760bb 100 100 { 101 101 LOG(0, "Free'ing all found lists and resetting index lists"); 102 std::stringstream output;103 102 for(int i=Order;i--;) { 103 std::stringstream output; 104 104 output << "Current SP level is " << i << ": "; 105 105 // delete added bonds … … 114 114 // also start and end node 115 115 output << "cleaned."; 116 }117 LOG(1, output.str());116 LOG(1, output.str()); 117 } 118 118 }; 119 119 … … 204 204 Binder != BondsPerSPList[i].end(); 205 205 ++Binder) { 206 LOG(2, * Binder);206 LOG(2, **Binder); 207 207 } 208 208 } … … 223 223 return SP; 224 224 }; 225 226 /** Getter for BondsPerShortestPath::Order.227 *228 * @return returns BondsPerShortestPath::Order229 */230 int BondsPerShortestPath::getOrder() const231 {232 return Order;233 } -
TabularUnified src/Fragmentation/BondsPerShortestPath.hpp ¶
rb6b5b8 rd760bb 50 50 }; 51 51 52 /** Getter for BondsPerShortestPath::Order. 53 * 54 * @return returns BondsPerShortestPath::Order 55 */ 56 #ifdef HAVE_INLINE 57 inline 58 #endif 59 int BondsPerShortestPath::getOrder() const 60 { 61 return Order; 62 } 63 52 64 53 65 #endif /* BONDSPERSHORTESTPATH_HPP_ */ -
TabularUnified src/Fragmentation/Fragmentation.cpp ¶
rb6b5b8 rd760bb 200 200 { 201 201 Info FunctionInfo(__func__); 202 Graph ***FragmentLowerOrdersList = NULL;202 std::vector<Graph*> *FragmentLowerOrdersList = NULL; 203 203 int NumLevels = 0; 204 204 int NumMolecules = 0; … … 210 210 int RootKeyNr = 0; 211 211 int RootNr = 0; 212 UniqueFragments FragmentSearch;213 212 214 213 // FragmentLowerOrdersList is a 2D-array of pointer to MoleculeListClass objects, one dimension represents the ANOVA expansion of a single order (i.e. 5) 215 214 // with all needed lower orders that are subtracted, the other dimension is the BondOrder (i.e. from 1 to 5) 216 215 NumMoleculesOfOrder = new int[UpgradeCount]; 217 FragmentLowerOrdersList = new Graph**[UpgradeCount];218 219 for(int i=0;i<UpgradeCount;i++) {216 FragmentLowerOrdersList = new std::vector<Graph*>[UpgradeCount]; 217 218 for(int i=0;i<UpgradeCount;i++) 220 219 NumMoleculesOfOrder[i] = 0; 221 FragmentLowerOrdersList[i] = NULL;222 }223 224 FragmentSearch.Init(mol->FindAtom(RootKeyNr));225 220 226 221 // Construct the complete KeySet which we need for topmost level only (but for all Roots) … … 244 239 //} else 245 240 { 246 // increase adaptive order by one247 Walker->GetTrueFather()->AdaptiveOrder ++;241 // set adaptive order to desired max order 242 Walker->GetTrueFather()->AdaptiveOrder = Walker->GetTrueFather()->MaxOrder; 248 243 Order = Walker->AdaptiveOrder = Walker->GetTrueFather()->AdaptiveOrder; 249 244 245 // allocate memory for all lower level orders 246 NumLevels = Order; 247 FragmentLowerOrdersList[RootNr].resize(NumLevels, NULL); 248 for( size_t i=0;i<NumLevels;++i) 249 FragmentLowerOrdersList[RootNr][i] = new Graph; 250 250 251 // initialise Order-dependent entries of UniqueFragments structure 251 class PowerSetGenerator PSG(&FragmentSearch, Walker->AdaptiveOrder); 252 253 // allocate memory for all lower level orders in this 1D-array of ptrs 254 NumLevels = 1 << (Order-1); // (int)pow(2,Order); 255 FragmentLowerOrdersList[RootNr] = new Graph*[NumLevels]; 256 for (int i=0;i<NumLevels;i++) 257 FragmentLowerOrdersList[RootNr][i] = NULL; 252 UniqueFragments FragmentSearch(1., FragmentLowerOrdersList[RootNr], Walker); 253 PowerSetGenerator PSG(&FragmentSearch, Walker->AdaptiveOrder); 258 254 259 255 // create top order where nothing is reduced 260 256 LOG(0, "=============================================================================================================="); 261 LOG(0, "Creating KeySets ofBond Order " << Order << " for " << *Walker << ", " << (RootStack.size()-RootNr) << " Roots remaining."); // , NumLevels is " << NumLevels << "257 LOG(0, "Creating KeySets up till Bond Order " << Order << " for " << *Walker << ", " << (RootStack.size()-RootNr) << " Roots remaining."); // , NumLevels is " << NumLevels << " 262 258 263 259 // Create list of Graphs of current Bond Order (i.e. F_{ij}) 264 FragmentLowerOrdersList[RootNr][0] = new Graph;265 FragmentSearch.PrepareForPowersetGeneration(1., FragmentLowerOrdersList[RootNr][0], Walker);266 260 NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, saturation); 267 261 … … 270 264 if (NumMoleculesOfOrder[RootNr] != 0) { 271 265 NumMolecules = 0; 272 } else {273 Walker->GetTrueFather()->MaxOrder = true;274 266 } 275 267 // now, we have completely filled each cell of FragmentLowerOrdersList[] for the current Walker->AdaptiveOrder … … 284 276 LOG(1, "Total number of resulting molecules is: " << TotalNumMolecules << "."); 285 277 LOG(0, "=============================================================================================================="); 286 287 // cleanup FragmentSearch structure288 FragmentSearch.Cleanup();289 278 290 279 // now, FragmentLowerOrdersList is complete, it looks - for BondOrder 5 - as this (number is the ANOVA Order of the terms therein) … … 362 351 delete[](IndexKeySetList); 363 352 } else { // global increase of Bond Order 364 for(molecule:: const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {353 for(molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) { 365 354 if (AtomMask.isTrue((*iter)->getNr())) { // skip masked out 355 (*iter)->MaxOrder = (Order != 0 ? Order : (*iter)->MaxOrder+1); 366 356 // remove all that have reached desired order 367 if (( Order != 0) && ((*iter)->AdaptiveOrder >= Order)) // && ((*iter)->AdaptiveOrder < MinimumRingSize[(*iter)->getNr()]))357 if ((*iter)->AdaptiveOrder >= (*iter)->MaxOrder) // && ((*iter)->AdaptiveOrder < MinimumRingSize[(*iter)->getNr()])) 368 358 AtomMask.setFalse((*iter)->getNr()); 369 359 else … … 450 440 for(molecule::iterator iter=mol->begin();iter!=mol->end();++iter){ 451 441 (*iter)->AdaptiveOrder = OrderArray[(*iter)->getNr()]; 452 (*iter)->MaxOrder = MaxArray.isTrue((*iter)->getNr());442 (*iter)->MaxOrder = OrderArray[(*iter)->getNr()]; //MaxArray.isTrue((*iter)->getNr()); 453 443 } 454 444 //SetAtomValueToIndexedArray( OrderArray, &atom::getNr(), &atom::AdaptiveOrder ); -
TabularUnified src/Fragmentation/PowerSetGenerator.cpp ¶
rb6b5b8 rd760bb 50 50 * 51 51 */ 52 PowerSetGenerator::PowerSetGenerator( class UniqueFragments *_FragmentSearch, intOrder) :53 BondsPerSPList( Order),52 PowerSetGenerator::PowerSetGenerator(UniqueFragments *_FragmentSearch, int _Order) : 53 BondsPerSPList(_Order), 54 54 FragmentSearch(_FragmentSearch) 55 55 {} … … 213 213 int SP = BondsPerSPList.CountNumbersInBondsList(); 214 214 LOG(0, "Total number of edges is " << SP << "."); 215 if (SP >= (BondsPerSPList.getOrder()-1)){215 { 216 216 // start with root (push on fragment stack) 217 217 LOG(0, "Starting fragment generation with " << *FragmentSearch->getRoot() << ", local nr is " << FragmentSearch->getRoot()->getNr() << "."); … … 227 227 228 228 SPFragmentGenerator(0, BondsList, BondsPerSPList.BondsPerSPCount[0], BondsPerSPList.getOrder()); 229 } else {230 LOG(0, "Not enough total number of edges to build " << BondsPerSPList.getOrder() << "-body fragments.");231 229 } 232 230 … … 261 259 Info info(__func__); 262 260 int verbosity = 0; //FragmentSearch->ANOVAOrder-SubOrder; 263 int NumCombinations; 264 int bits, TouchedIndex, SubSetDimension, SP, Added; 261 int TouchedIndex, SubSetDimension, Added; 265 262 int SpaceLeft; 266 263 int *TouchedList = new int[SubOrder + 1]; 267 264 KeySetTestPair TestKeySetInsert; 268 265 269 NumCombinations = 1 << SetDimension;266 const int NumCombinations = 1 << SetDimension; 270 267 271 268 // here for all bonds of Walker all combinations of end pieces (from the bonds) … … 282 279 for (int i=1;i<NumCombinations;i++) { // sweep through all power set combinations (skip empty set!) 283 280 // count the set bit of i 284 bits = 0; 285 for (int j=SetDimension;j--;) 286 bits += (i & (1 << j)) >> j; 281 const int bits = countBits(i, SetDimension); 287 282 288 283 LOG(1+verbosity, "Current set is " << Binary(i | (1 << SetDimension)) << ", number of bits is " << bits << "."); … … 291 286 Added = AddPowersetToSnakeStack(verbosity, i, SetDimension, FragmentSearch->FragmentSet, BondsSet, TouchedList, TouchedIndex); 292 287 288 // --2-- store the fragment 289 const int order = BondsPerSPList.getOrder() - SubOrder + Added - 1; 290 LOG(1+verbosity, "Storing fragment as order " << order << "."); 291 // store fragment as a KeySet 292 if (DoLog(2)) { 293 std::stringstream output; 294 output << "Found a new fragment[" << FragmentSearch->FragmentCounter << "], local nr.s are: "; 295 for(KeySet::iterator runner = FragmentSearch->FragmentSet->begin(); runner != FragmentSearch->FragmentSet->end(); runner++) 296 output << (*runner) << " "; 297 LOG(2, output.str()); 298 } 299 FragmentSearch->InsertFragmentIntoGraph(order); 300 301 // --3-- if below SubOrder still, recurse 293 302 SpaceLeft = SubOrder - Added ;// SubOrder - bits; // due to item's maybe being already present, this does not work anymore 294 if ( SpaceLeft > 0) {303 if ((SpaceLeft > 0) && (RootDistance < BondsPerSPList.getOrder())) { 295 304 LOG(1+verbosity, "There's still some space left on stack: " << SpaceLeft << "."); 296 305 if (SubOrder > 1) { // Due to Added above we have to check extra whether we're not already reaching beyond the desired Order 297 306 // --2-- look at all added end pieces of this combination, construct bond subsets and sweep through a power set of these by recursion 298 SP = RootDistance+1; // this is the next level307 const int SP = RootDistance+1; // this is the next level 299 308 300 309 // first count the members in the subset … … 311 320 } 312 321 } else { 313 // --2-- otherwise store the complete fragment 314 LOG(1+verbosity, "Enough items on stack for a fragment!"); 315 // store fragment as a KeySet 316 if (DoLog(2)) { 317 std::stringstream output; 318 output << "Found a new fragment[" << FragmentSearch->FragmentCounter << "], local nr.s are: "; 319 for(KeySet::iterator runner = FragmentSearch->FragmentSet->begin(); runner != FragmentSearch->FragmentSet->end(); runner++) 320 output << (*runner) << " "; 321 LOG(2, output.str()); 322 } 323 FragmentSearch->InsertFragmentIntoGraph(); 322 LOG(1+verbosity, "No more space or no shortest path levels, not recursing."); 324 323 } 325 324 -
TabularUnified src/Fragmentation/PowerSetGenerator.hpp ¶
rb6b5b8 rd760bb 26 26 { 27 27 public: 28 PowerSetGenerator(UniqueFragments *_FragmentSearch, int Order);28 PowerSetGenerator(UniqueFragments *_FragmentSearch, int _Order); 29 29 ~PowerSetGenerator(); 30 30 … … 38 38 39 39 private: 40 int countBits(const int bits, const int SetDimension) const; 41 40 42 BondsPerShortestPath BondsPerSPList; 43 UniqueFragments *FragmentSearch; 44 }; 41 45 42 class UniqueFragments *FragmentSearch; 43 }; 46 #ifdef HAVE_INLINE 47 inline 48 #endif 49 int PowerSetGenerator::countBits(const int i, const int SetDimension) const 50 { 51 int bits = 0; 52 for (int j=SetDimension;j--;) 53 bits += (i & (1 << j)) >> j; 54 return bits; 55 } 44 56 45 57 -
TabularUnified src/Fragmentation/UniqueFragments.cpp ¶
rb6b5b8 rd760bb 37 37 #include "UniqueFragments.hpp" 38 38 39 #include "CodePatterns/Assert.hpp" 39 40 #include "CodePatterns/Log.hpp" 40 41 … … 48 49 /** Constructor of class UniqueFragments. 49 50 * 51 * @param _TEFactor total energy factor 52 * @param _Leaflet current graph to work on 53 * @param _Root root atom 50 54 */ 51 UniqueFragments::UniqueFragments() 52 {} 55 UniqueFragments::UniqueFragments(double _TEFactor, std::vector<Graph*> &_Leaflets, atom *_Root) : 56 FragmentCounter(0), 57 Root(_Root), 58 TEFactor(_TEFactor), 59 Leaflets(_Leaflets) 60 { 61 FragmentSet = new KeySet; 62 } 53 63 54 64 /** Destructor of class UniqueFragments. … … 56 66 */ 57 67 UniqueFragments::~UniqueFragments() 58 {} 68 { 69 Cleanup(); 70 } 59 71 60 72 /** Checking whether KeySet is not already present in Graph, if so just adds factor. 73 * 74 * \param order order at which to insert 61 75 */ 62 void UniqueFragments::InsertFragmentIntoGraph( )76 void UniqueFragments::InsertFragmentIntoGraph(const size_t order) 63 77 { 64 78 GraphTestPair testGraphInsert; 65 79 66 testGraphInsert = Leaflet->insert(GraphPair (*FragmentSet,std::pair<int,double>(FragmentCounter,TEFactor))); // store fragment number and current factor 80 ASSERT( Leaflets.size() > order, 81 "UniqueFragments::InsertFragmentIntoGraph() - Leaflets has only " 82 +toString(Leaflets.size())+" entries, not enough for "+toString(order)); 83 testGraphInsert = Leaflets[order]->insert(GraphPair (*FragmentSet,std::pair<int,double>(FragmentCounter,TEFactor))); // store fragment number and current factor 67 84 if (testGraphInsert.second) { 68 85 LOG(2, "KeySet " << FragmentCounter << " successfully inserted."); … … 75 92 }; 76 93 77 /** Initialization for UniqueFragments.78 *79 * \param _Root ref to atom to start from (with graph algorithms, hence root node)80 * \param AtomCount number of nodes/atoms81 */82 void UniqueFragments::Init(atom *_Root)83 {84 // initialise the fragments structure85 FragmentCounter = 0;86 FragmentSet = new KeySet;87 Root = _Root;88 }89 90 94 /** Removes some allocated memory. 91 95 * … … 93 97 void UniqueFragments::Cleanup() 94 98 { 95 delete (FragmentSet);99 delete FragmentSet; 96 100 } 97 101 … … 113 117 Root=_root; 114 118 } 115 116 /** Sets initial values before PowerSetGenerator uses this class.117 *118 * @param _TEFactor total energy factor119 * @param _Leaflet current graph to work on120 * @param _Root root atom121 */122 void UniqueFragments::PrepareForPowersetGeneration(double _TEFactor, Graph *_Leaflet, atom *_Root)123 {124 TEFactor = _TEFactor;125 Leaflet = _Leaflet;126 Root = _Root;127 } -
TabularUnified src/Fragmentation/UniqueFragments.hpp ¶
rb6b5b8 rd760bb 14 14 #endif 15 15 16 #include <list>17 16 #include <vector> 18 17 19 18 class atom; 20 class bond;21 class config;22 19 class Graph; 23 20 class KeySet; … … 28 25 { 29 26 public: 30 UniqueFragments(); 27 UniqueFragments( 28 double _TEFactor, 29 std::vector<Graph*> &Leaflets, 30 atom *_Root); 31 31 ~UniqueFragments(); 32 32 33 void InsertFragmentIntoGraph(); // Insert a KeySet into a Graph 34 void Init(atom *_Root); 33 void InsertFragmentIntoGraph(const size_t order); // Insert a KeySet into a Graph 35 34 void Cleanup(); 36 35 37 36 atom * const getRoot() const; 38 37 void setRoot(atom *_root); 39 40 void PrepareForPowersetGeneration(double _TEFactor, Graph *_Leaflet, atom *_Root);41 38 42 39 KeySet *FragmentSet; … … 46 43 atom *Root; 47 44 double TEFactor; 48 Graph *Leaflet; 49 50 private: 51 int ANOVAOrder; 52 int CurrentIndex; 53 bool **UsedList; 45 std::vector<Graph*> &Leaflets; 54 46 }; 55 47 -
TabularUnified src/Fragmentation/fragmentation_helpers.cpp ¶
rb6b5b8 rd760bb 37 37 #include "fragmentation_helpers.hpp" 38 38 39 #include <algorithm> 39 40 #include <sstream> 40 41 42 #include "CodePatterns/Assert.hpp" 41 43 #include "CodePatterns/Log.hpp" 42 44 43 45 #include "Atom/atom.hpp" 44 #include "Bond/bond.hpp"45 #include "Element/element.hpp"46 46 #include "Fragmentation/AdaptivityMap.hpp" 47 47 #include "Fragmentation/AtomMask.hpp" … … 82 82 * \param *mol molecule with atoms and bonds 83 83 */ 84 int CombineAllOrderListIntoOne(Graph &FragmentList, Graph ***FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol)84 int CombineAllOrderListIntoOne(Graph &FragmentList, std::vector<Graph*> *&FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol) 85 85 { 86 86 int RootNr = 0; … … 99 99 RootStack.pop_front(); 100 100 Walker = mol->FindAtom(RootKeyNr); 101 NumLevels = 1 << (Walker->AdaptiveOrder - 1); 101 NumLevels = Walker->AdaptiveOrder; 102 ASSERT( NumLevels == FragmentLowerOrdersList[RootNr].size(), 103 "CombineAllOrderListIntoOne() - differing size and NumLevels."); 102 104 for(int i=0;i<NumLevels;i++) { 103 105 if (FragmentLowerOrdersList[RootNr][i] != NULL) { … … 113 115 /** Free's memory allocated for all KeySets from all orders. 114 116 * \param *out output stream for debugging 115 * \param ** *FragmentLowerOrdersList117 * \param **&FragmentLowerOrdersList 116 118 * \param &RootStack stack with all root candidates (unequal to each atom in complete molecule if adaptive scheme is applied) 117 119 * \param *mol molecule with atoms and bonds 118 120 */ 119 void FreeAllOrdersList( Graph ***FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol)121 void FreeAllOrdersList(std::vector<Graph*> *&FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol) 120 122 { 121 123 LOG(1, "Free'ing the lists of all orders per order."); … … 128 130 RootStack.pop_front(); 129 131 Walker = mol->FindAtom(RootKeyNr); 130 NumLevels = 1 << (Walker->AdaptiveOrder - 1);132 NumLevels = Walker->AdaptiveOrder; 131 133 for(int i=0;i<NumLevels;i++) { 132 134 if (FragmentLowerOrdersList[RootNr][i] != NULL) { 133 delete (FragmentLowerOrdersList[RootNr][i]);135 delete FragmentLowerOrdersList[RootNr][i]; 134 136 } 137 FragmentLowerOrdersList[RootNr].clear(); 135 138 } 136 delete[](FragmentLowerOrdersList[RootNr]);137 139 RootNr++; 138 140 } 139 delete[] (FragmentLowerOrdersList);141 delete[] FragmentLowerOrdersList; 140 142 }; 141 143 -
TabularUnified src/Fragmentation/fragmentation_helpers.hpp ¶
rb6b5b8 rd760bb 15 15 16 16 #include <deque> 17 #include <list>18 #include <map>19 #include <string>20 17 #include <vector> 21 18 … … 31 28 void PrintAtomMask(const AtomMask_t &AtomMask, int AtomCount); 32 29 33 int CombineAllOrderListIntoOne(Graph &FragmentList, Graph ***FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol);34 void FreeAllOrdersList( Graph ***FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol);30 int CombineAllOrderListIntoOne(Graph &FragmentList, std::vector<Graph*> *&FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol); 31 void FreeAllOrdersList(std::vector<Graph*> *&FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol); 35 32 36 33 const std::vector<atomId_t> getGlobalIdsFromLocalIds(const molecule &mol, const std::vector<atomId_t> &atomids);
Note:
See TracChangeset
for help on using the changeset viewer.