Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

common.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/Graph.h>
36 #include <ogdf/basic/List.h>
37 #include <ogdf/basic/geometry.h>
40 
41 namespace ogdf {
42 namespace energybased {
43 namespace fmmm {
44 
46  const NodeArray<NodeAttributes>& A, const List<node>& contained_nodes) {
47  int length = contained_nodes.size();
48  Array<node> numbered_nodes(length + 1);
49  int i = 1;
50  for (node v : contained_nodes) {
51  numbered_nodes[i] = v;
52  ++i;
53  }
54 
55  for (i = 1; i < length; i++) {
56  for (int j = i + 1; j <= length; j++) {
57  node u = numbered_nodes[i];
58  node v = numbered_nodes[j];
59  DPoint f_rep_u_on_v = numexcept::f_rep_u_on_v(A[u].get_position(), A[v].get_position());
60  F_rep[v] += f_rep_u_on_v;
61  F_rep[u] -= f_rep_u_on_v;
62  }
63  }
64 }
65 
66 }
67 }
68 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::whaType::A
@ A
NodeAttributes.h
Declaration of class NodeAttributes.
ogdf::energybased::fmmm::calculate_forces_inside_contained_nodes
void calculate_forces_inside_contained_nodes(NodeArray< DPoint > &F_rep, const NodeArray< NodeAttributes > &A, const List< node > &contained_nodes)
Definition: common.h:45
ogdf::Array< node >
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
numexcept.h
Declaration of class numexcept (handling of numeric problems).
Array.h
Declaration and implementation of Array class and Array algorithms.
List.h
Declaration of doubly linked lists and iterators.
ogdf::List::size
int size() const
Returns the number of elements in the list.
Definition: List.h:1488
ogdf::energybased::fmmm::numexcept::f_rep_u_on_v
static DPoint f_rep_u_on_v(DPoint pos_u, DPoint pos_v)
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240