public class PointerHierarchyRepresentationBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected WritableIntegerDataStore |
csize
Cluster size storage.
|
protected DBIDs |
ids
The DBIDs in this result.
|
protected boolean |
isSquared
Flag to indicate squared distances.
|
private static Logging |
LOG
Class logger.
|
protected int |
mergecount
Merge counter (for merge ordering).
|
protected WritableIntegerDataStore |
order
Store merge order.
|
protected WritableDBIDDataStore |
parent
The parent DBID relation.
|
protected WritableDoubleDataStore |
parentDistance
Distance to the parent object.
|
protected WritableDBIDDataStore |
prototypes
Prototype storage, may be
null . |
Constructor and Description |
---|
PointerHierarchyRepresentationBuilder(DBIDs ids,
boolean isSquared)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(DBIDRef cur,
double distance,
DBIDRef par)
Add an element to the pointer representation.
|
void |
add(DBIDRef cur,
double distance,
DBIDRef par,
DBIDRef prototype)
Add an element to the pointer representation.
|
PointerHierarchyRepresentationResult |
complete()
Finalize the result.
|
double |
getDistance(DBIDRef id)
Get the current linking distance of an object.
|
int |
getSize(DBIDRef id)
Get the cluster size of the current object.
|
boolean |
isLinked(DBIDRef id)
Test if an object is already linked.
|
void |
setSize(DBIDRef id,
int size)
Set the cluster size of an object.
|
private static final Logging LOG
protected final DBIDs ids
protected WritableDBIDDataStore parent
protected WritableDoubleDataStore parentDistance
protected WritableIntegerDataStore csize
protected WritableIntegerDataStore order
protected int mergecount
protected WritableDBIDDataStore prototypes
null
.protected boolean isSquared
public PointerHierarchyRepresentationBuilder(DBIDs ids, boolean isSquared)
ids
- IDsisSquared
- Flag to indicate squared distancespublic void add(DBIDRef cur, double distance, DBIDRef par)
cur
- Current objectdistance
- Link distancepar
- Parentpublic void add(DBIDRef cur, double distance, DBIDRef par, DBIDRef prototype)
cur
- Current objectdistance
- Link distancepar
- Parentprototype
- public PointerHierarchyRepresentationResult complete()
public int getSize(DBIDRef id)
id
- Object idpublic void setSize(DBIDRef id, int size)
id
- Object to setsize
- Cluster sizepublic boolean isLinked(DBIDRef id)
id
- Objecttrue
if the object is already linked.public double getDistance(DBIDRef id)
id
- ObjectCopyright © 2019 ELKI Development Team. License information.