Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

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 std::ostream &operator<< (std::ostream &,const QuadTreeNodeNM &);
50 
52  friend std::istream &operator>> (std::istream &,QuadTreeNodeNM &);
53 
54 public:
55 
56  QuadTreeNodeNM();
57  ~QuadTreeNodeNM();
58 
59  void set_Sm_level(int level) { Sm_level = level;}
61  void set_Sm_boxlength(double len) {Sm_boxlength = len;}
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*>& list) {I = list;}
72  void set_D1(List<QuadTreeNodeNM*>& list) {D1 = list;}
73  void set_D2(List<QuadTreeNodeNM*>& list) {D2 = list;}
74  void set_M(List<QuadTreeNodeNM*>& list) {M = list;}
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() { return father_ptr == nullptr; }
109  bool is_leaf() { return child_lt_ptr == nullptr && child_rt_ptr == nullptr && child_lb_ptr == nullptr && child_rb_ptr == nullptr; }
110  bool child_lt_exists() { return child_lt_ptr != nullptr; }
111  bool child_rt_exists() { return child_rt_ptr != nullptr; }
112  bool child_lb_exists() { return child_lb_ptr != nullptr; }
113  bool child_rb_exists() { return child_rb_ptr != nullptr; }
114 
115  int get_Sm_level () const {return Sm_level;}
117  double get_Sm_boxlength () const {return Sm_boxlength; }
121  std::complex<double> get_Sm_center() const {return Sm_center;}
122  std::complex<double>* get_local_exp () const {return LE;}
123  std::complex<double>* get_multipole_exp () const {return ME;}
124  void get_contained_nodes(List<node>& list) const {list = contained_nodes;}
125  void get_I(List<QuadTreeNodeNM*>& list) const {list = I;}
126  void get_D1(List<QuadTreeNodeNM*>& list) const {list = D1;}
127  void get_D2(List<QuadTreeNodeNM*>& list) const {list = D2;}
128  void get_M(List<QuadTreeNodeNM*>& list) const {list = M;}
129 
135 
136 private:
137 
138  int Sm_level;
140  double Sm_boxlength;
146  std::complex<double> Sm_center;
148  std::complex<double>* ME;
149  std::complex<double>* LE;
163 };
164 
165 }
166 }
167 }
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:200
void get_D1(List< QuadTreeNodeNM *> &list) const
QuadTreeNodeNM * get_child_lb_ptr() const
void set_y_List_ptr(List< ParticleInfo > *y_ptr)
friend std::ostream & operator<<(std::ostream &, const QuadTreeNodeNM &)
Outputstream for QuadTreeNodeNM.
void get_D2(List< QuadTreeNodeNM *> &list) const
void set_D1(List< QuadTreeNodeNM *> &list)
DPoint Sm_downleftcorner
coords of the down left corner of the small cell
void set_contained_nodes(List< node > &list)
std::complex< double > * ME
Multipole Expansion terms.
void get_I(List< QuadTreeNodeNM *> &list) const
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
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...
QuadTreeNodeNM * child_lb_ptr
points to left bottom child
QuadTreeNodeNM * get_father_ptr() const
void set_father_ptr(QuadTreeNodeNM *f)
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
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 set_I(List< QuadTreeNodeNM *> &list)
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:169
void set_child_rt_ptr(QuadTreeNodeNM *c)
int Sm_level
level of the small cell
void set_D2(List< QuadTreeNodeNM *> &list)
void set_Sm_center(std::complex< double > c)
void get_contained_nodes(List< node > &list) const
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.
void set_M(List< QuadTreeNodeNM *> &list)
QuadTreeNodeNM * child_lt_ptr
points to left top child
List< QuadTreeNodeNM * > M
list of nodes with multipole force contribution like in DIM2
void get_M(List< QuadTreeNodeNM *> &list) const
friend std::istream & operator>>(std::istream &, QuadTreeNodeNM &)
Inputstream for QuadTreeNodeNM.
The namespace for all OGDF objects.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment, DPolygon, DRect, DIntersectableRect.
QuadTreeNodeNM * child_rb_ptr
points to right bottom child
std::complex< double > Sm_center
center of the small cell
std::complex< double > * get_local_exp() const
QuadTreeNodeNM * father_ptr
points to the father node
Declaration of doubly linked lists and iterators.
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()