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) ArrayModifiableDBIDs
ids
Cluster order.(package private) WritableDBIDDataStore
predecessor
Predecessor storage.(package private) WritableDoubleDataStore
reachability
Reachability 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 void
add(DBIDRef id, double reach, DBIDRef pre)
Add an object to the cluster order.ArrayDBIDs
getDBIDs()
Get the full set of DBIDs this ordering is defined for.void
getPredecessor(DBIDRef id, DBIDVar out)
Get the predecessor.double
getReachability(DBIDRef id)
Get the reachability of an object.DBIDArrayIter
iter()
Get an iterator.ArrayModifiableDBIDs
order(DBIDs ids)
Use the cluster order to sort the given collection ids.int
size()
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:OrderingResult
Get the full set of DBIDs this ordering is defined for.- Specified by:
getDBIDs
in 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 theOrderingResult
interface.- Specified by:
order
in 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
-
-