Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::energybased::dtree::DTreeEmbedder< Dim > Class Template Reference

#include <ogdf/energybased/dtree/DTreeEmbedder.h>

Classes

struct  NodeInfo
 node state More...
 

Public Member Functions

 DTreeEmbedder (const Graph &graph)
 constructor with a given graph, allocates memory and does initialization
 
virtual ~DTreeEmbedder ()
 destructor
 
void centerNodesAt (double centerBBox[Dim])
 computes the bounding box and all nodes are translated such that bbox center is at centerBBox
 
template<typename AttrForceFunc , bool UseForcePrime>
void computeEdgeForces (AttrForceFunc attrForceFunc)
 computes the edge forces for one iteration
 
template<typename ForceFunc , bool UseForcePrime>
void computeRepForces (ForceFunc forceFunc)
 computes the repulsive forces
 
template<typename ForceFunc , bool UseForcePrime>
void computeRepForcesApprox (ForceFunc forceFunc)
 uses the tree code to approximate the repulsive forces in O(nlogn) for one iteration
 
template<typename ForceFunc , bool UseForcePrime>
void computeRepForcesExact (ForceFunc forceFunc)
 computes the repulsive forces for one iteration in O(n^2)
 
template<typename RepForceFunc , typename AttrForceFunc >
void doIterationsNewton (int numIterations, double epsilon, RepForceFunc repForceFunc, AttrForceFunc attrForceFunc)
 
template<typename RepForceFunc , typename AttrForceFunc >
void doIterationsStandard (int numIterations, double epsilon, RepForceFunc repForceFunc, AttrForceFunc attrForceFunc)
 
template<typename RepForceFunc , typename AttrForceFunc , bool UseForcePrime>
void doIterationsTempl (int numIterations, double epsilon, RepForceFunc repForceFunc, AttrForceFunc attrForceFunc)
 does multiple iterations using the given repulsive force function
 
double edgeWeight (edge e) const
 returns the edge weight
 
const Graphgraph () const
 returns the graph
 
double mass (node v) const
 returns the mass of node v
 
double moveNodes (double timeStep)
 moves the nodes by the computed force vector
 
double moveNodesByForcePrime ()
 
double position (node v, int d) const
 returns the d-th coordinate of node v
 
void resetForces ()
 sets the forces of all nodes to 0
 
void scaleNodes (double scaleFactor)
 changes the position of nodes according to a given scale factor
 
void setEdgeWeight (edge e, double weight)
 sets the weight of an edge
 
void setMass (node v, double mass)
 sets the mass of a node v
 
void setPosition (node v, int d, double coord)
 sets the d-th coordinate of node v to coord
 

Private Attributes

double m_defaultTimeStep
 
EdgeArray< doublem_edgeWeight
 the weight of the edges
 
const Graphm_graph
 the graph
 
int m_maxNumNodesExactRepForces
 
NodeArray< NodeInfom_nodeInfo
 node states of all nodes
 
DTreeForce< Dim > * m_pTreeForce
 the tree force approx
 

Detailed Description

template<int Dim>
class ogdf::energybased::dtree::DTreeEmbedder< Dim >

Definition at line 39 of file DTreeEmbedder.h.

Constructor & Destructor Documentation

◆ DTreeEmbedder()

template<int Dim>
ogdf::energybased::dtree::DTreeEmbedder< Dim >::DTreeEmbedder ( const Graph graph)
explicit

constructor with a given graph, allocates memory and does initialization

Definition at line 174 of file DTreeEmbedder.h.

◆ ~DTreeEmbedder()

destructor

Definition at line 187 of file DTreeEmbedder.h.

Member Function Documentation

◆ centerNodesAt()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::centerNodesAt ( double  centerBBox[Dim])

computes the bounding box and all nodes are translated such that bbox center is at centerBBox

Definition at line 710 of file DTreeEmbedder.h.

◆ computeEdgeForces()

template<int Dim>
template<typename AttrForceFunc , bool UseForcePrime>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::computeEdgeForces ( AttrForceFunc  attrForceFunc)

computes the edge forces for one iteration

Definition at line 346 of file DTreeEmbedder.h.

◆ computeRepForces()

template<int Dim>
template<typename ForceFunc , bool UseForcePrime>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::computeRepForces ( ForceFunc  forceFunc)

computes the repulsive forces

Definition at line 323 of file DTreeEmbedder.h.

◆ computeRepForcesApprox()

template<int Dim>
template<typename ForceFunc , bool UseForcePrime>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::computeRepForcesApprox ( ForceFunc  forceFunc)

uses the tree code to approximate the repulsive forces in O(nlogn) for one iteration

Definition at line 250 of file DTreeEmbedder.h.

◆ computeRepForcesExact()

template<int Dim>
template<typename ForceFunc , bool UseForcePrime>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::computeRepForcesExact ( ForceFunc  forceFunc)

computes the repulsive forces for one iteration in O(n^2)

Definition at line 193 of file DTreeEmbedder.h.

◆ doIterationsNewton()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::doIterationsNewton ( int  numIterations,
double  epsilon,
RepForceFunc  repForceFunc,
AttrForceFunc  attrForceFunc 
)

Definition at line 703 of file DTreeEmbedder.h.

◆ doIterationsStandard()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::doIterationsStandard ( int  numIterations,
double  epsilon,
RepForceFunc  repForceFunc,
AttrForceFunc  attrForceFunc 
)

Definition at line 695 of file DTreeEmbedder.h.

◆ doIterationsTempl()

template<int Dim>
template<typename RepForceFunc , typename AttrForceFunc , bool UseForcePrime>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::doIterationsTempl ( int  numIterations,
double  epsilon,
RepForceFunc  repForceFunc,
AttrForceFunc  attrForceFunc 
)

does multiple iterations using the given repulsive force function

Definition at line 656 of file DTreeEmbedder.h.

◆ edgeWeight()

template<int Dim>
double ogdf::energybased::dtree::DTreeEmbedder< Dim >::edgeWeight ( edge  e) const

returns the edge weight

Definition at line 779 of file DTreeEmbedder.h.

◆ graph()

template<int Dim>
const Graph & ogdf::energybased::dtree::DTreeEmbedder< Dim >::graph ( ) const

returns the graph

Definition at line 769 of file DTreeEmbedder.h.

◆ mass()

template<int Dim>
double ogdf::energybased::dtree::DTreeEmbedder< Dim >::mass ( node  v) const

returns the mass of node v

Definition at line 759 of file DTreeEmbedder.h.

◆ moveNodes()

template<int Dim>
double ogdf::energybased::dtree::DTreeEmbedder< Dim >::moveNodes ( double  timeStep)

moves the nodes by the computed force vector

Definition at line 526 of file DTreeEmbedder.h.

◆ moveNodesByForcePrime()

template<int Dim>
double ogdf::energybased::dtree::DTreeEmbedder< Dim >::moveNodesByForcePrime ( )

Definition at line 502 of file DTreeEmbedder.h.

◆ position()

template<int Dim>
double ogdf::energybased::dtree::DTreeEmbedder< Dim >::position ( node  v,
int  d 
) const

returns the d-th coordinate of node v

Definition at line 749 of file DTreeEmbedder.h.

◆ resetForces()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::resetForces ( )

sets the forces of all nodes to 0

Definition at line 551 of file DTreeEmbedder.h.

◆ scaleNodes()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::scaleNodes ( double  scaleFactor)

changes the position of nodes according to a given scale factor

Definition at line 740 of file DTreeEmbedder.h.

◆ setEdgeWeight()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::setEdgeWeight ( edge  e,
double  weight 
)

sets the weight of an edge

Definition at line 774 of file DTreeEmbedder.h.

◆ setMass()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::setMass ( node  v,
double  mass 
)

sets the mass of a node v

Definition at line 764 of file DTreeEmbedder.h.

◆ setPosition()

template<int Dim>
void ogdf::energybased::dtree::DTreeEmbedder< Dim >::setPosition ( node  v,
int  d,
double  coord 
)

sets the d-th coordinate of node v to coord

Definition at line 754 of file DTreeEmbedder.h.

Member Data Documentation

◆ m_defaultTimeStep

template<int Dim>
double ogdf::energybased::dtree::DTreeEmbedder< Dim >::m_defaultTimeStep
private

Definition at line 167 of file DTreeEmbedder.h.

◆ m_edgeWeight

template<int Dim>
EdgeArray<double> ogdf::energybased::dtree::DTreeEmbedder< Dim >::m_edgeWeight
private

the weight of the edges

Definition at line 160 of file DTreeEmbedder.h.

◆ m_graph

template<int Dim>
const Graph& ogdf::energybased::dtree::DTreeEmbedder< Dim >::m_graph
private

the graph

Definition at line 154 of file DTreeEmbedder.h.

◆ m_maxNumNodesExactRepForces

template<int Dim>
int ogdf::energybased::dtree::DTreeEmbedder< Dim >::m_maxNumNodesExactRepForces
private

Definition at line 165 of file DTreeEmbedder.h.

◆ m_nodeInfo

template<int Dim>
NodeArray<NodeInfo> ogdf::energybased::dtree::DTreeEmbedder< Dim >::m_nodeInfo
private

node states of all nodes

Definition at line 157 of file DTreeEmbedder.h.

◆ m_pTreeForce

template<int Dim>
DTreeForce<Dim>* ogdf::energybased::dtree::DTreeEmbedder< Dim >::m_pTreeForce
private

the tree force approx

Definition at line 163 of file DTreeEmbedder.h.


The documentation for this class was generated from the following file: