Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

common.h
Go to the documentation of this file.
1 
32 #pragma once
33 
36 
37 namespace ogdf {
38 namespace energybased {
39 namespace fmmm {
40 
42  const NodeArray<NodeAttributes>& A, const List<node>& contained_nodes) {
43  int length = contained_nodes.size();
44  Array<node> numbered_nodes(length + 1);
45  int i = 1;
46  for (node v : contained_nodes) {
47  numbered_nodes[i] = v;
48  ++i;
49  }
50 
51  for (i = 1; i < length; i++) {
52  for (int j = i + 1; j <= length; j++) {
53  node u = numbered_nodes[i];
54  node v = numbered_nodes[j];
55  DPoint f_rep_u_on_v = numexcept::f_rep_u_on_v(A[u].get_position(), A[v].get_position());
56  F_rep[v] += f_rep_u_on_v;
57  F_rep[u] -= f_rep_u_on_v;
58  }
59  }
60 }
61 
62 }
63 }
64 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GenericPoint< double >
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:41
ogdf::Array< node >
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
numexcept.h
Declaration of class numexcept (handling of numeric problems).
ogdf::List::size
int size() const
Returns the number of elements in the list.
Definition: List.h:1478
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:233