Changeset 8bc524 for molecuilder/src/moleculelist.cpp
- Timestamp:
- Nov 3, 2009, 12:37:55 PM (16 years ago)
- Children:
- 5f9f8b
- Parents:
- df0520
- git-author:
- Frederik Heber <heber@…> (11/03/09 08:41:45)
- git-committer:
- Frederik Heber <heber@…> (11/03/09 12:37:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/moleculelist.cpp
rdf0520 r8bc524 422 422 423 423 // 0b. allocate memory for constants 424 FitConstant = Malloc<double**>(3, "MoleculeListClass::AddHydrogenCorrection: ***FitConstant");424 FitConstant = Calloc<double**>(3, "MoleculeListClass::AddHydrogenCorrection: ***FitConstant"); 425 425 for (int k = 0; k < 3; k++) { 426 FitConstant[k] = Malloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **FitConstant[]");426 FitConstant[k] = Calloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **FitConstant[]"); 427 427 for (int i = a; i--;) { 428 FitConstant[k][i] = Malloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *FitConstant[][]");428 FitConstant[k][i] = Calloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *FitConstant[][]"); 429 429 } 430 430 } … … 471 471 472 472 // 0d. allocate final correction matrix 473 correction = Malloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **correction");473 correction = Calloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **correction"); 474 474 for (int i = a; i--;) 475 correction[i] = Malloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *correction[]");475 correction[i] = Calloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *correction[]"); 476 476 477 477 // 1a. go through every molecule in the list … … 548 548 output.close(); 549 549 // 6. free memory of parsed matrices 550 FitConstant = Malloc<double**>(a, "MoleculeListClass::AddHydrogenCorrection: ***FitConstant");551 550 for (int k = 0; k < 3; k++) { 552 FitConstant[k] = Malloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **FitConstant[]");553 551 for (int i = a; i--;) { 554 FitConstant[k][i] = Malloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *FitConstant[][]"); 555 } 556 } 552 Free(&FitConstant[k][i]); 553 } 554 Free(&FitConstant[k]); 555 } 556 Free(&FitConstant); 557 557 cout << "done." << endl; 558 558 return true; … … 712 712 //outputFragment.close(); 713 713 //outputFragment.clear(); 714 delete (FragmentNumber); 715 //Free(&FragmentNumber); 714 Free(&FragmentNumber); 716 715 } 717 716 cout << " done." << endl; … … 848 847 } 849 848 } 850 FragmentCounter++;851 if (next != NULL)852 status = next->FillBondStructureFromReference(out, reference, FragmentCounter, ListOfLocalAtoms);853 FragmentCounter--;849 // FragmentCounter++; 850 // if (next != NULL) 851 // status = next->FillBondStructureFromReference(out, reference, FragmentCounter, ListOfLocalAtoms); 852 // FragmentCounter--; 854 853 } 855 854 … … 860 859 Free(&ListOfLocalAtoms); 861 860 } 862 FragmentCounter--;863 861 *out << Verbose(1) << "End of FillBondStructureFromReference." << endl; 864 862 return status; … … 907 905 908 906 /** Fills a lookup list of father's Atom::nr -> atom for each subgraph. 909 * \param *out output stream fro debugging907 * \param *out output stream from debugging 910 908 * \param ***ListOfLocalAtoms Lookup table for each subgraph and index of each atom in global molecule, may be NULL on start, then it is filled 911 909 * \param FragmentCounter counts the fragments as we move along the list 912 910 * \param GlobalAtomCount number of atoms in the complete molecule 913 911 * \param &FreeList true - ***ListOfLocalAtoms is free'd before return, false - it is not 914 * \return true - succes , false - failure912 * \return true - success, false - failure 915 913 */ 916 914 bool MoleculeLeafClass::FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList) … … 921 919 if (ListOfLocalAtoms == NULL) { // allocated initial pointer 922 920 // allocate and set each field to NULL 923 ListOfLocalAtoms = Malloc<atom**>(Counter, "MoleculeLeafClass::FillBondStructureFromReference- ***ListOfLocalAtoms");921 ListOfLocalAtoms = Calloc<atom**>(Counter, "MoleculeLeafClass::FillListOfLocalAtoms - ***ListOfLocalAtoms"); 924 922 if (ListOfLocalAtoms != NULL) { 925 for (int i = Counter; i--;)926 ListOfLocalAtoms[i] = NULL;927 923 FreeList = FreeList && true; 928 924 } else … … 965 961 if (FragmentList == NULL) { 966 962 KeySetCounter = Count(); 967 FragmentList = Malloc<Graph*>(KeySetCounter, "MoleculeLeafClass::AssignKeySetsToFragment - **FragmentList"); 968 for (int i = KeySetCounter; i--;) 969 FragmentList[i] = NULL; 963 FragmentList = Calloc<Graph*>(KeySetCounter, "MoleculeLeafClass::AssignKeySetsToFragment - **FragmentList"); 970 964 KeySetCounter = 0; 971 965 }
Note:
See TracChangeset
for help on using the changeset viewer.