Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
39#include <complex>
40
41namespace ogdf {
42namespace energybased {
43namespace fmmm {
44
49 friend std::ostream& operator<<(std::ostream&, const QuadTreeNodeNM&);
50
52 friend std::istream& operator>>(std::istream&, QuadTreeNodeNM&);
53
54public:
57
58 void set_Sm_level(int level) { Sm_level = level; }
59
61
62 void set_Sm_boxlength(double len) { Sm_boxlength = len; }
63
65
67
69
70 void set_Sm_center(std::complex<double> c) { Sm_center = c; }
71
73
75
76 node pop_contained_nodes() { return contained_nodes.popFrontRet(); }
77
78 bool contained_nodes_empty() { return contained_nodes.empty(); }
79
80 void set_I(List<QuadTreeNodeNM*>& list) { I = list; }
81
82 void set_D1(List<QuadTreeNodeNM*>& list) { D1 = list; }
83
84 void set_D2(List<QuadTreeNodeNM*>& list) { D2 = list; }
85
86 void set_M(List<QuadTreeNodeNM*>& list) { M = list; }
87
89 void set_locale_exp(Array<std::complex<double>>& local, int precision) {
90 int i;
91 LE = new std::complex<double>[precision + 1];
92 for (i = 0; i <= precision; i++) {
93 LE[i] = local[i];
94 }
95 }
96
98 void set_multipole_exp(Array<std::complex<double>>& multi, int precision) {
99 int i;
100 ME = new std::complex<double>[precision + 1];
101 for (i = 0; i <= precision; i++) {
102 ME[i] = multi[i];
103 }
104 }
105
107 void replace_multipole_exp(Array<std::complex<double>>& multi, int precision) {
108 int i;
109 for (i = 0; i <= precision; i++) {
110 ME[i] = multi[i];
111 }
112 }
113
115
117
119
121
123
124 bool is_root() { return father_ptr == nullptr; }
125
126 bool is_leaf() {
127 return child_lt_ptr == nullptr && child_rt_ptr == nullptr && child_lb_ptr == nullptr
128 && child_rb_ptr == nullptr;
129 }
130
131 bool child_lt_exists() { return child_lt_ptr != nullptr; }
132
133 bool child_rt_exists() { return child_rt_ptr != nullptr; }
134
135 bool child_lb_exists() { return child_lb_ptr != nullptr; }
136
137 bool child_rb_exists() { return child_rb_ptr != nullptr; }
138
139 int get_Sm_level() const { return Sm_level; }
140
142
143 double get_Sm_boxlength() const { return Sm_boxlength; }
144
146
148
150
151 std::complex<double> get_Sm_center() const { return Sm_center; }
152
153 std::complex<double>* get_local_exp() const { return LE; }
154
155 std::complex<double>* get_multipole_exp() const { return ME; }
156
157 void get_contained_nodes(List<node>& list) const { list = contained_nodes; }
158
159 void get_I(List<QuadTreeNodeNM*>& list) const { list = I; }
160
161 void get_D1(List<QuadTreeNodeNM*>& list) const { list = D1; }
162
163 void get_D2(List<QuadTreeNodeNM*>& list) const { list = D2; }
164
165 void get_M(List<QuadTreeNodeNM*>& list) const { list = M; }
166
168
170
172
174
176
177private:
187 std::complex<double> Sm_center;
188 std::complex<double>* ME;
189 std::complex<double>* LE;
203};
204
205}
206}
207}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of class ParticleInfo.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Class for the representation of nodes.
Definition Graph_d.h:177
Helping data structure that stores the information needed to represent a node of the reduced quad tre...
QuadTreeNodeNM * child_lt_ptr
points to left top child
int subtreeparticlenumber
the number of particles in the subtree rooted at this node
QuadTreeNodeNM * get_child_lb_ptr() const
List< ParticleInfo > * L_y_ptr
and a cross reference to the list_item in the list with the other coordinate
std::complex< double > * get_local_exp() const
void get_I(List< QuadTreeNodeNM * > &list) const
QuadTreeNodeNM * get_child_rt_ptr() const
QuadTreeNodeNM * father_ptr
points to the father node
List< QuadTreeNodeNM * > I
the list of min.
List< QuadTreeNodeNM * > M
list of nodes with multipole force contribution like in DIM2
void set_M(List< QuadTreeNodeNM * > &list)
void get_M(List< QuadTreeNodeNM * > &list) const
QuadTreeNodeNM * child_lb_ptr
points to left bottom child
std::complex< double > * ME
Multipole Expansion terms.
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.
List< ParticleInfo > * L_x_ptr
points to the lists that contain each Particle of G with its x(y)coordinate in increasing order
List< ParticleInfo > * get_y_List_ptr()
std::complex< double > * LE
Locale Expansion terms.
void set_I(List< QuadTreeNodeNM * > &list)
void set_Sm_center(std::complex< double > c)
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 set_D1(List< QuadTreeNodeNM * > &list)
QuadTreeNodeNM * get_father_ptr() const
friend std::ostream & operator<<(std::ostream &, const QuadTreeNodeNM &)
Outputstream for QuadTreeNodeNM.
std::complex< double > * get_multipole_exp() const
friend std::istream & operator>>(std::istream &, QuadTreeNodeNM &)
Inputstream for QuadTreeNodeNM.
double Sm_boxlength
length of small cell
void get_D1(List< QuadTreeNodeNM * > &list) 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.
std::complex< double > get_Sm_center() const
DPoint Sm_downleftcorner
coords of the down left corner of the small cell
void set_x_List_ptr(List< ParticleInfo > *x_ptr)
QuadTreeNodeNM * get_child_lt_ptr() const
int Sm_level
level of the small cell
void set_D2(List< QuadTreeNodeNM * > &list)
void set_y_List_ptr(List< ParticleInfo > *y_ptr)
void get_contained_nodes(List< node > &list) const
QuadTreeNodeNM * child_rb_ptr
points to right bottom child
void set_contained_nodes(List< node > &list)
std::complex< double > Sm_center
center of the small cell
List< ParticleInfo > * get_x_List_ptr()
QuadTreeNodeNM * child_rt_ptr
points to right bottom child
void get_D2(List< QuadTreeNodeNM * > &list) const
QuadTreeNodeNM * get_child_rb_ptr() 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.
List< QuadTreeNodeNM * > D2
list of neighbouring(=D1) and not adjacent(=D2) leaves for direct force calculation in DIM2
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.