Class Segment
- java.lang.Object
-
- elki.evaluation.clustering.pairsegments.Segment
-
- All Implemented Interfaces:
java.lang.Comparable<Segment>
public class Segment extends java.lang.Object implements java.lang.Comparable<Segment>
A segment represents a set of pairs that share the same clustering properties.As such, for each ring (= clustering), a cluster number (or the constant
UNCLUSTERED
) is stored.- Since:
- 0.5.0
- Author:
- Sascha Goldhofer, Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
clusterIds
The cluster numbers in each ringprotected DBIDs
objIDs
IDs in segment, for object segments.protected long
pairsize
Size of cluster, in pairs.static int
UNCLUSTERED
Object is not clustered
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Segment sid)
boolean
equals(java.lang.Object obj)
int
get(int idx)
Get cluster number for index idx.DBIDs
getDBIDs()
Get the DBIDs of objects contained in this segment.long
getPairCount()
Get the number of pairs in the segment.int
getUnpairedClusteringIndex()
Returns the index of the first clustering having an unpaired cluster, or -1 no unpaired cluster exists.int
hashCode()
boolean
isNone()
Check if this segment contains the pairs that are never clustered by any of the clusterings (all 0).boolean
isUnpaired()
Checks if the segment has a cluster with unpaired objects.
-
-
-
Field Detail
-
UNCLUSTERED
public static final int UNCLUSTERED
Object is not clustered- See Also:
- Constant Field Values
-
objIDs
protected DBIDs objIDs
IDs in segment, for object segments.
-
pairsize
protected long pairsize
Size of cluster, in pairs.
-
clusterIds
protected final int[] clusterIds
The cluster numbers in each ring
-
-
Method Detail
-
getPairCount
public long getPairCount()
Get the number of pairs in the segment.- Returns:
- Number of pairs
-
get
public int get(int idx)
Get cluster number for index idx.- Parameters:
idx
- Index- Returns:
- Cluster number
-
isUnpaired
public boolean isUnpaired()
Checks if the segment has a cluster with unpaired objects. Unpaired clusters are represented by "0" (0 = all).- Returns:
- true when unclustered in at least one dimension.
-
isNone
public boolean isNone()
Check if this segment contains the pairs that are never clustered by any of the clusterings (all 0).- Returns:
- true when unclustered everywhere
-
getUnpairedClusteringIndex
public int getUnpairedClusteringIndex()
Returns the index of the first clustering having an unpaired cluster, or -1 no unpaired cluster exists.- Returns:
- clustering id or -1
-
getDBIDs
public DBIDs getDBIDs()
Get the DBIDs of objects contained in this segment.- Returns:
- the segment IDs
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-