edu.stanford.math.plex
public class RDirectBufferData extends PointData
RDirectBufferData is a mechanism for transforming an R
distance matrix into a PointData.PointData.Discrete, PointData.NSpace, PointData.Predicate| Modifier and Type | Field and Description |
|---|---|
protected java.nio.DoubleBuffer |
distanceBuffer |
protected int |
p_max
Max number of points.
|
| Constructor and Description |
|---|
RDirectBufferData(int count,
java.nio.ByteBuffer buf)
Use a pre-allocated buffer of doubles as the distance matrix.
|
| Modifier and Type | Method and Description |
|---|---|
int |
count()
The number of points in this data set.
|
double |
distance(int p1,
int p2)
Return the distance between the two points using the external
data, which is stored as 0-based columns.
|
random_pointsprotected final int p_max
protected final java.nio.DoubleBuffer distanceBuffer
public RDirectBufferData(int count,
java.nio.ByteBuffer buf)
count - The upper bound on i. i is 1-indexedbuf - ByteBuffer instance to be used.public double distance(int p1,
int p2)
public int count()
PointDataIndexing 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.