Changeset 108d38
- Timestamp:
- May 18, 2010, 3:58:58 PM (15 years ago)
- Children:
- 9bb477, c20eac
- Parents:
- 06f141
- Location:
- molecuilder
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecule_geometry.cpp
r06f141 r108d38 109 109 110 110 if (ptr->next != end) { //list not empty? 111 while (ptr->next != end) { // continue with second if present111 while (ptr->next != end) { 112 112 ptr = ptr->next; 113 113 Num++; … … 125 125 Vector * molecule::DetermineCenterOfAll() const 126 126 { 127 atom *ptr = start ->next; // start at first in list127 atom *ptr = start; // start at first in list 128 128 Vector *a = new Vector(); 129 Vector tmp;130 129 double Num = 0; 131 130 132 131 a->Zero(); 133 132 134 if (ptr != end) { //list not empty?135 while (ptr->next != end) { // continue with second if present133 if (ptr->next != end) { //list not empty? 134 while (ptr->next != end) { 136 135 ptr = ptr->next; 137 136 Num += 1.; 138 tmp = ptr->x; 139 (*a) += tmp; 137 (*a) += ptr->x; 140 138 } 141 139 a->Scale(1./Num); // divide through total mass (and sign for direction)
Note:
See TracChangeset
for help on using the changeset viewer.