Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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