edu.stanford.math.plex
public class MappedBufferData extends PointData.NSpace
MappedBufferData
class is another very simple implementation
of NSpace. Intended for larger, but still mappable, data sets.PointData.Discrete, PointData.NSpace, PointData.Predicate
Modifier | Constructor and Description |
---|---|
protected |
MappedBufferData() |
|
MappedBufferData(java.lang.String filename) |
|
MappedBufferData(java.lang.String filename,
boolean writable) |
|
MappedBufferData(java.lang.String filename,
int start_dimension) |
|
MappedBufferData(java.lang.String filename,
int start_dimension,
int stop_dimension,
boolean writable) |
|
MappedBufferData(java.lang.String filename,
int num_pts,
int dimension,
double min,
double max) |
|
MappedBufferData(java.lang.String filename,
int num_pts,
int dimension,
int partition_count) |
|
MappedBufferData(java.lang.String filename,
int length,
int dimension,
int start_dimension,
int stop_dimension) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
buf_is_consistent(java.nio.DoubleBuffer buf,
int dimension,
boolean just_created) |
double |
coordinate(int p,
int i)
Get coordinates.
|
int |
count()
The number of data points.
|
static void |
delete(java.lang.String filename) |
int |
dimension()
The number of dimensions of the space.
|
double |
distance(int p1,
int p2)
Euclidean distance.
|
protected static java.nio.MappedByteBuffer |
empty_dbl_file(java.lang.String filename,
int len) |
protected static boolean |
file_exists(java.lang.String filename,
boolean andWriteable) |
void |
force()
Force changes to data back to file.
|
double[] |
get_pt(int p,
double[] vec)
Get point.
|
protected static void |
make_empty_file(java.lang.String filename,
int bytes) |
protected static java.nio.MappedByteBuffer |
map_file(java.lang.String filename,
boolean writable) |
double |
set_coordinate(int p,
int i,
double v)
Set coordinates.
|
double[] |
set_pt(int p,
double[] vec)
Set point.
|
int |
start()
The first data dimension of the space.
|
int |
stop()
The last data dimension of the space.
|
xi
random_points
protected MappedBufferData()
public MappedBufferData(java.lang.String filename, int length, int dimension, int start_dimension, int stop_dimension)
public MappedBufferData(java.lang.String filename, int start_dimension, int stop_dimension, boolean writable)
public MappedBufferData(java.lang.String filename)
public MappedBufferData(java.lang.String filename, boolean writable)
public MappedBufferData(java.lang.String filename, int start_dimension)
public MappedBufferData(java.lang.String filename, int num_pts, int dimension, double min, double max)
public MappedBufferData(java.lang.String filename, int num_pts, int dimension, int partition_count)
public int dimension()
dimension
in class PointData.NSpace
public int start()
public int stop()
public int count()
public double distance(int p1, int p2)
public double[] get_pt(int p, double[] vec)
p
- the pointvec
- place to store pointpublic double[] set_pt(int p, double[] vec)
p
- the pointvec
- the coordinate valuespublic double coordinate(int p, int i)
coordinate
in class PointData.NSpace
p
- the pointi
- the coordinatepublic double set_coordinate(int p, int i, double v)
p
- the pointi
- the coordinatev
- the coordinate valuepublic void force()
protected static boolean file_exists(java.lang.String filename, boolean andWriteable)
public static void delete(java.lang.String filename)
protected static void make_empty_file(java.lang.String filename, int bytes)
protected static java.nio.MappedByteBuffer empty_dbl_file(java.lang.String filename, int len)
protected static java.nio.MappedByteBuffer map_file(java.lang.String filename, boolean writable)
protected boolean buf_is_consistent(java.nio.DoubleBuffer buf, int dimension, boolean just_created)