Changeset f444ce for molecuilder
- Timestamp:
- Oct 18, 2009, 4:09:26 PM (16 years ago)
- Children:
- 6e250f
- Parents:
- c9f639
- Location:
- molecuilder/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/atom.cpp
rc9f639 rf444ce 292 292 }; 293 293 294 /** Outputs the current atom::AdaptiveOrder and atom::MaxOrder to \a *file. 295 * \param *file output stream 296 */ 297 void atom::OutputOrder(ofstream *file) 298 { 299 *file << nr << "\t" << (int)AdaptiveOrder << "\t" << (int)MaxOrder << endl; 300 //cout << Verbose(2) << "Storing: " << nr << "\t" << (int)AdaptiveOrder << "\t" << (int)MaxOrder << "." << endl; 301 }; 302 303 /** Initialises the component number array. 304 * Size is set to atom::ListOfBonds.size()+1 (last is th encode end by -1) 305 */ 306 void atom::InitComponentNr() 307 { 308 if (ComponentNr != NULL) 309 Free(&ComponentNr); 310 ComponentNr = Malloc<int>(ListOfBonds.size()+1, "atom::InitComponentNumbers: *ComponentNr"); 311 for (int i=ListOfBonds.size()+1;i--;) 312 ComponentNr[i] = -1; 313 }; 314 294 315 /** Puts a given bond into atom::ListOfBonds. 295 316 * \param *Binder bond to insert … … 471 492 }; 472 493 473 /** Outputs the current atom::AdaptiveOrder and atom::MaxOrder to \a *file.474 * \param *file output stream475 */476 void atom::OutputOrder(ofstream *file)477 {478 *file << nr << "\t" << (int)AdaptiveOrder << "\t" << (int)MaxOrder << endl;479 //cout << Verbose(2) << "Storing: " << nr << "\t" << (int)AdaptiveOrder << "\t" << (int)MaxOrder << "." << endl;480 }481 482 494 /** Returns squared distance to a given vector. 483 495 * \param origin vector to calculate distance to -
molecuilder/src/atom.hpp
rc9f639 rf444ce 104 104 void OutputGraphInfo(ofstream *out) const; 105 105 void OutputComponentNumber(ofstream *out) const; 106 void InitComponentNr(); 106 107 int CountBonds() const; 107 108 int CorrectBondDegree(ofstream *out); -
molecuilder/src/molecule_graph.cpp
rc9f639 rf444ce 388 388 ResetAllBondsToUnused(); 389 389 ResetAllAtomNumbers(); 390 InitComponentNumbers();390 ActOnAllAtoms( &atom::InitComponentNr ); 391 391 BackEdgeStack->ClearStack(); 392 392 while (Root != end) { // if there any atoms at all … … 781 781 } else 782 782 cerr << "Error: Given vertex is NULL!" << endl; 783 };784 785 /** Allocates memory for all atom::*ComponentNr in this molecule and sets each entry to -1.786 */787 void molecule::InitComponentNumbers()788 {789 atom *Walker = start;790 while(Walker->next != end) {791 Walker = Walker->next;792 if (Walker->ComponentNr != NULL)793 Free(&Walker->ComponentNr);794 Walker->ComponentNr = Malloc<int>(Walker->ListOfBonds.size()+1, "molecule::InitComponentNumbers: *Walker->ComponentNr");795 for (int i=Walker->ListOfBonds.size()+1;i--;)796 Walker->ComponentNr[i] = -1;797 }798 783 }; 799 784
Note:
See TracChangeset
for help on using the changeset viewer.