edu.stanford.math.plex
public abstract class PointData extends java.lang.Object
PointData
instance encodes distance information for a
data set.Modifier and Type | Class and Description |
---|---|
static class |
PointData.Discrete |
static class |
PointData.NSpace
NSpace instances also provide dimension information. |
static class |
PointData.Predicate
Predicate instances are used weed out points that are
uninteresting in a given context (e.g., density too low or high). |
Modifier and Type | Field and Description |
---|---|
protected static java.util.Random |
rand |
Constructor and Description |
---|
PointData() |
Modifier and Type | Method and Description |
---|---|
abstract int |
count()
The number of points in this data set.
|
abstract double |
distance(int p1,
int p2)
Distance between 2 points.
|
int[] |
random_points(int number_of_points)
Return a sorted array of distinct indices for "random points" in the
metric space.
|
public abstract double distance(int p1, int p2)
p1
- index of the first pointp2
- index of the second pointpublic abstract int count()
Indexing begins from 1, not 0, which means that the points go from 1 to count(), inclusive. It is acceptable for an implementation to allow points to be added.
public int[] random_points(int number_of_points)
number_of_points
- How many points we want.