Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

FastUtils.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 #ifdef OGDF_SYSTEM_UNIX
37 # include <sys/time.h>
38 #endif
39 
40 #ifdef OGDF_FME_KERNEL_USE_SSE
42 #endif
43 
44 namespace ogdf {
45 namespace fast_multipole_embedder {
46 
47 // use SSE for Multipole computations
48 //#define OGDF_FME_KERNEL_USE_SSE
49 
50 // simple parallel quadtree sort
51 //#define OGDF_FME_PARALLEL_QUADTREE_SORT
52 
53 // use SSE for direct interaction (this is slower than the normal direct computation)
54 //#define OGDF_FME_KERNEL_USE_SSE_DIRECT
55 
56 inline void OGDF_FME_Print_Config() {
57 #ifdef OGDF_FME_KERNEL_USE_SSE
58  std::cout << "OGDF_FME_KERNEL_USE_SSE" << std::endl;
59 #endif
60 #ifdef OGDF_FME_PARALLEL_QUADTREE_SORT
61  std::cout << "OGDF_FME_PARALLEL_QUADTREE_SORT" << std::endl;
62 #endif
63 #ifdef OGDF_FME_KERNEL_USE_SSE_DIRECT
64  std::cout << "OGDF_FME_KERNEL_USE_SSE_DIRECT" << std::endl;
65 #endif
66 }
67 
68 using MortonNR = uint64_t;
69 using CoordInt = uint32_t;
70 
71 template<typename T>
72 inline bool is_align_16(T* ptr) {
73  return !(((size_t)(void*)ptr) & 0x0F);
74 }
75 
76 template<typename T>
77 inline T* align_16_prev_ptr(T* t) {
78  return (T*)(((size_t)((void*)t)) & ~0x0F);
79 }
80 
81 template<typename T>
82 inline T* align_16_next_ptr(T* t) {
83  return (T*)((((size_t)((void*)t)) + 15) & ~0x0F);
84 }
85 
86 #ifdef OGDF_SYSTEM_UNIX
87 inline timeval GetDiffTime(timeval _then, double& dtime) {
88  timeval then = (timeval)_then;
89  timeval now;
90  gettimeofday(&now, nullptr);
91  timeval diff;
92 
93  diff.tv_sec = now.tv_sec - then.tv_sec;
94  diff.tv_usec = now.tv_usec - then.tv_usec;
95  while (diff.tv_usec < 0) {
96  diff.tv_sec--;
97  diff.tv_usec = 1000000 + now.tv_usec - then.tv_usec;
98  }
99 
100  dtime = (double)diff.tv_sec;
101  dtime += (double)diff.tv_usec / 1e6;
102 
103  return (timeval)now;
104 }
105 #endif
106 
107 inline void printProfiledTime(double t, const char* text) {
108  std::cout << t << "s\t" << text << std::endl;
109 }
110 
111 inline void printProfiledTime(double t, double sum, const char* text) {
112  std::cout << t << "s\t" << text << "\t" << (t / sum) * 100.0 << "%" << std::endl;
113 }
114 
116 #define OGDF_MALLOC_16(s) System::alignedMemoryAlloc16((s))
117 
119 #define OGDF_FREE_16(ptr) System::alignedMemoryFree((ptr))
120 
122 template<typename MNR_T, typename C_T>
123 inline MNR_T mortonNumber(C_T ix, C_T iy) {
124  MNR_T x = (MNR_T)ix;
125  MNR_T y = (MNR_T)iy;
126  // bit length of the result
127  const unsigned int BIT_LENGTH = static_cast<unsigned int>(sizeof(MNR_T)) << 3;
128  // set all bits
129  MNR_T mask = 0x0;
130  mask = ~mask;
131 
132  for (unsigned int i = (BIT_LENGTH >> 1); i > 0; i = i >> 1) {
133  // increase frequency
134  mask = mask ^ (mask << i);
135  x = (x | (x << i)) & mask;
136  y = (y | (y << i)) & mask;
137  }
138  return x | (y << 1);
139 }
140 
142 template<typename MNR_T, typename C_T>
143 inline void mortonNumberInv(MNR_T mnr, C_T& x, C_T& y) {
144  // bit length of the coordinates
145  unsigned int BIT_LENGTH = static_cast<unsigned int>(sizeof(C_T)) << 3;
146  // set least significant bit
147  MNR_T mask = 0x1;
148  // set coords to zero
149  x = y = 0;
150  for (unsigned int i = 0; i < BIT_LENGTH; i++) {
151  x = (C_T)(x | (mnr & mask));
152  mnr = mnr >> 1;
153  y = (C_T)(y | (mnr & mask));
154  mask = mask << 1;
155  }
156 }
157 
159 template<typename T>
160 inline uint32_t mostSignificantBit(T n) {
161  uint32_t BIT_LENGTH = static_cast<uint32_t>(sizeof(T)) << 3;
162  T mask = 0x1;
163  mask = mask << (BIT_LENGTH - 1);
164  for (uint32_t i = 0; i < BIT_LENGTH; i++) {
165  if (mask & n) {
166  return i;
167  }
168  mask = mask >> 1;
169  }
170  return BIT_LENGTH;
171 }
172 
174 inline uint32_t prevPowerOfTwo(uint32_t n) {
175  uint32_t msb = 32 - mostSignificantBit(n);
176  return 0x1 << (msb - 1);
177 }
178 
181 public:
183  explicit RandomNodeSet(const Graph& G) : m_graph(G) { allocate(); }
184 
187 
189  node chooseNode() const {
190  int i = m_numNodesChoosen
191  + ogdf::randomNumber(0,
192  nodesLeft() - 1); //(int)((double)nodesLeft()*rand()/(RAND_MAX+1.0));
193  return m_array[i];
194  }
195 
197  void removeNode(node v) {
198  int i = m_nodeIndex[v];
199  int j = m_numNodesChoosen;
200  node w = m_array[j];
201  std::swap(m_array[i], m_array[j]);
202  m_nodeIndex[w] = i;
203  m_nodeIndex[v] = j;
205  }
206 
207  bool isAvailable(node v) const { return m_nodeIndex[v] >= m_numNodesChoosen; }
208 
210  int nodesLeft() const { return m_numNodes - m_numNodesChoosen; }
211 
212 private:
213  void allocate() {
215  m_nodeIndex.init(m_graph);
217  m_numNodesChoosen = 0;
218  int i = 0;
219  for (node v : m_graph.nodes) {
220  m_array[i] = v;
221  m_nodeIndex[v] = i;
222  i++;
223  }
224  }
225 
226  void deallocate() { delete[] m_array; }
227 
229  const Graph& m_graph;
230 
233 
236 
239 
242 };
243 
244 inline void gridGraph(Graph& G, int n, int m) {
245  G.clear();
246  node v;
247  node* topRow = new node[m];
248  topRow[0] = G.newNode();
249  for (int j = 1; j < m; j++) {
250  topRow[j] = G.newNode();
251  G.newEdge(topRow[j - 1], topRow[j]);
252  }
253  for (int i = 1; i < n; i++) {
254  v = G.newNode();
255  G.newEdge(topRow[0], v);
256  topRow[0] = v;
257  for (int j = 1; j < m; j++) {
258  v = G.newNode();
259  G.newEdge(topRow[j - 1], v);
260  G.newEdge(topRow[j], v);
261  topRow[j] = v;
262  }
263  }
264  delete[] topRow;
265 }
266 
267 inline void randomGridGraph(Graph& G, int n, int m, double missinNodesPercentage = 0.03) {
268  gridGraph(G, n, m);
269  int numberOfNodesToDelete = (int)((double)G.numberOfNodes() * missinNodesPercentage);
270 
271  RandomNodeSet rndSet(G);
272  for (int i = 0; i < numberOfNodesToDelete; i++) {
273  node v = rndSet.chooseNode();
274  rndSet.removeNode(v);
275  G.delNode(v);
276  }
277 }
278 
280 template<class TYP>
281 class BinCoeff {
282 public:
283  explicit BinCoeff(unsigned int n) : m_max_n(n) { init_array(); }
284 
286 
288  void init_array() {
289  using ptr = TYP*;
290  unsigned int i, j;
291  m_binCoeffs = new ptr[m_max_n + 1];
292  for (i = 0; i <= m_max_n; i++) {
293  m_binCoeffs[i] = new TYP[i + 1];
294  }
295 
296  //Pascalsches Dreieck
297  for (i = 0; i <= m_max_n; i++) {
298  m_binCoeffs[i][0] = m_binCoeffs[i][i] = 1;
299  }
300 
301  for (i = 2; i <= m_max_n; i++) {
302  for (j = 1; j < i; j++) {
303  m_binCoeffs[i][j] = m_binCoeffs[i - 1][j - 1] + m_binCoeffs[i - 1][j];
304  }
305  }
306  }
307 
309  void free_array() {
310  unsigned int i;
311  for (i = 0; i <= m_max_n; i++) {
312  delete[] m_binCoeffs[i];
313  }
314  delete[] m_binCoeffs;
315  }
316 
317  //Returns n over k.
318  inline TYP value(unsigned int n, unsigned int k) const { return m_binCoeffs[n][k]; }
319 
320 private:
321  unsigned int m_max_n;
322 
324  TYP** m_binCoeffs;
325 };
326 
327 // nothing
328 struct EmptyArgType { };
329 
330 //
331 // Function Invoker for 8 args
332 //
333 template<typename FunctionType, typename ArgType1 = EmptyArgType, typename ArgType2 = EmptyArgType,
334  typename ArgType3 = EmptyArgType, typename ArgType4 = EmptyArgType,
335  typename ArgType5 = EmptyArgType, typename ArgType6 = EmptyArgType,
336  typename ArgType7 = EmptyArgType, typename ArgType8 = EmptyArgType>
337 struct FuncInvoker {
338  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
339  ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7, ArgType8 _arg8)
340  : function(f)
341  , arg1(_arg1)
342  , arg2(_arg2)
343  , arg3(_arg3)
344  , arg4(_arg4)
345  , arg5(_arg5)
346  , arg6(_arg6)
347  , arg7(_arg7)
348  , arg8(_arg8) { }
349 
350  inline void operator()() { function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); }
351 
352  FunctionType function;
353  ArgType1 arg1;
354  ArgType2 arg2;
355  ArgType3 arg3;
356  ArgType4 arg4;
357  ArgType5 arg5;
358  ArgType6 arg6;
359  ArgType7 arg7;
360  ArgType8 arg8;
361 };
362 
363 //
364 // Function Invoker for 7 args
365 //
366 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
367  typename ArgType4, typename ArgType5, typename ArgType6, typename ArgType7>
368 struct FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6,
369  ArgType7, EmptyArgType> {
370  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
371  ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7)
372  : function(f)
373  , arg1(_arg1)
374  , arg2(_arg2)
375  , arg3(_arg3)
376  , arg4(_arg4)
377  , arg5(_arg5)
378  , arg6(_arg6)
379  , arg7(_arg7) { }
380 
381  inline void operator()() { function(arg1, arg2, arg3, arg4, arg5, arg6, arg7); }
382 
383  FunctionType function;
384  ArgType1 arg1;
385  ArgType2 arg2;
386  ArgType3 arg3;
387  ArgType4 arg4;
388  ArgType5 arg5;
389  ArgType6 arg6;
390  ArgType7 arg7;
391 };
392 
393 //
394 // Function Invoker for 6 args
395 //
396 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
397  typename ArgType4, typename ArgType5, typename ArgType6>
398 struct FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6,
400  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
401  ArgType5 _arg5, ArgType6 _arg6)
402  : function(f), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5), arg6(_arg6) { }
403 
404  inline void operator()() { function(arg1, arg2, arg3, arg4, arg5, arg6); }
405 
406  FunctionType function;
407  ArgType1 arg1;
408  ArgType2 arg2;
409  ArgType3 arg3;
410  ArgType4 arg4;
411  ArgType5 arg5;
412  ArgType6 arg6;
413 };
414 
415 //
416 // Function Invoker for 5 args
417 //
418 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
419  typename ArgType4, typename ArgType5>
420 struct FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType,
422  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
423  ArgType5 _arg5)
424  : function(f), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) { }
425 
426  inline void operator()() { function(arg1, arg2, arg3, arg4, arg5); }
427 
428  FunctionType function;
429  ArgType1 arg1;
430  ArgType2 arg2;
431  ArgType3 arg3;
432  ArgType4 arg4;
433  ArgType5 arg5;
434 };
435 
436 //
437 // Function Invoker for 4 args
438 //
439 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3, typename ArgType4>
440 struct FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType,
442  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4)
443  : function(f), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) { }
444 
445  inline void operator()() { function(arg1, arg2, arg3, arg4); }
446 
447  FunctionType function;
448  ArgType1 arg1;
449  ArgType2 arg2;
450  ArgType3 arg3;
451  ArgType4 arg4;
452 };
453 
454 //
455 // Function Invoker for 3 args
456 //
457 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3>
458 struct FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, EmptyArgType, EmptyArgType,
460  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3)
461  : function(f), arg1(_arg1), arg2(_arg2), arg3(_arg3) { }
462 
463  inline void operator()() { function(arg1, arg2, arg3); }
464 
465  FunctionType function;
466  ArgType1 arg1;
467  ArgType2 arg2;
468  ArgType3 arg3;
469 };
470 
471 //
472 // Function Invoker for 2 args
473 //
474 template<typename FunctionType, typename ArgType1, typename ArgType2>
475 struct FuncInvoker<FunctionType, ArgType1, ArgType2, EmptyArgType, EmptyArgType, EmptyArgType,
477  FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2)
478  : function(f), arg1(_arg1), arg2(_arg2) { }
479 
480  inline void operator()() { function(arg1, arg2); }
481 
482  FunctionType function;
483  ArgType1 arg1;
484  ArgType2 arg2;
485 };
486 
487 //
488 // Function Invoker for 1 args
489 //
490 template<typename FunctionType, typename ArgType1>
493  FuncInvoker(FunctionType f, ArgType1 _arg1) : function(f), arg1(_arg1) { }
494 
495  inline void operator()() { function(arg1); }
496 
497  FunctionType function;
498  ArgType1 arg1;
499 };
500 
501 //
502 // Function Invoker for 0 args
503 //
504 template<typename FunctionType>
507  FuncInvoker(FunctionType f) : function(f) { }
508 
509  inline void operator()() { function(); }
510 
511  FunctionType function;
512 };
513 
514 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
515  typename ArgType4, typename ArgType5, typename ArgType6, typename ArgType7, typename ArgType8>
517 createFuncInvoker(FunctionType func, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
518  ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7, ArgType8 _arg8) {
519  return FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6,
520  ArgType7, ArgType8>(func, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
521 }
522 
523 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
524  typename ArgType4, typename ArgType5, typename ArgType6, typename ArgType7, typename ArgType8>
525 FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, ArgType8>
526 createFuncInvoker(FunctionType func, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
527  ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7) {
528  return FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6,
529  ArgType7, EmptyArgType>(func, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
530 }
531 
532 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
533  typename ArgType4, typename ArgType5, typename ArgType6>
534 FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6>
535 createFuncInvoker(FunctionType func, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
536  ArgType5 _arg5, ArgType6 _arg6) {
538  func, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
539 }
540 
541 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3,
542  typename ArgType4, typename ArgType5>
544  FunctionType func, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4,
545  ArgType5 _arg5) {
547  _arg2, _arg3, _arg4, _arg5);
548 }
549 
550 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3, typename ArgType4>
552  FunctionType func, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4) {
554  _arg3, _arg4);
555 }
556 
557 template<typename FunctionType, typename ArgType1, typename ArgType2, typename ArgType3>
559  ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3) {
560  return FuncInvoker<FunctionType, ArgType1, ArgType2, ArgType3>(func, _arg1, _arg2, _arg3);
561 }
562 
563 template<typename FunctionType, typename ArgType1, typename ArgType2>
565  ArgType2 _arg2) {
566  return FuncInvoker<FunctionType, ArgType1, ArgType2>(func, _arg1, _arg2);
567 }
568 
569 template<typename FunctionType, typename ArgType1>
570 FuncInvoker<FunctionType, ArgType1> createFuncInvoker(FunctionType func, ArgType1 _arg1) {
571  return FuncInvoker<FunctionType, ArgType1>(func, _arg1);
572 }
573 
574 template<typename FunctionType>
576  return FuncInvoker<FunctionType>(func);
577 }
578 
579 }
580 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::fast_multipole_embedder::RandomNodeSet::isAvailable
bool isAvailable(node v) const
Definition: FastUtils.h:207
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4)
Definition: FastUtils.h:442
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:480
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::arg5
ArgType5 arg5
Definition: FastUtils.h:411
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg2
ArgType2 arg2
Definition: FastUtils.h:449
ogdf::fast_multipole_embedder::gridGraph
void gridGraph(Graph &G, int n, int m)
Definition: FastUtils.h:244
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:429
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:445
ogdf::fast_multipole_embedder::RandomNodeSet::nodesLeft
int nodesLeft() const
number of nodes available
Definition: FastUtils.h:210
ogdf::fast_multipole_embedder::BinCoeff::BinCoeff
BinCoeff(unsigned int n)
Definition: FastUtils.h:283
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::arg3
ArgType3 arg3
Definition: FastUtils.h:409
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::arg2
ArgType2 arg2
Definition: FastUtils.h:430
ogdf::fast_multipole_embedder::RandomNodeSet::removeNode
void removeNode(node v)
removes a node from available nodes (assumes v is available) in O(1)
Definition: FastUtils.h:197
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg2
ArgType2 arg2
Definition: FastUtils.h:484
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:498
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3)
Definition: FastUtils.h:460
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:448
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4, ArgType5 _arg5, ArgType6 _arg6)
Definition: FastUtils.h:400
ogdf::fast_multipole_embedder::RandomNodeSet::allocate
void allocate()
Definition: FastUtils.h:213
ogdf::fast_multipole_embedder::FuncInvoker
Definition: FastUtils.h:337
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2)
Definition: FastUtils.h:477
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:426
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:384
ogdf::fast_multipole_embedder::printProfiledTime
void printProfiledTime(double t, const char *text)
Definition: FastUtils.h:107
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::arg2
ArgType2 arg2
Definition: FastUtils.h:408
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::arg6
ArgType6 arg6
Definition: FastUtils.h:412
ogdf::fast_multipole_embedder::FuncInvoker::arg3
ArgType3 arg3
Definition: FastUtils.h:355
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg6
ArgType6 arg6
Definition: FastUtils.h:389
ogdf::fast_multipole_embedder::FuncInvoker::arg1
ArgType1 arg1
Definition: FastUtils.h:353
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f)
Definition: FastUtils.h:507
ogdf::fast_multipole_embedder::FuncInvoker::arg8
ArgType8 arg8
Definition: FastUtils.h:360
ogdf::fast_multipole_embedder::CoordInt
uint32_t CoordInt
Definition: FastUtils.h:69
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4, ArgType5 _arg5)
Definition: FastUtils.h:422
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:404
ogdf::fast_multipole_embedder::RandomNodeSet::m_nodeIndex
NodeArray< int > m_nodeIndex
the index in the array of the nodes
Definition: FastUtils.h:235
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg2
ArgType2 arg2
Definition: FastUtils.h:385
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4, ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7)
Definition: FastUtils.h:370
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:381
ogdf::Graph::nodes
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Definition: Graph_d.h:924
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:407
ogdf::fast_multipole_embedder::RandomNodeSet::m_graph
const Graph & m_graph
the graph
Definition: FastUtils.h:229
ogdf::fast_multipole_embedder::prevPowerOfTwo
uint32_t prevPowerOfTwo(uint32_t n)
returns the prev power of two
Definition: FastUtils.h:174
ogdf::fast_multipole_embedder::MortonNR
uint64_t MortonNR
Definition: FastUtils.h:68
ogdf::fast_multipole_embedder::RandomNodeSet::m_array
node * m_array
the set of all nodes (at the end the available nodes)
Definition: FastUtils.h:232
ogdf::Graph::numberOfNodes
int numberOfNodes() const
Returns the number of nodes in the graph.
Definition: Graph_d.h:974
ogdf::fast_multipole_embedder::RandomNodeSet::~RandomNodeSet
~RandomNodeSet()
destructor
Definition: FastUtils.h:186
ogdf::fast_multipole_embedder::OGDF_FME_Print_Config
void OGDF_FME_Print_Config()
Definition: FastUtils.h:56
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::arg3
ArgType3 arg3
Definition: FastUtils.h:431
ogdf::fast_multipole_embedder::mortonNumber
MNR_T mortonNumber(C_T ix, C_T iy)
common template for bit-interleaving to compute the morton number assumes sizeOf(MNR_T) = 2*sizeOf(C_...
Definition: FastUtils.h:123
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:463
ogdf::fast_multipole_embedder::FuncInvoker::arg6
ArgType6 arg6
Definition: FastUtils.h:358
ogdf::fast_multipole_embedder::BinCoeff::~BinCoeff
~BinCoeff()
Definition: FastUtils.h:285
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::fast_multipole_embedder::RandomNodeSet::m_numNodes
int m_numNodes
total num nodes
Definition: FastUtils.h:238
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::fast_multipole_embedder::createFuncInvoker
FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, ArgType8 > createFuncInvoker(FunctionType func, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4, ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7, ArgType8 _arg8)
Definition: FastUtils.h:517
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:466
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1)
Definition: FastUtils.h:493
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::arg5
ArgType5 arg5
Definition: FastUtils.h:433
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg4
ArgType4 arg4
Definition: FastUtils.h:451
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg5
ArgType5 arg5
Definition: FastUtils.h:388
ogdf::fast_multipole_embedder::mostSignificantBit
uint32_t mostSignificantBit(T n)
returns the index of the most signficant bit set. 0 = most signif, bitlength-1 = least signif
Definition: FastUtils.h:160
ogdf::fast_multipole_embedder::FuncInvoker::FuncInvoker
FuncInvoker(FunctionType f, ArgType1 _arg1, ArgType2 _arg2, ArgType3 _arg3, ArgType4 _arg4, ArgType5 _arg5, ArgType6 _arg6, ArgType7 _arg7, ArgType8 _arg8)
Definition: FastUtils.h:338
ogdf::fast_multipole_embedder::RandomNodeSet::deallocate
void deallocate()
Definition: FastUtils.h:226
ogdf::fast_multipole_embedder::BinCoeff::free_array
void free_array()
Free space for BK.
Definition: FastUtils.h:309
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg1
ArgType1 arg1
Definition: FastUtils.h:483
ogdf::fast_multipole_embedder::RandomNodeSet::RandomNodeSet
RandomNodeSet(const Graph &G)
init the random node set with the given graph. takes O(n)
Definition: FastUtils.h:183
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:509
ogdf::fast_multipole_embedder::FuncInvoker::arg2
ArgType2 arg2
Definition: FastUtils.h:354
ogdf::fast_multipole_embedder::is_align_16
bool is_align_16(T *ptr)
Definition: FastUtils.h:72
ogdf::fast_multipole_embedder::RandomNodeSet::chooseNode
node chooseNode() const
chooses a node from the available nodes in O(1)
Definition: FastUtils.h:189
ogdf::fast_multipole_embedder::FuncInvoker::arg7
ArgType7 arg7
Definition: FastUtils.h:359
ogdf::fast_multipole_embedder::EmptyArgType
Definition: FastUtils.h:328
ogdf::fast_multipole_embedder::BinCoeff::m_binCoeffs
TYP ** m_binCoeffs
holds the binominal coefficients
Definition: FastUtils.h:324
ogdf::fast_multipole_embedder::FuncInvoker::function
FunctionType function
Definition: FastUtils.h:352
ogdf::fast_multipole_embedder::BinCoeff::init_array
void init_array()
Init BK -matrix for values n, k in 0 to t.
Definition: FastUtils.h:288
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg3
ArgType3 arg3
Definition: FastUtils.h:468
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg2
ArgType2 arg2
Definition: FastUtils.h:467
ogdf::fast_multipole_embedder::align_16_prev_ptr
T * align_16_prev_ptr(T *t)
Definition: FastUtils.h:77
ogdf::fast_multipole_embedder::BinCoeff
binomial coeffs from Hachuls FMMM
Definition: FastUtils.h:281
intrinsics.h
Include of header files for SSE-intrinsics.
ogdf::fast_multipole_embedder::RandomNodeSet::m_numNodesChoosen
int m_numNodesChoosen
num available nodes
Definition: FastUtils.h:241
ogdf::fast_multipole_embedder::FuncInvoker::operator()
void operator()()
Definition: FastUtils.h:350
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg3
ArgType3 arg3
Definition: FastUtils.h:386
ogdf::fast_multipole_embedder::mortonNumberInv
void mortonNumberInv(MNR_T mnr, C_T &x, C_T &y)
common template for extracting the coordinates from a morton number assumes sizeOf(MNR_T) = 2*sizeOf(...
Definition: FastUtils.h:143
ogdf::fast_multipole_embedder::align_16_next_ptr
T * align_16_next_ptr(T *t)
Definition: FastUtils.h:82
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, EmptyArgType, EmptyArgType >::arg4
ArgType4 arg4
Definition: FastUtils.h:410
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::operator()
void operator()()
Definition: FastUtils.h:495
ogdf::randomNumber
int randomNumber(int low, int high)
Returns random integer between low and high (including).
ogdf::fast_multipole_embedder::randomGridGraph
void randomGridGraph(Graph &G, int n, int m, double missinNodesPercentage=0.03)
Definition: FastUtils.h:267
ogdf::fast_multipole_embedder::BinCoeff::value
TYP value(unsigned int n, unsigned int k) const
Definition: FastUtils.h:318
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg4
ArgType4 arg4
Definition: FastUtils.h:387
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, ArgType6, ArgType7, EmptyArgType >::arg7
ArgType7 arg7
Definition: FastUtils.h:390
ogdf::fast_multipole_embedder::BinCoeff::m_max_n
unsigned int m_max_n
Definition: FastUtils.h:321
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::fast_multipole_embedder::FuncInvoker::arg5
ArgType5 arg5
Definition: FastUtils.h:357
ogdf::fast_multipole_embedder::FuncInvoker::arg4
ArgType4 arg4
Definition: FastUtils.h:356
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, EmptyArgType, EmptyArgType, EmptyArgType, EmptyArgType >::arg3
ArgType3 arg3
Definition: FastUtils.h:450
ogdf::fast_multipole_embedder::FuncInvoker< FunctionType, ArgType1, ArgType2, ArgType3, ArgType4, ArgType5, EmptyArgType, EmptyArgType, EmptyArgType >::arg4
ArgType4 arg4
Definition: FastUtils.h:432
ogdf::fast_multipole_embedder::RandomNodeSet
utility class to select multiple nodes randomly
Definition: FastUtils.h:180