Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
FMEFunc.h
Go to the documentation of this file.
1
32#pragma once
33
40
41#include <list>
42
43namespace ogdf {
44namespace fast_multipole_embedder {
45
46
49 std::list<LinearQuadtree::NodeID> nodes;
51
52 template<typename Func>
53 void for_loop(Func& func) {
54 for (LinearQuadtree::NodeID id : nodes) {
55 func(id);
56 }
57 }
58};
59
64
88
89
91struct FMELocalContext;
92
113
138
141 return min_max_functor<float>(pLocalContext->pGlobalContext->pGraph->nodeXPos(),
142 pLocalContext->min_x, pLocalContext->max_x);
143}
144
147 return min_max_functor<float>(pLocalContext->pGlobalContext->pGraph->nodeYPos(),
148 pLocalContext->min_y, pLocalContext->max_y);
149}
150
152public:
153 inline LQMortonFunctor(FMELocalContext* pLocalContext) {
154 x = pLocalContext->pGlobalContext->pGraph->nodeXPos();
155 y = pLocalContext->pGlobalContext->pGraph->nodeYPos();
156 s = pLocalContext->pGlobalContext->pGraph->nodeSize();
157 quadtree = pLocalContext->pGlobalContext->pQuadtree;
161 }
162
163 inline uint32_t operator()(void) const { return quadtree->numberOfPoints(); }
164
165 inline void operator()(uint32_t i) {
167 uint32_t ref = p.ref;
169 (uint32_t)((y[ref] + translate_y) * scale));
170 }
171
172 inline void operator()(uint32_t begin, uint32_t end) {
173 for (uint32_t i = begin; i <= end; i++) {
174 this->operator()(i);
175 }
176 }
177
178private:
182 double scale;
183 float* x;
184 float* y;
185 float* s;
186};
187
204
206static inline p2m_functor p2m_function(FMELocalContext* pLocalContext) {
207 return p2m_functor(*pLocalContext->pGlobalContext->pQuadtree,
208 *pLocalContext->pGlobalContext->pExpansion);
209}
210
226
228static inline m2m_functor m2m_function(FMELocalContext* pLocalContext) {
229 return m2m_functor(*pLocalContext->pGlobalContext->pQuadtree,
230 *pLocalContext->pGlobalContext->pExpansion);
231}
232
244
246static inline m2l_functor m2l_function(FMELocalContext* pLocalContext) {
247 return m2l_functor(*pLocalContext->pGlobalContext->pExpansion);
248}
249
265
267static inline l2l_functor l2l_function(FMELocalContext* pLocalContext) {
268 return l2l_functor(*pLocalContext->pGlobalContext->pQuadtree,
269 *pLocalContext->pGlobalContext->pExpansion);
270}
271
291
293static inline l2p_functor l2p_function(FMELocalContext* pLocalContext) {
294 return l2p_functor(*pLocalContext->pGlobalContext->pQuadtree,
295 *pLocalContext->pGlobalContext->pExpansion, pLocalContext->forceX, pLocalContext->forceY);
296}
297
324
326static inline p2p_functor p2p_function(FMELocalContext* pLocalContext) {
327 return p2p_functor(*pLocalContext->pGlobalContext->pQuadtree, pLocalContext->forceX,
328 pLocalContext->forceY);
329}
330
333public:
334 explicit LQPartitioner(FMELocalContext* pLocalContext)
336 , numThreads(pLocalContext->pGlobalContext->numThreads)
337 , currThread(0)
338 , tree(pLocalContext->pGlobalContext->pQuadtree)
339 , localContexts(pLocalContext->pGlobalContext->pLocalContext) { }
340
343 if (numInnerNodesPerThread < 25) {
346 for (uint32_t i = 1; i < numThreads; i++) {
348 }
349 } else {
351 currThread = 0;
354 for (uint32_t i = 0; i < tree->numberOfInnerNodes(); i++) {
357 if (currThread < numThreads - 1
358 && localContexts[currThread]->innerNodePartition.numNodes
360 currThread++;
363 }
364 }
365 }
366
368 if (numLeavesPerThread < 25) {
371 for (uint32_t i = 1; i < numThreads; i++) {
373 }
374 } else {
376 currThread = 0;
379 for (uint32_t i = 0; i < tree->numberOfLeaves(); i++) {
382 if (currThread < numThreads - 1
383 && localContexts[currThread]->leafPartition.numNodes >= numLeavesPerThread) {
384 currThread++;
387 }
388 }
389 }
390 }
391
392 void partition() {
394 currThread = 0;
396 for (uint32_t i = 0; i < numThreads; i++) {
399 }
400 if (numThreads > 1) {
401 newPartition();
402 }
403 }
404
405 void newPartition(uint32_t nodeID) {
407
408 if (tree->isLeaf(nodeID) || tree->numberOfPoints(nodeID) < bound) {
409 l_par.push_back(nodeID);
410 } else {
411 for (uint32_t i = 0; i < tree->numberOfChilds(nodeID); i++) {
412 newPartition(tree->child(nodeID, i));
413 }
414 }
415 }
416
418 l_par.clear();
421 + (tree->numberOfPoints() / (numThreads * numThreads * 2));
422 while (!l_par.empty()) {
424 uint32_t v = l_par.front();
425 if (((partition->pointCount + tree->numberOfPoints(v)) <= bound)
426 || (currThread == numThreads - 1)) {
427 partition->pointCount += tree->numberOfPoints(v);
428 partition->nodes.push_back(v);
429 tree->nodeFence(v);
430 l_par.pop_front();
431 } else {
432 currThread++;
433 }
434 }
435 }
436
438
439private:
443 std::list<uint32_t> l_par;
446};
447
449public:
450 inline explicit LQPointUpdateFunctor(FMELocalContext* pLocalContext) {
451 x = pLocalContext->pGlobalContext->pGraph->nodeXPos();
452 y = pLocalContext->pGlobalContext->pGraph->nodeYPos();
453 s = pLocalContext->pGlobalContext->pGraph->nodeSize();
454 quadtree = pLocalContext->pGlobalContext->pQuadtree;
455 }
456
457 inline uint32_t operator()(void) const { return quadtree->numberOfPoints(); }
458
459 inline void operator()(uint32_t i) {
461 uint32_t ref = p.ref;
462 quadtree->setPoint(i, x[ref], y[ref], s[ref]);
463 }
464
465 inline void operator()(uint32_t begin, uint32_t end) {
466 for (uint32_t i = begin; i <= end; i++) {
467 this->operator()(i);
468 }
469 }
470
471private:
473 float* x;
474 float* y;
475 float* s;
476};
477
482public:
483 inline explicit LQCoordsFunctor(FMELocalContext* pLocalContext) {
484 quadtree = pLocalContext->pGlobalContext->pQuadtree;
485 quadtreeExp = pLocalContext->pGlobalContext->pExpansion;
486 }
487
488 inline uint32_t operator()(void) const { return quadtree->numberOfNodes(); }
489
491
492 inline void operator()(uint32_t begin, uint32_t end) {
493 for (uint32_t i = begin; i <= end; i++) {
494 this->operator()(i);
495 }
496 }
497
498private:
501};
502
508public:
509 inline explicit M2LFunctor(FMELocalContext* pLocalContext) {
510 quadtree = pLocalContext->pGlobalContext->pQuadtree;
511 quadtreeExp = pLocalContext->pGlobalContext->pExpansion;
512 wspd = pLocalContext->pGlobalContext->pWSPD;
513 }
514
515 inline uint32_t operator()(void) const { return quadtree->numberOfNodes(); }
516
517 inline void operator()(uint32_t i) {
519 for (uint32_t k = 0; k < wspd->numWSNodes(i); k++) {
521 quadtreeExp->M2L(j, i);
523 }
524 }
525
526 inline void operator()(uint32_t begin, uint32_t end) {
527 for (uint32_t i = begin; i <= end; i++) {
528 this->operator()(i);
529 }
530 }
531
532private:
536};
537
542public:
543 inline explicit NDFunctor(FMELocalContext* pLocalContext) {
544 quadtree = pLocalContext->pGlobalContext->pQuadtree;
545 quadtreeExp = pLocalContext->pGlobalContext->pExpansion;
546 forceArrayX = pLocalContext->forceX;
547 forceArrayY = pLocalContext->forceY;
548 }
549
550 inline uint32_t operator()(void) const { return quadtree->numberOfDirectNodes(); }
551
552 inline void operator()(uint32_t i) {
556 eval_direct_fast(quadtree->pointX() + offset, quadtree->pointY() + offset,
557 quadtree->pointSize() + offset, forceArrayX + offset, forceArrayY + offset,
558 numPoints);
559 }
560
561 inline void operator()(uint32_t begin, uint32_t end) {
562 for (uint32_t i = begin; i <= end; i++) {
563 this->operator()(i);
564 }
565 }
566
567private:
572};
573
578public:
579 inline explicit D2DFunctor(FMELocalContext* pLocalContext) {
580 quadtree = pLocalContext->pGlobalContext->pQuadtree;
581 quadtreeExp = pLocalContext->pGlobalContext->pExpansion;
582 forceArrayX = pLocalContext->forceX;
583 forceArrayY = pLocalContext->forceY;
584 }
585
586 inline uint32_t operator()(void) const { return quadtree->numberOfDirectPairs(); }
587
601
602 inline void operator()(uint32_t begin, uint32_t end) {
603 for (uint32_t i = begin; i <= end; i++) {
604 this->operator()(i);
605 }
606 }
607
608private:
613};
614
615enum class FMEEdgeForce { SubRep = 0x2, DivDegree = 0x8 };
616
617inline int operator&(int lhs, FMEEdgeForce rhs) { return lhs & static_cast<int>(rhs); }
618
619template<unsigned int FLAGS>
621public:
622 inline explicit EdgeForceFunctor(FMELocalContext* pLocalContext) {
623 pGraph = pLocalContext->pGlobalContext->pGraph;
624 x = pGraph->nodeXPos();
625 y = pGraph->nodeYPos();
630 forceArrayX = pLocalContext->forceX;
631 forceArrayY = pLocalContext->forceY;
632 }
633
634 inline uint32_t operator()(void) const { return pGraph->numEdges(); }
635
636 inline void operator()(uint32_t i) {
637 const EdgeAdjInfo& e_info = edgeInfo[i];
638 const NodeAdjInfo& a_info = nodeInfo[e_info.a];
639 const NodeAdjInfo& b_info = nodeInfo[e_info.b];
640
641 float d_x = x[e_info.a] - x[e_info.b];
642 float d_y = y[e_info.a] - y[e_info.b];
643 float d_sq = d_x * d_x + d_y * d_y;
644
645 float f = (float)(logf(d_sq) * 0.5f - logf(desiredEdgeLength[i]));
646
647 float fa = f * 0.25f;
648 float fb = f * 0.25f;
649
651 fa = (float)(fa / ((float)a_info.degree));
652 fb = (float)(fb / ((float)b_info.degree));
653 }
654
656 fa += (nodeSize[e_info.b] / d_sq);
657 fb += (nodeSize[e_info.a] / d_sq);
658 }
659 forceArrayX[e_info.a] -= fa * d_x;
660 forceArrayY[e_info.a] -= fa * d_y;
661 forceArrayX[e_info.b] += fb * d_x;
662 forceArrayY[e_info.b] += fb * d_y;
663 }
664
665 inline void operator()(uint32_t begin, uint32_t end) {
666 for (uint32_t i = begin; i <= end; i++) {
667 this->operator()(i);
668 }
669 }
670
671private:
672 float* x;
673 float* y;
676
679 float* nodeSize;
682};
683
684template<unsigned int FLAGS>
686 return EdgeForceFunctor<FLAGS>(pLocalContext);
687}
688
689
690enum class FMECollect {
691 NoFactor = 0x00,
692 EdgeFactor = 0x01,
693 RepulsiveFactor = 0x02,
694 EdgeFactorRep = 0x04,
695 Tree2GraphOrder = 0x08,
696 ZeroThreadArray = 0x10
697};
698
699inline int operator&(int lhs, FMECollect rhs) { return lhs & static_cast<int>(rhs); }
700
701inline constexpr int operator|(int lhs, FMECollect rhs) { return lhs | static_cast<int>(rhs); }
702
703inline constexpr int operator|(FMECollect lhs, FMECollect rhs) {
704 return static_cast<int>(lhs) | static_cast<int>(rhs);
705}
706
707template<unsigned int FLAGS>
709public:
710 inline explicit CollectForceFunctor(FMELocalContext* pLocalContext) {
711 numContexts = pLocalContext->pGlobalContext->numThreads;
712 globalContext = pLocalContext->pGlobalContext;
716 pGraph = pLocalContext->pGlobalContext->pGraph;
719 } else if (FLAGS & FMECollect::RepulsiveFactor) {
720 factor = pLocalContext->pGlobalContext->pOptions->repForceFactor;
721 } else if (FLAGS & FMECollect::EdgeFactorRep) {
723 } else {
724 factor = 1.0;
725 }
726 }
727
728 inline uint32_t operator()(void) const { return pGraph->numNodes(); }
729
730 inline void operator()(uint32_t i) {
731 float sumX = 0.0f;
732 float sumY = 0.0f;
733 for (uint32_t j = 0; j < numContexts; j++) {
736 sumX += localArrayX[i];
737 sumY += localArrayY[i];
739 localArrayX[i] = 0.0f;
740 localArrayY[i] = 0.0f;
741 }
742 }
743
746 }
748 // prevent some evil effects
751 }
752 globalArrayX[i] += sumX * factor;
753 globalArrayY[i] += sumY * factor;
754 }
755
756 inline void operator()(uint32_t begin, uint32_t end) {
757 for (uint32_t i = begin; i <= end; i++) {
758 this->operator()(i);
759 }
760 }
761
762private:
769 float factor;
770};
771
772template<unsigned int FLAGS>
774 return CollectForceFunctor<FLAGS>(pLocalContext);
775}
776
777static constexpr int TIME_STEP_NORMAL = 0x1;
778static constexpr int TIME_STEP_PREP = 0x2;
779static constexpr int ZERO_GLOBAL_ARRAY = 0x4;
780static constexpr int USE_NODE_MOVE_RAD = 0x8;
781
782template<unsigned int FLAGS>
784public:
785#if 1
786 inline explicit NodeMoveFunctor(FMELocalContext* pLocalContext)
787#else
788 inline NodeMoveFunctor(FMELocalContext* pLocalContext, float* xCoords, float* yCoords,
789 float ftimeStep, float* globalForceArray)
790 : x(xCoords)
791 , y(yCoords)
794#endif
795 {
796 if (FLAGS & TIME_STEP_NORMAL) {
797 timeStep = pLocalContext->pGlobalContext->pOptions->timeStep
798 * pLocalContext->pGlobalContext->coolDown;
799 } else if (FLAGS & TIME_STEP_PREP) {
801 } else {
802 timeStep = 1.0;
803 }
804 pGraph = pLocalContext->pGlobalContext->pGraph;
805 x = pGraph->nodeXPos();
806 y = pGraph->nodeYPos();
808 forceArrayX = pLocalContext->pGlobalContext->globalForceX;
809 forceArrayY = pLocalContext->pGlobalContext->globalForceY;
810 localContext = pLocalContext;
812 }
813
814#if 0
815 inline void operator()(void) const
816 {
817 return pGraph->numNodes();
818 };
819#endif
820
821 inline void operator()(uint32_t i) {
822 float d_x = forceArrayX[i] * timeStep;
823 float d_y = forceArrayY[i] * timeStep;
824 double dsq = (d_x * d_x + d_y * d_y);
825 double d = sqrt(dsq);
826
829 if (d < FLT_MAX) {
830 x[i] += d_x;
831 y[i] += d_y;
832 if (FLAGS & ZERO_GLOBAL_ARRAY) {
833 forceArrayX[i] = 0.0;
834 forceArrayY[i] = 0.0;
835 } else {
836 forceArrayX[i] = d_x;
837 forceArrayY[i] = d_y;
838 }
839 } else {
840 forceArrayX[i] = 0.0;
841 forceArrayY[i] = 0.0;
842 }
843 }
844
845 inline void operator()(uint32_t begin, uint32_t end) {
846 for (uint32_t i = begin; i <= end; i++) {
847 this->operator()(i);
848 }
849 }
850
851private:
852 float timeStep;
853 float* x;
854 float* y;
861};
862
863template<unsigned int FLAGS>
865 return NodeMoveFunctor<FLAGS>(pLocalContext);
866}
867
868template<typename TYP>
869inline void for_loop_array_set(uint32_t threadNr, uint32_t numThreads, TYP* a, uint32_t n, TYP value) {
870 uint32_t s = n / numThreads;
871 uint32_t o = s * threadNr;
872 if (threadNr == numThreads - 1) {
873 s = s + (n % numThreads);
874 }
875
876 for (uint32_t i = 0; i < s; i++) {
877 a[o + i] = value;
878 }
879}
880
881}
882}
Declaration of class ArrayGraph.
Declaration of FME kernel.
Declaration of class LinearQuadtree.
Declaration of class LinearQuadtreeBuilder.
Declaration of class LinearQuadtreeExpansion.
Declaration of class WSPD (well-separated pair decomposition).
float * nodeMoveRadius()
Returns the node movement radius array for all nodes.
Definition ArrayGraph.h:180
float * nodeXPos()
Returns the x coord array for all nodes.
Definition ArrayGraph.h:162
uint32_t numEdges() const
Returns the number of edges.
Definition ArrayGraph.h:59
EdgeAdjInfo & edgeInfo(uint32_t i)
Returns the adjacency information for the edge at index i in m_edgeAdj.
Definition ArrayGraph.h:144
float * nodeYPos()
Returns the y coord array for all nodes.
Definition ArrayGraph.h:168
NodeAdjInfo & nodeInfo(uint32_t i)
Returns the adjacency information for the node at index i in m_nodeAdj.
Definition ArrayGraph.h:138
float * nodeSize()
Returns the node size array for all nodes.
Definition ArrayGraph.h:174
uint32_t numNodes() const
Returns the number of nodes.
Definition ArrayGraph.h:56
float * desiredEdgeLength()
Returns the edge length array for all edges.
Definition ArrayGraph.h:183
CollectForceFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:710
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:756
Calculates the repulsive forces acting between all nodes of the direct interacting cells of the i-th ...
Definition FMEFunc.h:577
D2DFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:579
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:602
LinearQuadtreeExpansion * quadtreeExp
Definition FMEFunc.h:610
Information about an edge (16 bytes).
Definition EdgeChain.h:52
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:665
EdgeForceFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:622
Computes the coords and size of the i-th node in the LinearQuadtree.
Definition FMEFunc.h:481
LQCoordsFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:483
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:492
LinearQuadtreeExpansion * quadtreeExp
Definition FMEFunc.h:500
LQMortonFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:153
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:172
The partitioner which partitions the quadtree into subtrees and partitions the sequence of inner node...
Definition FMEFunc.h:332
LQPartitioner(FMELocalContext *pLocalContext)
Definition FMEFunc.h:334
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:465
LQPointUpdateFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:450
void P2M(uint32_t point, uint32_t receiver)
adds a point with the given charge to the receiver expansion
void M2L(uint32_t source, uint32_t receiver)
converts the source multipole coefficient in to a local coefficients at the center of the receiver an...
void M2M(uint32_t source, uint32_t receiver)
shifts the source multipole coefficient to the center of the receiver and adds them
void L2P(uint32_t source, uint32_t point, float &fx, float &fy)
evaluates the derivate of the local expansion at the point and adds the forces to fx fy
void L2L(uint32_t source, uint32_t receiver)
shifts the source local coefficient to the center of the receiver and adds them
uint32_t numberOfChilds(NodeID nodeID) const
returns the number of children of node nodeID. for an inner node this is 1..4 and can be accessed by ...
forall_children_functor< F > forall_children(F f) const
creator
void setPoint(PointID id, float x, float y, uint32_t ref)
NodeID child(NodeID nodeID, uint32_t i) const
returns the i th child index of node nodeID
NodeID root() const
returns the index of the root
bool isLeaf(NodeID nodeID) const
returns true if the given node index is a leaf
uint32_t numberOfPoints(NodeID nodeID) const
returns the number of points contained in the subtree of node nodeID
uint32_t numberOfNodes() const
returns the number of nodes in this tree
Converts the multipole expansion coefficients from all nodes which are well separated from the i-th n...
Definition FMEFunc.h:507
M2LFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:509
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:526
LinearQuadtreeExpansion * quadtreeExp
Definition FMEFunc.h:534
Calculates the repulsive forces acting between all nodes inside the cell of the i-th LinearQuadtree n...
Definition FMEFunc.h:541
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:561
LinearQuadtreeExpansion * quadtreeExp
Definition FMEFunc.h:569
NDFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:543
Information about incident edges (16 bytes).
Definition EdgeChain.h:43
uint32_t degree
Total count of pairs where is either the first or second node.
Definition EdgeChain.h:45
void operator()(uint32_t begin, uint32_t end)
Definition FMEFunc.h:845
NodeMoveFunctor(FMELocalContext *pLocalContext)
Definition FMEFunc.h:786
Class for the Well-Separated-Pairs-Decomposition (WSPD)
Definition WSPD.h:41
uint32_t nextPair(uint32_t currPairIndex, NodeID a) const
Returns the index of the next pair of currPairIndex of the node with index a.
Definition WSPD.h:76
uint32_t firstPairEntry(NodeID nodeID) const
Returns the index of the first pair of node nodeID.
Definition WSPD.h:86
uint32_t numWSNodes(NodeID a) const
Returns the number of well separated nodes for node a.
Definition WSPD.h:55
uint32_t wsNodeOfPair(uint32_t currPairIndex, NodeID a) const
Returns the other node (not a) of the pair with index currPairIndex.
Definition WSPD.h:81
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
static m2l_functor m2l_function(FMELocalContext *pLocalContext)
creates Multipole-to-Local functor
Definition FMEFunc.h:246
static pair_call_functor< F, A > pair_call(F f, A a)
creates a pair call resulting in a call f(a, *)
static CollectForceFunctor< FLAGS > collect_force_function(FMELocalContext *pLocalContext)
Definition FMEFunc.h:773
static min_max_functor< float > min_max_x_function(FMELocalContext *pLocalContext)
creates a min max functor for the x coords of the node
Definition FMEFunc.h:140
static constexpr int USE_NODE_MOVE_RAD
Definition FMEFunc.h:780
static m2m_functor m2m_function(FMELocalContext *pLocalContext)
creates Multipole-to-Multipole functor
Definition FMEFunc.h:228
static NodeMoveFunctor< FLAGS > node_move_function(FMELocalContext *pLocalContext)
Definition FMEFunc.h:864
static p2p_functor p2p_function(FMELocalContext *pLocalContext)
creates Local-to-Point functor
Definition FMEFunc.h:326
static min_max_functor< float > min_max_y_function(FMELocalContext *pLocalContext)
creates a min max functor for the y coords of the node
Definition FMEFunc.h:146
int operator&(int lhs, FMEEdgeForce rhs)
Definition FMEFunc.h:617
void eval_direct_fast(float *x, float *y, float *s, float *fx, float *fy, size_t n)
kernel function to evaluate forces between n points with coords x, y directly. result is stored in fx...
Definition FMEKernel.h:158
static l2p_functor l2p_function(FMELocalContext *pLocalContext)
creates Local-to-Point functor
Definition FMEFunc.h:293
static l2l_functor l2l_function(FMELocalContext *pLocalContext)
creates Local-to-Local functor
Definition FMEFunc.h:267
static p2m_functor p2m_function(FMELocalContext *pLocalContext)
creates a Point-to-Multipole functor
Definition FMEFunc.h:206
static constexpr int ZERO_GLOBAL_ARRAY
Definition FMEFunc.h:779
static constexpr int TIME_STEP_NORMAL
Definition FMEFunc.h:777
static EdgeForceFunctor< FLAGS > edge_force_function(FMELocalContext *pLocalContext)
Definition FMEFunc.h:685
constexpr int operator|(int lhs, FMECollect rhs)
Definition FMEFunc.h:701
static constexpr int TIME_STEP_PREP
Definition FMEFunc.h:778
void for_loop_array_set(uint32_t threadNr, uint32_t numThreads, TYP *a, uint32_t n, TYP value)
Definition FMEFunc.h:869
The namespace for all OGDF objects.
uint32_t numThreads
number of threads, local contexts
Definition FMEFunc.h:96
bool earlyExit
var for the main thread to notify the other threads that they are done
Definition FMEFunc.h:104
FMELocalContext ** pLocalContext
all local contexts
Definition FMEFunc.h:95
float * globalForceX
the global node force x array
Definition FMEFunc.h:101
float max_y
global point, node max y coordinate for bounding box calculations
Definition FMEFunc.h:110
float min_y
global point, node min y coordinate for bounding box calculations
Definition FMEFunc.h:109
float max_x
global point, node max x coordinate for bounding box calculations
Definition FMEFunc.h:108
ArrayGraph * pGraph
pointer to the array graph
Definition FMEFunc.h:97
FMEGlobalOptions * pOptions
pointer to the global options
Definition FMEFunc.h:103
float * globalForceY
the global node force y array
Definition FMEFunc.h:102
LinearQuadtreeExpansion * pExpansion
pointer to the coeefficients
Definition FMEFunc.h:99
float min_x
global point, node min x coordinate for bounding box calculations
Definition FMEFunc.h:107
WSPD * pWSPD
pointer to the well separated pairs decomposition
Definition FMEFunc.h:100
LinearQuadtree * pQuadtree
pointer to the quadtree
Definition FMEFunc.h:98
the main global options for a run
Definition FMEFunc.h:66
float repForceFactor
repulsive force factor for the main step
Definition FMEFunc.h:73
float preProcTimeStep
time step factor for the preprocessing step
Definition FMEFunc.h:67
float normEdgeLength
average edge length when desired edge length are normalized
Definition FMEFunc.h:74
uint32_t minNumIterations
minimum number of iterations to be done regardless of any other conditions
Definition FMEFunc.h:77
float preProcEdgeForceFactor
edge force factor for the preprocessing step
Definition FMEFunc.h:68
bool doPrepProcessing
enable preprocessing
Definition FMEFunc.h:79
float timeStep
time step factor for the main step
Definition FMEFunc.h:71
uint32_t preProcMaxNumIterations
number of iterations the preprocessing is applied
Definition FMEFunc.h:69
bool doPostProcessing
enable postprocessing
Definition FMEFunc.h:80
float normNodeSize
average node size when node sizes are normalized
Definition FMEFunc.h:75
uint32_t maxNumIterations
maximum number of iterations in the main step
Definition FMEFunc.h:76
float edgeForceFactor
edge force factor for the main step
Definition FMEFunc.h:72
uint32_t numInnerNodes
number of inner nodes the thread prepared
Definition FMEFunc.h:132
LinearQuadtree::NodeID firstLeaf
first leaves the thread prepared
Definition FMEFunc.h:134
LinearQuadtree::NodeID lastLeaf
last leaves the thread prepared
Definition FMEFunc.h:135
float * forceY
local force array for all nodes, points
Definition FMEFunc.h:118
float * forceX
local force array for all nodes, points
Definition FMEFunc.h:117
FMETreePartition treePartition
tree partition assigned to the thread
Definition FMEFunc.h:126
float max_x
global point, node max x coordinate for bounding box calculations
Definition FMEFunc.h:122
float max_y
global point, node max y coordinate for bounding box calculations
Definition FMEFunc.h:124
FMENodeChainPartition innerNodePartition
chain of inner nodes assigned to the thread
Definition FMEFunc.h:127
FMENodeChainPartition leafPartition
chain of leaf nodes assigned to the thread
Definition FMEFunc.h:128
uint32_t numLeaves
number of leaves the thread prepared
Definition FMEFunc.h:136
FMEGlobalContext * pGlobalContext
pointer to the global context
Definition FMEFunc.h:116
LinearQuadtree::NodeID firstInnerNode
first inner nodes the thread prepared
Definition FMEFunc.h:130
float min_x
global point, node min x coordinate for bounding box calculations
Definition FMEFunc.h:121
LinearQuadtree::NodeID lastInnerNode
last inner nodes the thread prepared
Definition FMEFunc.h:131
float min_y
global point, node min y coordinate for bounding box calculations
Definition FMEFunc.h:123
struct for distributing subtrees to the threads
Definition FMEFunc.h:48
std::list< LinearQuadtree::NodeID > nodes
Definition FMEFunc.h:49
void operator()(LinearQuadtree::NodeID nodeIndex)
Definition FMEFunc.h:261
void operator()(LinearQuadtree::NodeID parent, LinearQuadtree::NodeID child)
Definition FMEFunc.h:257
LinearQuadtreeExpansion & expansions
Definition FMEFunc.h:253
l2l_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e)
Definition FMEFunc.h:255
l2p_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e, float *x, float *y)
Definition FMEFunc.h:279
void operator()(LinearQuadtree::NodeID nodeIndex, LinearQuadtree::PointID pointIndex)
Definition FMEFunc.h:282
void operator()(LinearQuadtree::PointID pointIndex)
Definition FMEFunc.h:286
LinearQuadtreeExpansion & expansions
Definition FMEFunc.h:275
Multipole-to-Local functor.
Definition FMEFunc.h:234
LinearQuadtreeExpansion & expansions
Definition FMEFunc.h:235
m2l_functor(LinearQuadtreeExpansion &e)
Definition FMEFunc.h:237
void operator()(LinearQuadtree::NodeID nodeIndexSource, LinearQuadtree::NodeID nodeIndexReceiver)
Definition FMEFunc.h:239
Multipole-to-Multipole functor.
Definition FMEFunc.h:212
LinearQuadtreeExpansion & expansions
Definition FMEFunc.h:214
m2m_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e)
Definition FMEFunc.h:216
void operator()(LinearQuadtree::NodeID nodeIndex)
Definition FMEFunc.h:222
void operator()(LinearQuadtree::NodeID parent, LinearQuadtree::NodeID child)
Definition FMEFunc.h:218
generic min max functor for an array
Point-to-Multipole functor.
Definition FMEFunc.h:189
p2m_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e)
Definition FMEFunc.h:193
void operator()(LinearQuadtree::NodeID nodeIndex)
Definition FMEFunc.h:195
LinearQuadtreeExpansion & expansions
Definition FMEFunc.h:191
void operator()(LinearQuadtree::NodeID nodeIndexA, LinearQuadtree::NodeID nodeIndexB)
Definition FMEFunc.h:306
p2p_functor(const LinearQuadtree &t, float *x, float *y)
Definition FMEFunc.h:304
void operator()(LinearQuadtree::NodeID nodeIndex)
Definition FMEFunc.h:317