Ignore:
Timestamp:
Apr 30, 2010, 10:07:23 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
59e7832
Parents:
f70c2a
Message:

Declared the Vector class as single point spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.cpp

    rf70c2a r4eee8f  
    7979 * \return \f$| x - y |\f$
    8080 */
    81 double Vector::Distance(const Vector &y) const
     81double Vector::distance(const Vector &y) const
    8282{
    8383  return (sqrt(DistanceSquared(y)));
    8484};
     85
     86Vector Vector::getClosestPoint(const Vector &point) const{
     87  // the closest point to a single point space is always the single point itself
     88  return *this;
     89}
    8590
    8691/** Calculates distance between this and another vector in a periodic cell.
     
    9196double Vector::PeriodicDistance(const Vector &y, const double * const cell_size) const
    9297{
    93   double res = Distance(y), tmp, matrix[NDIM*NDIM];
     98  double res = distance(y), tmp, matrix[NDIM*NDIM];
    9499    Vector Shiftedy, TranslationVector;
    95100    int N[NDIM];
     
    115120          Shiftedy = y + TranslationVector;
    116121          // get distance and compare with minimum so far
    117           tmp = Distance(Shiftedy);
     122          tmp = distance(Shiftedy);
    118123          if (tmp < res) res = tmp;
    119124        }
Note: See TracChangeset for help on using the changeset viewer.