SpherePackingScenarioGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Event.h
Go to the documentation of this file.
00001 #ifndef  LS2_Event_H
00002 #define  LS2_Event_H
00003 
00004 #include "tarch/la/Vector.h"
00005 #include "GlobalValue.h"
00006 namespace algorithms{
00007 namespace ls2{
00008 class Event;
00009 }
00010 }
00011 #define INF    100000000
00012 #define dblINF 100000000.
00013 
00016 class algorithms::ls2::Event {
00017 
00018 public:
00023         Event(double time_i, int i_i, int j_i, tarch::la::Vector<DIM,int> v_i);
00027         Event(double time_i, int i_i, int j_i);
00031         Event(const Event& e);
00035         Event();
00040         ~Event();
00041         //friend class Box;
00045         bool operator<(const Event&) const;
00049         bool operator>(const Event&) const;
00053         void erase();
00054         //by Tan
00055         double getTime();
00056         void setTime(double time);
00057         int getCollisionPartnerI();
00058         void setCollisionPartnerI(int i);
00059         int getCollisionPartnerJ();
00060         void setCollisionPartnerJ(int j);
00061         tarch::la::Vector<DIM,int> getVector();
00062         void setVector(tarch::la::Vector<DIM,int> v);
00063 
00064 private:
00065 
00069         double time;
00073         int i;
00077         int j;
00081         tarch::la::Vector<DIM,int> v;
00082 
00083         /* 0<=j<=N                binary collision between i and j
00084      j=N+DIM+1+x            transfer where x=-(k+1) for left wall
00085                             and x=k+1 for right wall
00086      j=INF                 both check after Event that did not altered motion of                           i and check after Event that altered motion of i, i.e                           rescaling of velocities. I currently don't see need t                           o separate the two
00087 
00088      j=-1                  check after collision
00089 
00090      Virtual identifiers as scalars...I think bad idea, but here's my work
00091      there will be easily fixed problems if DIM>=10
00092      -x<=v<=x               x=k+1, image in k direction
00093      v=xy                   x,y
00094       =-xy                  -x,y
00095       =-yx                  x,-y
00096       =yx                   -x,-y
00097      v=xyz                  x,y,z
00098       =-xyz                 -x,y,z
00099       =-yxz                 x,-y,z
00100       =-zxy                 x,y,-z
00101       =zyx                  -x,-y,z
00102       =xzy                  x,-y,-z
00103       =yzx                  -x,y,-z
00104       =-zyx                 -x,-y,-z
00105          */
00106 
00107 };
00108 
00109 #endif 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines