public class KDTreeClusters extends IndexClusters implements SpatialClusters<double[]>
clusters, nEntries
CLUSTER_HEADER
Constructor and Description |
---|
KDTreeClusters(DoubleKDTree tree,
int dims) |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
HardAssigner<double[],?,?> |
defaultHardAssigner()
Get the default hard assigner for this clusterer.
|
int |
numClusters()
Get the number of clusters.
|
int |
numDimensions()
Get the data dimensionality
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
clusters, numEntries, toString
public KDTreeClusters(DoubleKDTree tree, int dims)
tree
- the KDTree which represents the clustersdims
- public int numDimensions()
SpatialClusters
numDimensions
in interface SpatialClusters<double[]>
public int numClusters()
IndexClusters
numClusters
in interface SpatialClusters<double[]>
numClusters
in class IndexClusters
public HardAssigner<double[],?,?> defaultHardAssigner()
SpatialClusters
defaultHardAssigner
in interface SpatialClusters<double[]>
public void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
readASCII
in class IndexClusters
in
- source to read from.IOException
- an error reading inputpublic String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
asciiHeader
in class IndexClusters
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
readBinary
in class IndexClusters
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
binaryHeader
in class IndexClusters
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
writeASCII
in class IndexClusters
out
- sink to write toIOException
- an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
writeBinary
in class IndexClusters
out
- sink to write toIOException
- an error writing to out