Class HyperbolicSpace

Class Documentation

class HyperbolicSpace

Public Functions

HyperbolicSpace() = default
~HyperbolicSpace() = default

Public Static Functions

static void fillPoints(vector<double> &angles, vector<double> &radii, double R, double alpha)

Fill preallocated vectors with randomly sampled points in native coordinates

Parameters:
  • angles – empty vector to hold angular coordinates of generated points

  • radii – empty vector to hold radial coordinates of generated points

  • R – radius of the hyperbolic disk

  • alpha – dispersion parameter for the node positions

static void fillPoints(vector<double> &angles, vector<double> &radii, double minPhi, double maxPhi, double minR, double maxR, double alpha)

Fill preallocated vectors with randomly sampled points in native coordinates

Parameters:
  • angles – empty vector to hold angular coordinates of generated points

  • radii – empty vector to hold radial coordinates of generated points

  • stretch – multiplier for the radius of the hyperbolic disk

  • alpha – dispersion parameter for the node positions

static void fillPointsSorted(vector<double> &angles, vector<double> &radii, double R, double alpha)

Fill preallocated vectors with randomly sampled points in native coordinates The points are sorted by angle

Parameters:
  • angles – empty vector to hold angular coordinates of generated points

  • radii – empty vector to hold radial coordinates of generated points

  • R – radius of the hyperbolic disk

  • alpha – dispersion parameter for the node positions

static void fillPointsSorted(vector<double> &angles, vector<double> &radii, double minPhi, double maxPhi, double minR, double maxR, double alpha)

Fill preallocated vectors with randomly sampled points in native coordinates The points are sorted by angle

Parameters:
  • angles – empty vector to hold angular coordinates of generated points

  • radii – empty vector to hold radial coordinates of generated points

  • stretch – multiplier for the radius of the hyperbolic disk

  • alpha – dispersion parameter for the node positions

static double poincareMetric(double firstangle, double firstR, double secondangle, double secondR)
Parameters:
  • firstangle – angular coordinate of the first point

  • firstR – radial coordinate of the first point

  • secondangle – angular coordinate of the second point

  • secondR – radial coordinate of the second point

Returns:

distance between two points in the poincare metric

static double nativeDistance(double firstangle, double firstR, double secondangle, double secondR)
Parameters:
  • firstangle – angular coordinate of the first point

  • firstR – radial coordinate of the first point

  • secondangle – angular coordinate of the second point

  • secondR – radial coordinate of the second point

Returns:

distance between two points in native hyperbolic representation

static double poincareMetric(Point2DWithIndex<double> a, Point2DWithIndex<double> b)
Parameters:
  • a – first point in cartesian coordinates

  • b – second point in cartesian coordinates

Returns:

distance between a and b in the poincare metric

static Point2DWithIndex<double> polarToCartesian(double phi, double r)
Parameters:
  • phi – angular coordinate of point

  • r – radial coordinate of point

Returns:

cartesian coordinates represented by phi and r

static std::map<index, Point<float>> polarToCartesian(const vector<double> &angles, const vector<double> &radii)

Convenience function for visualizations which expect coordinates as map<index,Point<float> >

static void cartesianToPolar(Point2DWithIndex<double> a, double &phi, double &r)
Parameters:
  • a – cartesian coordinates

  • phi – empty double value to receive angular coordinate

  • r – empty double value to receive radial coordinate

static void getEuclideanCircle(Point2DWithIndex<double> hyperbolicCenter, double hyperbolicRadius, Point2DWithIndex<double> &euclideanCenter, double &euclideanRadius)

Converts a hyperbolic circle to a Euclidean circle

Parameters:
  • hyperbolicCenter – center of the hyperbolic circle, given in cartesian coordinates within the poincare disk

  • hyperbolicRadius – radius of the hyperbolic circle

  • euclideanCenter – point to receive the center of the Euclidean circle, given in cartesian coordinates

  • euclidenRadius – double to receive the radius of the Euclidean circle

static void getEuclideanCircle(double r_h, double hyperbolicRadius, double &radialCoordOfEuclideanCenter, double &euclideanRadius)
static double hyperbolicRadiusToEuclidean(double hyperbolicRadius)

Project radial coordinates of the hyperbolic plane into the Poincare disk model

Parameters:

hyperbolicRadius – radial coordinate of a point in the native hyperbolic disc

Returns:

radial coordinate in the Poincare model

static double EuclideanRadiusToHyperbolic(double EuclideanRadius)

Project radial coordinates of the Poincare model into the hyperbolic plane

Parameters:

EuclideanRadius – Radial coordinate of a point in the Poincare model

Returns:

radial coordinate in the hyperbolic plane

static inline double hyperbolicAreaToRadius(double area)
Parameters:
  • area – The area of the hyperbolic circle

  • return – Radius of a hyperbolic circle with the given area

static inline double radiusToHyperbolicArea(double radius)
static inline double getExpectedDegree(double n, double alpha, double R)
static inline double searchTargetRadiusForColdGraphs(double n, double k, double alpha, double epsilon)
static inline double getTargetRadius(double n, double m, double alpha = 1, double T = 0, double epsilon = 0.01)
static inline double effectiveAreaInCell(double minPhi, double maxPhi, double minR, double maxR, double alpha)
static double hyperbolicSpaceInEuclideanCircle(double r_c, double d_c, double R)
Parameters:
  • r_c – radial coordinate of the circle center

  • d_c – radius of the Euclidean circle

  • R – radius of the hyperbolic base disk

static double maxRinSlice(double minPhi, double maxPhi, double phi_c, double r_c, double euRadius)