edu.stanford.math.plex
public class Torus extends PointData.NSpace
Torus instance is discrete simulation of a d-dimensional torus. For testing.
Simplest implementation of a d-dimensional torus. Intended for testing.
PointData.Discrete, PointData.NSpace, PointData.Predicate| Constructor and Description |
|---|
Torus() |
Torus(double[] data,
int d)
Make a Torus with a given data array.
|
Torus(int n,
int d)
Make an n-way grid on the unit Torus.
|
| Modifier and Type | Method and Description |
|---|---|
double |
coordinate(int p,
int i)
i-th coordinate of point p;
|
int |
count()
The number of data points.
|
int |
dimension()
The number of dimensions of the space.
|
double |
distance(int p1,
int p2)
Toroidal distance.
|
xirandom_pointspublic Torus(double[] data,
int d)
data - double[] of point data.public Torus(int n,
int d)
n - grid size parameterpublic Torus()
public int dimension()
dimension in class PointData.NSpacepublic double coordinate(int p,
int i)
coordinate in class PointData.NSpacep - the pointi - the coordinate indexpublic int count()