private class OnlineLOF.LOFKNNListener extends Object implements KNNListener
Modifier and Type | Field and Description |
---|---|
private KNNChangeEvent |
firstEventReceived
Holds the first event of one of the both preprocessors.
|
private FlexibleLOF.LOFResult<O> |
lofResult
Holds the result of a former run of the LOF algorithm.
|
Constructor and Description |
---|
OnlineLOF.LOFKNNListener(FlexibleLOF.LOFResult<O> lofResult)
Constructs a listener for the LOF algorithm.
|
Modifier and Type | Method and Description |
---|---|
void |
kNNsChanged(KNNChangeEvent e)
Invoked after kNNs have been updated, inserted or removed
in some way.
|
private void |
kNNsChanged(KNNChangeEvent e1,
KNNChangeEvent e2)
Invoked after the events of both preprocessors have been received, i.e.
|
private void |
kNNsInserted(DBIDs insertions,
DBIDs updates1,
DBIDs updates2,
FlexibleLOF.LOFResult<O> lofResult)
Invoked after kNNs have been inserted and updated, updates the result.
|
private void |
kNNsRemoved(DBIDs deletions,
DBIDs updates1,
DBIDs updates2,
FlexibleLOF.LOFResult<O> lofResult)
Invoked after kNNs have been removed and updated, updates the result.
|
private ArrayModifiableDBIDs |
mergeIDs(List<? extends DoubleDBIDList> queryResults,
DBIDs... ids)
Merges the ids of the query result with the specified ids.
|
private void |
recomputeLOFs(DBIDs ids,
FlexibleLOF.LOFResult<O> lofResult)
Recomputes the lofs of the specified ids.
|
private KNNChangeEvent firstEventReceived
private FlexibleLOF.LOFResult<O> lofResult
public OnlineLOF.LOFKNNListener(FlexibleLOF.LOFResult<O> lofResult)
lofResult
- the result of a former run of the LOF algorithmpublic void kNNsChanged(KNNChangeEvent e)
KNNListener
kNNsChanged
in interface KNNListener
e
- the change eventprivate void kNNsChanged(KNNChangeEvent e1, KNNChangeEvent e2)
e1
- the change event of the first preprocessore2
- the change event of the second preprocessorprivate void kNNsInserted(DBIDs insertions, DBIDs updates1, DBIDs updates2, FlexibleLOF.LOFResult<O> lofResult)
insertions
- the ids of the newly inserted neighborhoodsupdates1
- the ids of the updated neighborhood w.r.t. the
neighborhood distance functionupdates2
- the ids of the updated neighborhood w.r.t. the
reachability distance functionlofResult
- the result of the former LOF runprivate void kNNsRemoved(DBIDs deletions, DBIDs updates1, DBIDs updates2, FlexibleLOF.LOFResult<O> lofResult)
deletions
- the ids of the removed neighborhoodsupdates1
- the ids of the updated neighborhood w.r.t. the
neighborhood distance functionupdates2
- the ids of the updated neighborhood w.r.t. the
reachability distance functionlofResult
- the result of the former LOF runprivate ArrayModifiableDBIDs mergeIDs(List<? extends DoubleDBIDList> queryResults, DBIDs... ids)
queryResults
- the list of query resultsids
- the list of idsprivate void recomputeLOFs(DBIDs ids, FlexibleLOF.LOFResult<O> lofResult)
ids
- the ids of the lofs to be recomputedlofResult
- the result of the former LOF runCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.