Changeset 972706
- Timestamp:
- Oct 7, 2009, 1:18:59 PM (16 years ago)
- Children:
- 70b7aa
- Parents:
- 0cd3b2
- File:
-
- 1 edited
-
molecuilder/src/molecule.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecule.cpp
r0cd3b2 r972706 822 822 time_t now; 823 823 824 now = time((time_t *)NULL); // Get the system time and put it into 'now' as 'calender time'825 walker = start;826 while (walker->next != end) { // go through every atom and count827 walker = walker->next;828 AtomNo++;829 }830 824 if (out != NULL) { 831 *out << AtomNo << "\n\tCreated by molecuilder on " << ctime(&now); 825 now = time((time_t *)NULL); // Get the system time and put it into 'now' as 'calender time' 826 *out << AtomCount << "\n\tCreated by molecuilder on " << ctime(&now); 832 827 ActOnAllAtoms( &atom::OutputXYZLine, out ); 833 828 return true; … … 876 871 void molecule::CountElements() 877 872 { 878 int i = 0; 879 for(i=MAX_ELEMENTS;i--;) 873 for(int i=MAX_ELEMENTS;i--;) 880 874 ElementsInMolecule[i] = 0; 881 875 ElementCount = 0; 882 876 883 atom *walker = start; 884 while (walker->next != end) { 885 walker = walker->next; 886 ElementsInMolecule[walker->type->Z]++; 887 i++; 888 } 889 for(i=MAX_ELEMENTS;i--;) 877 SetIndexedArrayForEachAtomTo ( ElementsInMolecule, &element::Z, &Increment, 1); 878 879 for(int i=MAX_ELEMENTS;i--;) 890 880 ElementCount += (ElementsInMolecule[i] != 0 ? 1 : 0); 891 881 }; 892 893 882 894 883
Note:
See TracChangeset
for help on using the changeset viewer.
