protected static class CLARANS.Assignment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) WritableIntegerDataStore |
assignment
Cluster mapping.
|
(package private) DistanceQuery<?> |
distQ
Distance function to use.
|
(package private) DBIDs |
ids
Ids to process.
|
(package private) ArrayModifiableDBIDs |
medoids
Medoids
|
(package private) DBIDArrayMIter |
miter
Medoid iterator
|
(package private) WritableDoubleDataStore |
nearest
Distance to the nearest medoid of each point.
|
(package private) WritableDoubleDataStore |
second
Distance to the second nearest medoid.
|
(package private) WritableIntegerDataStore |
secondid
Medoid id of the second closest.
|
Constructor and Description |
---|
Assignment(DistanceQuery<?> distQ,
DBIDs ids,
int k)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
assignToNearestCluster()
Assign each point to the nearest medoid.
|
protected double |
computeCostDifferential(DBIDRef h,
int mnum,
CLARANS.Assignment scratch)
Compute the reassignment cost, for one swap.
|
protected double |
recompute(DBIDRef id,
int mnum,
double known,
int snum,
double sknown)
Recompute the assignment of one point.
|
DBIDs ids
DistanceQuery<?> distQ
WritableDoubleDataStore nearest
WritableDoubleDataStore second
WritableIntegerDataStore assignment
WritableIntegerDataStore secondid
ArrayModifiableDBIDs medoids
DBIDArrayMIter miter
public Assignment(DistanceQuery<?> distQ, DBIDs ids, int k)
distQ
- Distance queryids
- IDs to processk
- Number of medoidsprotected double computeCostDifferential(DBIDRef h, int mnum, CLARANS.Assignment scratch)
h
- Current object to swap with any medoid.mnum
- Medoid number to swap with h.scratch
- Scratch assignment to fill.protected double recompute(DBIDRef id, int mnum, double known, int snum, double sknown)
id
- Point idmnum
- Medoid number for known distanceknown
- Known distanceprotected double assignToNearestCluster()
Copyright © 2019 ELKI Development Team. License information.