Ignore:
Timestamp:
Apr 15, 2010, 10:54:26 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
32842d8
Parents:
1f591b
Message:

Changed implementation of Vector to forward operations to contained objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule_geometry.cpp

    r1f591b re7ea64  
    191191/** Scales all atoms by \a *factor.
    192192 * \param *factor pointer to scaling factor
     193 *
     194 * TODO: Is this realy what is meant, i.e.
     195 * x=(x[0]*factor[0],x[1]*factor[1],x[2]*factor[2]) (current impl)
     196 * or rather
     197 * x=(**factor) * x (as suggested by comment)
    193198 */
    194199void molecule::Scale(const double ** const factor)
     
    199204    ptr = ptr->next;
    200205    for (int j=0;j<MDSteps;j++)
    201       ptr->Trajectory.R.at(j).Scale(factor);
    202     ptr->x.Scale(factor);
     206      ptr->Trajectory.R.at(j).ScaleAll(*factor);
     207    ptr->x.ScaleAll(*factor);
    203208  }
    204209};
     
    214219    ptr = ptr->next;
    215220    for (int j=0;j<MDSteps;j++)
    216       ptr->Trajectory.R.at(j).Translate(*trans);
    217     ptr->x.Translate(*trans);
     221      ptr->Trajectory.R.at(j) += (*trans);
     222    ptr->x += (*trans);
    218223  }
    219224};
Note: See TracChangeset for help on using the changeset viewer.