38 namespace spring_embedder {
40 template<
typename NodeInfo>
61 return (norm +
eps()) / (m_idealEdgeLength +
eps());
66 const NodeInfo &vj = m_vInfo[j];
70 for (
int i = vj.m_adjBegin; i != vj.m_adjStop; ++i) {
71 int u = m_adjLists[i];
73 DPoint dist = vj.m_pos - m_vInfo[u].m_pos;
74 double d = dist.
norm();
80 force /= std::pow(m_idealEdgeLength, idealExponent);
double norm() const
Returns the norm of the point.
DPoint computeFruchtermanReingoldAttractiveForce(int j, int idealExponent) const
const Array< int > & m_adjLists
CommonForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, double idealEdgeLength)
Basic declarations, included by all source files.
double normByIdealEdgeLength(double norm) const
The namespace for all OGDF objects.
Declaration of classes DPoint, DPolyline, DLine, DRect, DIntersectableRect, DScaler.
const Array< NodeInfo > & m_vInfo