Package elki.clustering.optics
Class ClusterOrder
- java.lang.Object
-
- elki.clustering.optics.ClusterOrder
-
- All Implemented Interfaces:
OrderingResult
- Direct Known Subclasses:
CorrelationClusterOrder
public class ClusterOrder extends java.lang.Object implements OrderingResult
Class to store the result of an ordering clustering algorithm such as OPTICS.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ArrayModifiableDBIDsidsCluster order.(package private) WritableDBIDDataStorepredecessorPredecessor storage.(package private) WritableDoubleDataStorereachabilityReachability storage.
-
Constructor Summary
Constructors Constructor Description ClusterOrder(ArrayModifiableDBIDs ids, WritableDoubleDataStore reachability, WritableDBIDDataStore predecessor)ConstructorClusterOrder(DBIDs ids)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DBIDRef id, double reach, DBIDRef pre)Add an object to the cluster order.ArrayDBIDsgetDBIDs()Get the full set of DBIDs this ordering is defined for.voidgetPredecessor(DBIDRef id, DBIDVar out)Get the predecessor.doublegetReachability(DBIDRef id)Get the reachability of an object.DBIDArrayIteriter()Get an iterator.ArrayModifiableDBIDsorder(DBIDs ids)Use the cluster order to sort the given collection ids.intsize()Size.
-
-
-
Field Detail
-
ids
ArrayModifiableDBIDs ids
Cluster order.
-
reachability
WritableDoubleDataStore reachability
Reachability storage.
-
predecessor
WritableDBIDDataStore predecessor
Predecessor storage.
-
-
Constructor Detail
-
ClusterOrder
public ClusterOrder(DBIDs ids)
Constructor- Parameters:
ids- Object IDs included
-
ClusterOrder
public ClusterOrder(ArrayModifiableDBIDs ids, WritableDoubleDataStore reachability, WritableDBIDDataStore predecessor)
Constructor- Parameters:
ids- Object IDs included
-
-
Method Detail
-
add
public void add(DBIDRef id, double reach, DBIDRef pre)
Add an object to the cluster order.- Parameters:
id- Object idreach- Reachabilitypre- Predecessor
-
getDBIDs
public ArrayDBIDs getDBIDs()
Description copied from interface:OrderingResultGet the full set of DBIDs this ordering is defined for.- Specified by:
getDBIDsin interfaceOrderingResult- Returns:
- DBIDs
-
iter
public DBIDArrayIter iter()
Get an iterator.
-
order
public ArrayModifiableDBIDs order(DBIDs ids)
Use the cluster order to sort the given collection ids. Implementation of theOrderingResultinterface.- Specified by:
orderin interfaceOrderingResult- Parameters:
ids- Collection of ids.- Returns:
- iterator for sorted array of ids
-
size
public int size()
Size.- Returns:
- Size
-
getReachability
public double getReachability(DBIDRef id)
Get the reachability of an object.- Parameters:
id- Object id- Returns:
- Reachability
-
-