public class IndexClusters extends Object implements Clusters
| Modifier and Type | Field and Description |
|---|---|
protected int[][] |
clusters |
protected int |
nEntries |
CLUSTER_HEADER| Constructor and Description |
|---|
IndexClusters()
Used only to initailise for
IOUtils |
IndexClusters(int[] assignments) |
IndexClusters(int[][] clusters) |
IndexClusters(int[][] clusters,
int nEntries) |
IndexClusters(List<int[]> completedClusters) |
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader() |
byte[] |
binaryHeader() |
int[][] |
clusters()
Get the number of clusters.
|
int |
numClusters()
Get the number of clusters.
|
int |
numEntries()
Get the number of data entries
|
void |
readASCII(Scanner in) |
void |
readBinary(DataInput in) |
String |
toString() |
void |
writeASCII(PrintWriter out) |
void |
writeBinary(DataOutput out) |
public IndexClusters()
IOUtilspublic IndexClusters(int[][] clusters, int nEntries)
clusters - the clustersnEntries - the number of entriespublic IndexClusters(int[][] clusters)
clusters - the clusterspublic IndexClusters(int[] assignments)
assignments - convert a list of cluster assignments to a 2D array to cluster
to assignmentspublic IndexClusters(List<int[]> completedClusters)
completedClusters - public int[][] clusters()
public int numEntries()
public int numClusters()
public void readASCII(Scanner in) throws IOException
readASCII in interface ReadableASCIIIOExceptionpublic String asciiHeader()
asciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic void readBinary(DataInput in) throws IOException
readBinary in interface ReadableBinaryIOExceptionpublic byte[] binaryHeader()
binaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void writeASCII(PrintWriter out) throws IOException
writeASCII in interface WriteableASCIIIOExceptionpublic void writeBinary(DataOutput out) throws IOException
writeBinary in interface WriteableBinaryIOException