Go to the documentation of this file.
12 #define SETPERIODIC( D, L) {PERIODIC[(D)] = 1; BoxSize[(D)] = (L); BoxHalf[(D)] = (L)/2.0;}
13 #define PDISTANCE( mydist, D) ((!PERIODIC[D])? (mydist) : (((mydist) > BoxHalf[D])?( (mydist) - BoxSize[D] ) : ( ((mydist) < -BoxHalf[D])? ((mydist) + BoxSize[D]) : (mydist) ) ))
14 #define NOPERIODIC {for(int i = 0; i < DIMENSIONS; i++) PERIODIC[i] = 0;};
28 sqdist += (
P[i] - S.
P[i]) * (
P[i] - S.
P[i]);
45 double dist, sqdist = 0;
48 sqdist += dist * dist;
54 Point(
double,
double);
Point & operator=(const Point &)
Definition: point_class.hpp:80
Point & operator-(const Point &)
Definition: point_class.hpp:94
Definition: point_class.hpp:18
double BoxHalf[DIMENSIONS]
Definition: point_class.hpp:10
double distance(const Point &S, int D)
Definition: point_class.hpp:32
double BoxSize[DIMENSIONS]
Definition: point_class.cpp:6
int PERIODIC[DIMENSIONS]
Definition: point_class.cpp:5
Point & operator+(const Point &)
Definition: point_class.hpp:87
double psqdistance(const Point &S)
Definition: point_class.hpp:41
#define DIMENSIONS
Definition: point_class.hpp:7
double P[DIMENSIONS]
Definition: point_class.hpp:20
Point()
Definition: point_class.hpp:63
double sqdistance(const Point &S)
Definition: point_class.hpp:22
#define PDISTANCE(mydist, D)
Definition: point_class.hpp:13