The Pivot MDS (multi-dimensional scaling) layout algorithm. More...
#include <ogdf/energybased/PivotMDS.h>
Public Member Functions | |
PivotMDS () | |
virtual | ~PivotMDS () |
virtual void | call (GraphAttributes &GA) override |
Calls the layout algorithm for graph attributes GA . | |
bool | isForcing2DLayout () const |
Returns whether a 2D-layout is calculated even when GraphAttributes::threeD is set. | |
void | setEdgeCosts (double edgeCosts) |
Sets the desired distance between adjacent nodes. If the new value is smaller or equal 0 the default value (100) is used. | |
void | setForcing2DLayout (bool forcing2DLayout) |
Sets whether a 2D-layout should be calculated even when GraphAttributes::threeD is set. | |
void | setNumberOfPivots (int numberOfPivots) |
Sets the number of pivots. If the new value is smaller or equal 0 the default value (250) is used. | |
bool | useEdgeCostsAttribute () const |
void | useEdgeCostsAttribute (bool useEdgeCostsAttribute) |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . | |
Private Member Functions | |
void | centerPivotmatrix (Array< Array< double > > &pivotMatrix) |
Centers the pivot matrix. | |
void | copySPSS (Array< double > ©To, NodeArray< double > ©From) |
void | doPathLayout (GraphAttributes &GA, const node &v) |
Computes the layout of a path. | |
void | eigenValueDecomposition (Array< Array< double > > &K, Array< Array< double > > &eVecs, Array< double > &eValues) |
Computes the eigen value decomposition based on power iteration. | |
void | getPivotDistanceMatrix (const GraphAttributes &GA, Array< Array< double > > &pivDistMatrix) |
Computes the pivot distance matrix based on the maxmin strategy. | |
node | getRootedPath (const Graph &G) |
Checks whether the given graph is a path or not. | |
double | normalize (Array< double > &x) |
Normalizes the vector x . | |
void | pivotMDSLayout (GraphAttributes &GA) |
Computes the pivot mds layout of the given connected graph of GA . | |
double | prod (const Array< double > &x, const Array< double > &y) |
Computes the product of two vectors x and y . | |
void | randomize (Array< Array< double > > &matrix) |
Fills the given matrix with random doubles d 0 <= d <= 1. | |
void | selfProduct (const Array< Array< double > > &d, Array< Array< double > > &result) |
Computes the self product of d . | |
void | singularValueDecomposition (Array< Array< double > > &K, Array< Array< double > > &eVecs, Array< double > &eVals) |
Computes the singular value decomposition of matrix K . | |
Private Attributes | |
int | m_dimensionCount |
The dimension count determines the number of evecs that will be computed. Nevertheless PivotMDS only takes the first two with the highest eigenwert into account. | |
double | m_edgeCosts |
The costs to traverse an edge. | |
bool | m_forcing2DLayout |
Whether a 2D-layout is calculated even when GraphAttributes::threeD is set. | |
bool | m_hasEdgeCostsAttribute |
Tells whether the pivot mds is based on uniform edge costs or a edge costs attribute. | |
int | m_numberOfPivots |
The number of pivots. | |
Static Private Attributes | |
static const double | EPSILON |
Convergence factor used for power iteration. | |
static const double | FACTOR |
Factor used to center the pivot matrix. | |
static const unsigned int | SEED = 0 |
Seed of the random number generator. | |
The Pivot MDS (multi-dimensional scaling) layout algorithm.
Definition at line 52 of file PivotMDS.h.
|
inline |
Definition at line 54 of file PivotMDS.h.
|
inlinevirtual |
Definition at line 61 of file PivotMDS.h.
|
overridevirtual |
Calls the layout algorithm for graph attributes GA
.
Calculates a 3D-layout if GraphAttributes::threeD is set for GA
, and a 2D-layout otherwise. You can use setForcing2DLayout() to force the calculation of a 2D-layout even when GraphAttributes::threeD is set.
Implements ogdf::LayoutModule.
Centers the pivot matrix.
|
private |
Computes the layout of a path.
|
private |
Computes the eigen value decomposition based on power iteration.
|
private |
Computes the pivot distance matrix based on the maxmin strategy.
Checks whether the given graph is a path or not.
|
inline |
Returns whether a 2D-layout is calculated even when GraphAttributes::threeD is set.
Definition at line 79 of file PivotMDS.h.
|
private |
Computes the pivot mds layout of the given connected graph of GA
.
Computes the product of two vectors x
and y
.
Fills the given matrix
with random doubles d 0 <= d <= 1.
|
private |
Computes the self product of d
.
Sets the desired distance between adjacent nodes. If the new value is smaller or equal 0 the default value (100) is used.
Definition at line 71 of file PivotMDS.h.
Sets whether a 2D-layout should be calculated even when GraphAttributes::threeD is set.
Definition at line 75 of file PivotMDS.h.
Sets the number of pivots. If the new value is smaller or equal 0 the default value (250) is used.
Definition at line 65 of file PivotMDS.h.
|
private |
Computes the singular value decomposition of matrix K
.
|
inline |
Definition at line 94 of file PivotMDS.h.
Definition at line 90 of file PivotMDS.h.
Convergence factor used for power iteration.
Definition at line 98 of file PivotMDS.h.
Factor used to center the pivot matrix.
Definition at line 101 of file PivotMDS.h.
|
private |
The dimension count determines the number of evecs that will be computed. Nevertheless PivotMDS only takes the first two with the highest eigenwert into account.
Definition at line 112 of file PivotMDS.h.
|
private |
The costs to traverse an edge.
Definition at line 115 of file PivotMDS.h.
|
private |
Whether a 2D-layout is calculated even when GraphAttributes::threeD is set.
Definition at line 123 of file PivotMDS.h.
|
private |
Tells whether the pivot mds is based on uniform edge costs or a edge costs attribute.
Definition at line 119 of file PivotMDS.h.
|
private |
The number of pivots.
Definition at line 107 of file PivotMDS.h.
Seed of the random number generator.
Definition at line 104 of file PivotMDS.h.