Changeset 7f3b9d for src/moleculelist.cpp
- Timestamp:
- May 23, 2008, 9:17:19 AM (18 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, Candidate_v1.7.0, 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:
- 040f93
- Parents:
- 6097ea
- File:
-
- 1 edited
-
src/moleculelist.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r6097ea r7f3b9d 22 22 { 23 23 ListOfMolecules = (molecule **) Malloc(sizeof(molecule *)*NumMolecules, "MoleculeListClass:MoleculeListClass: **ListOfMolecules"); 24 for (int i= 0;i<NumMolecules;i++)24 for (int i=NumMolecules;i--;) 25 25 ListOfMolecules[i] = NULL; 26 26 NumberOfMolecules = NumMolecules; … … 34 34 { 35 35 cout << Verbose(3) << this << ": Freeing ListOfMolcules." << endl; 36 for (int i= 0;i<NumberOfMolecules;i++) {36 for (int i=NumberOfMolecules;i--;) { 37 37 if (ListOfMolecules[i] != NULL) { // if NULL don't free 38 38 cout << Verbose(4) << "ListOfMolecules: Freeing " << ListOfMolecules[i] << "." << endl; … … 66 66 else { 67 67 Count = (**(molecule **)a).AtomCount; 68 aList = (int *) Malloc(sizeof(int)*Count, "MolCompare: *aList");69 bList = (int *) Malloc(sizeof(int)*Count, "MolCompare: *bList");68 aList = new int[Count]; 69 bList = new int[Count]; 70 70 71 71 // fill the lists … … 114 114 } 115 115 } 116 Free((void **)&aList, "MolCompare: *aList");117 Free((void **)&bList, "MolCompare: *bList");116 delete[](aList); 117 delete[](bList); 118 118 return flag; 119 119 } … … 244 244 ListOfMolecules[i]->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary 245 245 int j = -1; 246 for (int k=0;k< 3;k++) {246 for (int k=0;k<NDIM;k++) { 247 247 j += k+1; 248 248 BoxDimension.x[k] = 5.; … … 268 268 outputFragment.close(); 269 269 outputFragment.clear(); 270 Free((void **)&FragmentNumber, "MoleculeListClass::OutputConfigForListOfFragments: *FragmentNumber"); 270 delete(FragmentNumber); 271 //Free((void **)&FragmentNumber, "MoleculeListClass::OutputConfigForListOfFragments: *FragmentNumber"); 271 272 } 272 273 cout << " done." << endl; … … 461 462 ListOfLocalAtoms = (atom ***) Malloc(sizeof(atom **)*Counter, "MoleculeLeafClass::FillBondStructureFromReference - ***ListOfLocalAtoms"); 462 463 if (ListOfLocalAtoms != NULL) { 463 for (int i= 0;i<Counter;i++)464 for (int i=Counter;i--;) 464 465 ListOfLocalAtoms[i] = NULL; 465 466 FreeList = FreeList && true; … … 501 502 KeySetCounter = Count(); 502 503 FragmentList = (Graph **) Malloc(sizeof(Graph *)*KeySetCounter, "MoleculeLeafClass::AssignKeySetsToFragment - **FragmentList"); 503 for(int i= 0;i<KeySetCounter;i++)504 for(int i=KeySetCounter;i--;) 504 505 FragmentList[i] = NULL; 505 506 KeySetCounter = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
