Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

QuadTreeNodeNM.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/List.h>
36 #include <ogdf/basic/geometry.h>
38 #include <complex>
39 
40 namespace ogdf {
41 namespace energybased {
42 namespace fmmm {
43 
47 {
49  friend ostream &operator<< (ostream &,const QuadTreeNodeNM &);
50 
52  friend istream &operator>> (istream &,QuadTreeNodeNM &);
53 
54 public:
55 
56  QuadTreeNodeNM();
57  ~QuadTreeNodeNM();
58 
59  void set_Sm_level(int l) { Sm_level = l;}
61  void set_Sm_boxlength(double l) {Sm_boxlength = l;}
62  void set_x_List_ptr(List<ParticleInfo>* x_ptr) {L_x_ptr = x_ptr;}
63  void set_y_List_ptr(List<ParticleInfo>* y_ptr) {L_y_ptr = y_ptr;}
65  void set_Sm_center(std::complex<double> c) {Sm_center = c;}
68  node pop_contained_nodes() {return contained_nodes.popFrontRet();}
69  bool contained_nodes_empty() {return contained_nodes.empty();}
70 
71  void set_I(List<QuadTreeNodeNM*>& l) {I = l;}
74  void set_M(List<QuadTreeNodeNM*>& l) {M = l;}
75 
77  void set_locale_exp(Array<std::complex<double> > &local,int precision)
78  {
79  int i;
80  LE = new std::complex<double> [precision+1];
81  for (i = 0 ; i<= precision; i++)
82  LE[i] = local[i];
83  }
84 
86  void set_multipole_exp(Array<std::complex<double> > &multi,int precision)
87  {
88  int i;
89  ME = new std::complex<double> [precision+1];
90  for (i = 0 ; i<= precision; i++)
91  ME[i] = multi[i];
92  }
93 
95  void replace_multipole_exp(Array<std::complex<double> > &multi,int precision)
96  {
97  int i;
98  for (i = 0 ; i<= precision; i++)
99  ME[i] = multi[i];
100  }
101 
107 
108  bool is_root() {if(father_ptr == nullptr) return true; else return false;}
109  bool is_leaf(){if ((child_lt_ptr == nullptr) &&(child_rt_ptr == nullptr) &&(child_lb_ptr
110  == nullptr) && (child_rb_ptr == nullptr))
111  return true; else return false;}
112  bool child_lt_exists() { if (child_lt_ptr != nullptr) return true; else return false;}
113  bool child_rt_exists() { if (child_rt_ptr != nullptr) return true; else return false;}
114  bool child_lb_exists() { if (child_lb_ptr != nullptr) return true; else return false;}
115  bool child_rb_exists() { if (child_rb_ptr != nullptr) return true; else return false;}
116 
117  int get_Sm_level () const {return Sm_level;}
119  double get_Sm_boxlength () const {return Sm_boxlength; }
123  std::complex<double> get_Sm_center() const {return Sm_center;}
124  std::complex<double>* get_local_exp () const {return LE;}
125  std::complex<double>* get_multipole_exp () const {return ME;}
127  void get_I (List <QuadTreeNodeNM*>& l) const {l = I;}
128  void get_D1 (List <QuadTreeNodeNM*>& l) const {l = D1;}
129  void get_D2 (List <QuadTreeNodeNM*>& l) const {l = D2;}
130  void get_M (List <QuadTreeNodeNM*>& l) const {l = M;}
131 
137 
138 private:
139 
140  int Sm_level;
142  double Sm_boxlength;
148  std::complex<double> Sm_center;
150  std::complex<double>* ME;
151  std::complex<double>* LE;
165 };
166 
167 }
168 }
169 }
std::complex< double > * get_multipole_exp() const
void set_child_rb_ptr(QuadTreeNodeNM *c)
List< ParticleInfo > * L_x_ptr
points to the lists that contain each Particle of G with its x(y)coordinate in increasing order ...
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:56
void set_contained_nodes(List< node > &L)
QuadTreeNodeNM * get_child_lb_ptr() const
void set_y_List_ptr(List< ParticleInfo > *y_ptr)
DPoint Sm_downleftcorner
coords of the down left corner of the small cell
std::complex< double > * ME
Multipole Expansion terms.
void set_D2(List< QuadTreeNodeNM *> &l)
friend istream & operator>>(istream &, QuadTreeNodeNM &)
Inputstream for QuadTreeNodeNM.
void get_D2(List< QuadTreeNodeNM *> &l) const
void set_M(List< QuadTreeNodeNM *> &l)
int subtreeparticlenumber
the number of particles in the subtree rooted at this node
void set_x_List_ptr(List< ParticleInfo > *x_ptr)
void set_child_lt_ptr(QuadTreeNodeNM *c)
QuadTreeNodeNM * get_child_lt_ptr() const
Real points.
Definition: geometry.h:219
std::complex< double > * LE
Locale Expansion terms.
void set_child_lb_ptr(QuadTreeNodeNM *c)
List< QuadTreeNodeNM * > D2
list of neighbouring(=D1) and not adjacent(=D2) leaves for direct force calculation in DIM2 ...
List< QuadTreeNodeNM * > I
the list of min.
std::complex< double > get_Sm_center() const
Helping data structure that stores the information needed to represent a node of the reduced quad tre...
double Sm_boxlength
length of small cell
List< node > contained_nodes
list of nodes of G that are contained in this QuadTreeNode (emty if it is not a leave of the ModQuadT...
void get_I(List< QuadTreeNodeNM *> &l) const
QuadTreeNodeNM * child_lb_ptr
points to left bottom child
QuadTreeNodeNM * get_father_ptr() const
friend ostream & operator<<(ostream &, const QuadTreeNodeNM &)
Outputstream for QuadTreeNodeNM.
void set_father_ptr(QuadTreeNodeNM *f)
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
void get_D1(List< QuadTreeNodeNM *> &l) const
List< ParticleInfo > * get_x_List_ptr()
List< ParticleInfo > * L_y_ptr
and a cross reference to the list_item in the list with the other coordinate
QuadTreeNodeNM * child_rt_ptr
points to right bottom child
void get_M(List< QuadTreeNodeNM *> &l) const
void set_multipole_exp(Array< std::complex< double > > &multi, int precision)
ME[i] is set to multi[i] for i = 0 to precision and space for LE is reserved.
Class for the representation of nodes.
Definition: Graph_d.h:167
void set_child_rt_ptr(QuadTreeNodeNM *c)
int Sm_level
level of the small cell
void set_I(List< QuadTreeNodeNM *> &l)
void set_Sm_center(std::complex< double > c)
Declaration of class ParticleInfo.
QuadTreeNodeNM * get_child_rt_ptr() const
void replace_multipole_exp(Array< std::complex< double > > &multi, int precision)
ME[i] is set to multi[i] for i = 0 to precision and no space for LE is reserved.
Includes declaration of graph class.
QuadTreeNodeNM * child_lt_ptr
points to left top child
List< QuadTreeNodeNM * > M
list of nodes with multipole force contribution like in DIM2
The namespace for all OGDF objects.
Declaration of classes DPoint, DPolyline, DLine, DRect, DIntersectableRect, DScaler.
QuadTreeNodeNM * child_rb_ptr
points to right bottom child
std::complex< double > Sm_center
center of the small cell
void set_D1(List< QuadTreeNodeNM *> &l)
std::complex< double > * get_local_exp() const
QuadTreeNodeNM * father_ptr
points to the father node
Declaration of doubly linked lists and iterators.
void get_contained_nodes(List< node > &L) const
void set_locale_exp(Array< std::complex< double > > &local, int precision)
LE[i] is set to local[i] for i = 0 to precision and space for LE is reserved.
QuadTreeNodeNM * get_child_rb_ptr() const
List< ParticleInfo > * get_y_List_ptr()