Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::davidson_harel::NodePairEnergy Class Referenceabstract

#include <ogdf/energybased/davidson_harel/NodePairEnergy.h>

+ Inheritance diagram for ogdf::davidson_harel::NodePairEnergy:

Public Member Functions

 NodePairEnergy (const string energyname, GraphAttributes &AG)
 
virtual ~NodePairEnergy ()
 
void computeEnergy () override
 computes energy for the layout at the beginning of the optimization process More...
 
- Public Member Functions inherited from ogdf::davidson_harel::EnergyFunction
 EnergyFunction (const string &funcname, GraphAttributes &AG)
 Initializes data dtructures to speed up later computations. More...
 
virtual ~EnergyFunction ()
 
void candidateTaken ()
 Changes m_currentX and m_currentY by setting the position of m_testNode to m_testX and m_testY. Sets m_energy to m_candidateEnergy. Computes the energy of the layout stored in AG. More...
 
double computeCandidateEnergy (const node v, const DPoint &newPos)
 sets m_testNode, m_testX and m_testY and computes the energy for the new configuration (vertex v moves to newPos) More...
 
double energy () const
 
string getName () const
 prints the name of the energy function More...
 
void printStatus () const
 prints status information for debugging More...
 

Protected Member Functions

bool adjacent (const node v, const node w) const
 returns true in constant time if two vertices are adjacent. More...
 
virtual double computeCoordEnergy (node, node, const DPoint &, const DPoint &) const =0
 Computes the energy stored by a pair of vertices at the given positions. More...
 
int nodeNum (node v) const
 Returns the internal number given to each vertex. More...
 
virtual void printInternalData () const override
 
const DIntersectableRectshape (const node v) const
 Returns the shape of a vertex v as a DIntersectableRect. More...
 
- Protected Member Functions inherited from ogdf::davidson_harel::EnergyFunction
DPoint currentPos (const node v) const
 returns the current position of vertex v More...
 
node testNode () const
 returns the vertex that is under consideration in the current step More...
 
DPoint testPos ()
 returns candidate position for the node to be moved More...
 

Private Member Functions

void compCandEnergy () override
 computes the energy if m_testNode changes position to m_testX and m_testY, sets the value of m_candidateEnergy. More...
 
double computePairEnergy (const node v, const node w) const
 
void internalCandidateTaken () override
 changes the data of a specific energy function if the candidate was taken More...
 

Private Attributes

const AdjacencyOracle m_adjacentOracle
 
NodeArray< double > m_candPairEnergy
 
NodeArray< int > * m_nodeNums
 
List< nodem_nonIsolated
 
Array2D< double > * m_pairEnergy
 
NodeArray< DIntersectableRectm_shape
 

Additional Inherited Members

- Protected Attributes inherited from ogdf::davidson_harel::EnergyFunction
double m_candidateEnergy
 the energy of the layout if the candidate layout is chosen More...
 
double m_energy
 energy of the current layout More...
 
const Graphm_G
 the graph that should be drawn More...
 
const string m_name
 name of the energy function More...
 

Detailed Description

Definition at line 51 of file NodePairEnergy.h.

Constructor & Destructor Documentation

◆ NodePairEnergy()

ogdf::davidson_harel::NodePairEnergy::NodePairEnergy ( const string  energyname,
GraphAttributes AG 
)

◆ ~NodePairEnergy()

virtual ogdf::davidson_harel::NodePairEnergy::~NodePairEnergy ( )
inlinevirtual

Definition at line 56 of file NodePairEnergy.h.

Member Function Documentation

◆ adjacent()

bool ogdf::davidson_harel::NodePairEnergy::adjacent ( const node  v,
const node  w 
) const
inlineprotected

returns true in constant time if two vertices are adjacent.

Definition at line 72 of file NodePairEnergy.h.

◆ compCandEnergy()

void ogdf::davidson_harel::NodePairEnergy::compCandEnergy ( )
overrideprivatevirtual

computes the energy if m_testNode changes position to m_testX and m_testY, sets the value of m_candidateEnergy.

Implements ogdf::davidson_harel::EnergyFunction.

◆ computeCoordEnergy()

virtual double ogdf::davidson_harel::NodePairEnergy::computeCoordEnergy ( node  ,
node  ,
const DPoint ,
const DPoint  
) const
protectedpure virtual

Computes the energy stored by a pair of vertices at the given positions.

Implemented in ogdf::davidson_harel::Attraction, ogdf::davidson_harel::Overlap, and ogdf::davidson_harel::Repulsion.

◆ computeEnergy()

void ogdf::davidson_harel::NodePairEnergy::computeEnergy ( )
overridevirtual

computes energy for the layout at the beginning of the optimization process

Implements ogdf::davidson_harel::EnergyFunction.

◆ computePairEnergy()

double ogdf::davidson_harel::NodePairEnergy::computePairEnergy ( const node  v,
const node  w 
) const
private

◆ internalCandidateTaken()

void ogdf::davidson_harel::NodePairEnergy::internalCandidateTaken ( )
overrideprivatevirtual

changes the data of a specific energy function if the candidate was taken

Implements ogdf::davidson_harel::EnergyFunction.

◆ nodeNum()

int ogdf::davidson_harel::NodePairEnergy::nodeNum ( node  v) const
inlineprotected

Returns the internal number given to each vertex.

Definition at line 69 of file NodePairEnergy.h.

◆ printInternalData()

virtual void ogdf::davidson_harel::NodePairEnergy::printInternalData ( ) const
overrideprotectedvirtual

◆ shape()

const DIntersectableRect& ogdf::davidson_harel::NodePairEnergy::shape ( const node  v) const
inlineprotected

Returns the shape of a vertex v as a DIntersectableRect.

Definition at line 75 of file NodePairEnergy.h.

Member Data Documentation

◆ m_adjacentOracle

const AdjacencyOracle ogdf::davidson_harel::NodePairEnergy::m_adjacentOracle
private

Definition at line 89 of file NodePairEnergy.h.

◆ m_candPairEnergy

NodeArray<double> ogdf::davidson_harel::NodePairEnergy::m_candPairEnergy
private

Definition at line 84 of file NodePairEnergy.h.

◆ m_nodeNums

NodeArray<int>* ogdf::davidson_harel::NodePairEnergy::m_nodeNums
private

Definition at line 82 of file NodePairEnergy.h.

◆ m_nonIsolated

List<node> ogdf::davidson_harel::NodePairEnergy::m_nonIsolated
private

Definition at line 88 of file NodePairEnergy.h.

◆ m_pairEnergy

Array2D<double>* ogdf::davidson_harel::NodePairEnergy::m_pairEnergy
private

Definition at line 83 of file NodePairEnergy.h.

◆ m_shape

NodeArray<DIntersectableRect> ogdf::davidson_harel::NodePairEnergy::m_shape
private

Definition at line 86 of file NodePairEnergy.h.


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