Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

QuadTreeNodeNM.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/Graph.h>
36 #include <ogdf/basic/List.h>
37 #include <ogdf/basic/geometry.h>
38 
39 #include <complex>
40 #include <iosfwd>
41 
42 namespace ogdf::energybased::fmmm {
43 class ParticleInfo;
44 } // namespace ogdf::energybased::fmmm
45 
46 namespace ogdf {
47 namespace energybased {
48 namespace fmmm {
49 
54  friend std::ostream& operator<<(std::ostream&, const QuadTreeNodeNM&);
55 
57  friend std::istream& operator>>(std::istream&, QuadTreeNodeNM&);
58 
59 public:
60  QuadTreeNodeNM();
61  ~QuadTreeNodeNM();
62 
63  void set_Sm_level(int level) { Sm_level = level; }
64 
66 
67  void set_Sm_boxlength(double len) { Sm_boxlength = len; }
68 
69  void set_x_List_ptr(List<ParticleInfo>* x_ptr) { L_x_ptr = x_ptr; }
70 
71  void set_y_List_ptr(List<ParticleInfo>* y_ptr) { L_y_ptr = y_ptr; }
72 
74 
75  void set_Sm_center(std::complex<double> c) { Sm_center = c; }
76 
78 
80 
81  node pop_contained_nodes() { return contained_nodes.popFrontRet(); }
82 
83  bool contained_nodes_empty() { return contained_nodes.empty(); }
84 
85  void set_I(List<QuadTreeNodeNM*>& list) { I = list; }
86 
87  void set_D1(List<QuadTreeNodeNM*>& list) { D1 = list; }
88 
89  void set_D2(List<QuadTreeNodeNM*>& list) { D2 = list; }
90 
91  void set_M(List<QuadTreeNodeNM*>& list) { M = list; }
92 
94  void set_locale_exp(Array<std::complex<double>>& local, int precision) {
95  int i;
96  LE = new std::complex<double>[precision + 1];
97  for (i = 0; i <= precision; i++) {
98  LE[i] = local[i];
99  }
100  }
101 
103  void set_multipole_exp(Array<std::complex<double>>& multi, int precision) {
104  int i;
105  ME = new std::complex<double>[precision + 1];
106  for (i = 0; i <= precision; i++) {
107  ME[i] = multi[i];
108  }
109  }
110 
112  void replace_multipole_exp(Array<std::complex<double>>& multi, int precision) {
113  int i;
114  for (i = 0; i <= precision; i++) {
115  ME[i] = multi[i];
116  }
117  }
118 
120 
122 
124 
126 
128 
129  bool is_root() { return father_ptr == nullptr; }
130 
131  bool is_leaf() {
132  return child_lt_ptr == nullptr && child_rt_ptr == nullptr && child_lb_ptr == nullptr
133  && child_rb_ptr == nullptr;
134  }
135 
136  bool child_lt_exists() { return child_lt_ptr != nullptr; }
137 
138  bool child_rt_exists() { return child_rt_ptr != nullptr; }
139 
140  bool child_lb_exists() { return child_lb_ptr != nullptr; }
141 
142  bool child_rb_exists() { return child_rb_ptr != nullptr; }
143 
144  int get_Sm_level() const { return Sm_level; }
145 
147 
148  double get_Sm_boxlength() const { return Sm_boxlength; }
149 
151 
153 
155 
156  std::complex<double> get_Sm_center() const { return Sm_center; }
157 
158  std::complex<double>* get_local_exp() const { return LE; }
159 
160  std::complex<double>* get_multipole_exp() const { return ME; }
161 
162  void get_contained_nodes(List<node>& list) const { list = contained_nodes; }
163 
164  void get_I(List<QuadTreeNodeNM*>& list) const { list = I; }
165 
166  void get_D1(List<QuadTreeNodeNM*>& list) const { list = D1; }
167 
168  void get_D2(List<QuadTreeNodeNM*>& list) const { list = D2; }
169 
170  void get_M(List<QuadTreeNodeNM*>& list) const { list = M; }
171 
173 
175 
177 
179 
181 
182 private:
183  int Sm_level;
185  double Sm_boxlength;
191  std::complex<double> Sm_center;
193  std::complex<double>* ME;
194  std::complex<double>* LE;
208 };
209 
210 }
211 }
212 }
ogdf::energybased::fmmm::QuadTreeNodeNM::Sm_center
std::complex< double > Sm_center
center of the small cell
Definition: QuadTreeNodeNM.h:192
ogdf::energybased::fmmm::QuadTreeNodeNM::get_multipole_exp
std::complex< double > * get_multipole_exp() const
Definition: QuadTreeNodeNM.h:160
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::energybased::fmmm::QuadTreeNodeNM::L_x_ptr
List< ParticleInfo > * L_x_ptr
points to the lists that contain each Particle of G with its x(y)coordinate in increasing order
Definition: QuadTreeNodeNM.h:186
ogdf::energybased::fmmm::QuadTreeNodeNM::replace_multipole_exp
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.
Definition: QuadTreeNodeNM.h:112
ogdf::energybased::fmmm::QuadTreeNodeNM::set_child_rb_ptr
void set_child_rb_ptr(QuadTreeNodeNM *c)
Definition: QuadTreeNodeNM.h:127
ogdf::energybased::fmmm::QuadTreeNodeNM::pushBack_contained_nodes
void pushBack_contained_nodes(node v)
Definition: QuadTreeNodeNM.h:79
ogdf::energybased::fmmm::QuadTreeNodeNM::set_Sm_level
void set_Sm_level(int level)
Definition: QuadTreeNodeNM.h:63
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
ogdf::energybased::fmmm::QuadTreeNodeNM::get_father_ptr
QuadTreeNodeNM * get_father_ptr() const
Definition: QuadTreeNodeNM.h:172
ogdf::energybased::fmmm::QuadTreeNodeNM::child_lt_exists
bool child_lt_exists()
Definition: QuadTreeNodeNM.h:136
ogdf::energybased::fmmm::QuadTreeNodeNM::set_Sm_downleftcorner
void set_Sm_downleftcorner(DPoint dlc)
Definition: QuadTreeNodeNM.h:65
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::energybased::fmmm
Definition: common.h:43
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_rt_ptr
QuadTreeNodeNM * get_child_rt_ptr() const
Definition: QuadTreeNodeNM.h:176
ogdf::energybased::fmmm::QuadTreeNodeNM::set_multipole_exp
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.
Definition: QuadTreeNodeNM.h:103
ogdf::energybased::fmmm::QuadTreeNodeNM::child_rb_ptr
QuadTreeNodeNM * child_rb_ptr
points to right bottom child
Definition: QuadTreeNodeNM.h:207
ogdf::energybased::fmmm::QuadTreeNodeNM::set_x_List_ptr
void set_x_List_ptr(List< ParticleInfo > *x_ptr)
Definition: QuadTreeNodeNM.h:69
ogdf::energybased::fmmm::QuadTreeNodeNM::ME
std::complex< double > * ME
Multipole Expansion terms.
Definition: QuadTreeNodeNM.h:193
ogdf::energybased::fmmm::QuadTreeNodeNM::get_contained_nodes
void get_contained_nodes(List< node > &list) const
Definition: QuadTreeNodeNM.h:162
ogdf::energybased::fmmm::QuadTreeNodeNM::get_Sm_level
int get_Sm_level() const
Definition: QuadTreeNodeNM.h:144
ogdf::energybased::fmmm::QuadTreeNodeNM::pop_contained_nodes
node pop_contained_nodes()
Definition: QuadTreeNodeNM.h:81
ogdf::energybased::fmmm::QuadTreeNodeNM::operator<<
friend std::ostream & operator<<(std::ostream &, const QuadTreeNodeNM &)
Outputstream for QuadTreeNodeNM.
ogdf::energybased::fmmm::QuadTreeNodeNM::QuadTreeNodeNM
QuadTreeNodeNM()
constructor
ogdf::energybased::fmmm::QuadTreeNodeNM::Sm_downleftcorner
DPoint Sm_downleftcorner
coords of the down left corner of the small cell
Definition: QuadTreeNodeNM.h:184
ogdf::energybased::fmmm::QuadTreeNodeNM::set_child_rt_ptr
void set_child_rt_ptr(QuadTreeNodeNM *c)
Definition: QuadTreeNodeNM.h:123
ogdf::energybased::fmmm::QuadTreeNodeNM::is_root
bool is_root()
Definition: QuadTreeNodeNM.h:129
ogdf::energybased::fmmm::QuadTreeNodeNM::LE
std::complex< double > * LE
Locale Expansion terms.
Definition: QuadTreeNodeNM.h:194
ogdf::energybased::fmmm::QuadTreeNodeNM::child_lb_exists
bool child_lb_exists()
Definition: QuadTreeNodeNM.h:140
ogdf::energybased::fmmm::QuadTreeNodeNM::Sm_level
int Sm_level
level of the small cell
Definition: QuadTreeNodeNM.h:183
ogdf::energybased::fmmm::QuadTreeNodeNM::set_Sm_boxlength
void set_Sm_boxlength(double len)
Definition: QuadTreeNodeNM.h:67
ogdf::energybased::fmmm::QuadTreeNodeNM::get_D2
void get_D2(List< QuadTreeNodeNM * > &list) const
Definition: QuadTreeNodeNM.h:168
ogdf::energybased::fmmm::QuadTreeNodeNM::get_Sm_center
std::complex< double > get_Sm_center() const
Definition: QuadTreeNodeNM.h:156
ogdf::energybased::fmmm::QuadTreeNodeNM::father_ptr
QuadTreeNodeNM * father_ptr
points to the father node
Definition: QuadTreeNodeNM.h:203
ogdf::energybased::fmmm::QuadTreeNodeNM::set_locale_exp
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.
Definition: QuadTreeNodeNM.h:94
ogdf::energybased::fmmm::QuadTreeNodeNM::D1
List< QuadTreeNodeNM * > D1
Definition: QuadTreeNodeNM.h:199
ogdf::energybased::fmmm::QuadTreeNodeNM::get_y_List_ptr
List< ParticleInfo > * get_y_List_ptr()
Definition: QuadTreeNodeNM.h:152
ogdf::energybased::fmmm::QuadTreeNodeNM::get_Sm_boxlength
double get_Sm_boxlength() const
Definition: QuadTreeNodeNM.h:148
ogdf::energybased::fmmm::QuadTreeNodeNM::contained_nodes_empty
bool contained_nodes_empty()
Definition: QuadTreeNodeNM.h:83
ogdf::energybased::fmmm::QuadTreeNodeNM::I
List< QuadTreeNodeNM * > I
the list of min.
Definition: QuadTreeNodeNM.h:198
ogdf::energybased::fmmm::QuadTreeNodeNM::set_contained_nodes
void set_contained_nodes(List< node > &list)
Definition: QuadTreeNodeNM.h:77
ogdf::energybased::fmmm::QuadTreeNodeNM::child_rb_exists
bool child_rb_exists()
Definition: QuadTreeNodeNM.h:142
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
ogdf::energybased::fmmm::QuadTreeNodeNM::M
List< QuadTreeNodeNM * > M
list of nodes with multipole force contribution like in DIM2
Definition: QuadTreeNodeNM.h:201
ogdf::energybased::fmmm::QuadTreeNodeNM::is_leaf
bool is_leaf()
Definition: QuadTreeNodeNM.h:131
ogdf::energybased::fmmm::QuadTreeNodeNM::Sm_boxlength
double Sm_boxlength
length of small cell
Definition: QuadTreeNodeNM.h:185
ogdf::energybased::fmmm::QuadTreeNodeNM::set_I
void set_I(List< QuadTreeNodeNM * > &list)
Definition: QuadTreeNodeNM.h:85
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::energybased::fmmm::QuadTreeNodeNM
Helping data structure that stores the information needed to represent a node of the reduced quad tre...
Definition: QuadTreeNodeNM.h:52
ogdf::energybased::fmmm::QuadTreeNodeNM::set_particlenumber_in_subtree
void set_particlenumber_in_subtree(int p)
Definition: QuadTreeNodeNM.h:73
ogdf::energybased::fmmm::QuadTreeNodeNM::set_child_lt_ptr
void set_child_lt_ptr(QuadTreeNodeNM *c)
Definition: QuadTreeNodeNM.h:121
ogdf::energybased::fmmm::QuadTreeNodeNM::get_local_exp
std::complex< double > * get_local_exp() const
Definition: QuadTreeNodeNM.h:158
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_lt_ptr
QuadTreeNodeNM * get_child_lt_ptr() const
Definition: QuadTreeNodeNM.h:174
ogdf::energybased::fmmm::QuadTreeNodeNM::contained_nodes
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...
Definition: QuadTreeNodeNM.h:195
ogdf::energybased::fmmm::QuadTreeNodeNM::~QuadTreeNodeNM
~QuadTreeNodeNM()
destructor
ogdf::energybased::fmmm::QuadTreeNodeNM::operator>>
friend std::istream & operator>>(std::istream &, QuadTreeNodeNM &)
Inputstream for QuadTreeNodeNM.
ogdf::energybased::fmmm::QuadTreeNodeNM::get_I
void get_I(List< QuadTreeNodeNM * > &list) const
Definition: QuadTreeNodeNM.h:164
ogdf::energybased::fmmm::QuadTreeNodeNM::subtreeparticlenumber
int subtreeparticlenumber
the number of particles in the subtree rooted at this node
Definition: QuadTreeNodeNM.h:190
ogdf::energybased::fmmm::QuadTreeNodeNM::child_rt_exists
bool child_rt_exists()
Definition: QuadTreeNodeNM.h:138
ogdf::energybased::fmmm::QuadTreeNodeNM::get_M
void get_M(List< QuadTreeNodeNM * > &list) const
Definition: QuadTreeNodeNM.h:170
ogdf::energybased::fmmm::QuadTreeNodeNM::get_x_List_ptr
List< ParticleInfo > * get_x_List_ptr()
Definition: QuadTreeNodeNM.h:150
ogdf::energybased::fmmm::QuadTreeNodeNM::D2
List< QuadTreeNodeNM * > D2
list of neighbouring(=D1) and not adjacent(=D2) leaves for direct force calculation in DIM2
Definition: QuadTreeNodeNM.h:199
ogdf::energybased::fmmm::QuadTreeNodeNM::set_Sm_center
void set_Sm_center(std::complex< double > c)
Definition: QuadTreeNodeNM.h:75
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_lb_ptr
QuadTreeNodeNM * get_child_lb_ptr() const
Definition: QuadTreeNodeNM.h:178
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::energybased::fmmm::QuadTreeNodeNM::get_D1
void get_D1(List< QuadTreeNodeNM * > &list) const
Definition: QuadTreeNodeNM.h:166
ogdf::energybased::fmmm::QuadTreeNodeNM::get_particlenumber_in_subtree
int get_particlenumber_in_subtree() const
Definition: QuadTreeNodeNM.h:154
ogdf::energybased::fmmm::QuadTreeNodeNM::child_rt_ptr
QuadTreeNodeNM * child_rt_ptr
points to right bottom child
Definition: QuadTreeNodeNM.h:205
ogdf::energybased::fmmm::QuadTreeNodeNM::child_lt_ptr
QuadTreeNodeNM * child_lt_ptr
points to left top child
Definition: QuadTreeNodeNM.h:204
List.h
Declaration of doubly linked lists and iterators.
ogdf::energybased::fmmm::QuadTreeNodeNM::set_D2
void set_D2(List< QuadTreeNodeNM * > &list)
Definition: QuadTreeNodeNM.h:89
ogdf::energybased::fmmm::QuadTreeNodeNM::child_lb_ptr
QuadTreeNodeNM * child_lb_ptr
points to left bottom child
Definition: QuadTreeNodeNM.h:206
ogdf::energybased::fmmm::QuadTreeNodeNM::set_y_List_ptr
void set_y_List_ptr(List< ParticleInfo > *y_ptr)
Definition: QuadTreeNodeNM.h:71
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::energybased::fmmm::QuadTreeNodeNM::get_Sm_downleftcorner
DPoint get_Sm_downleftcorner() const
Definition: QuadTreeNodeNM.h:146
ogdf::energybased::fmmm::QuadTreeNodeNM::L_y_ptr
List< ParticleInfo > * L_y_ptr
and a cross reference to the list_item in the list with the other coordinate
Definition: QuadTreeNodeNM.h:188
ogdf::energybased::fmmm::QuadTreeNodeNM::get_child_rb_ptr
QuadTreeNodeNM * get_child_rb_ptr() const
Definition: QuadTreeNodeNM.h:180
ogdf::energybased::fmmm::QuadTreeNodeNM::set_father_ptr
void set_father_ptr(QuadTreeNodeNM *f)
Definition: QuadTreeNodeNM.h:119
ogdf::energybased::fmmm::QuadTreeNodeNM::set_M
void set_M(List< QuadTreeNodeNM * > &list)
Definition: QuadTreeNodeNM.h:91
ogdf::energybased::fmmm::QuadTreeNodeNM::set_child_lb_ptr
void set_child_lb_ptr(QuadTreeNodeNM *c)
Definition: QuadTreeNodeNM.h:125
ogdf::energybased::fmmm::QuadTreeNodeNM::set_D1
void set_D1(List< QuadTreeNodeNM * > &list)
Definition: QuadTreeNodeNM.h:87