protected void expandClusterOrder ( DBID ipt , ClusterOrder order , DistanceQuery < V > dq , FiniteProgress prog ) { UpdatableHeap < OPTICSHeapEntry > heap = new UpdatableHeap <> ( ) ; heap . add ( new OPTICSHeapEntry ( ipt , null , Double . POSITIVE_INFINITY ) ) ; while ( ! heap . isEmpty ( ) ) { final OPTICSHeapEntry current = heap . poll ( ) ; DBID currPt = current . objectID ; order . add ( currPt , current . reachability , current . predecessorID ) ; processed . add ( currPt ) ; double coredist = inverseDensities . doubleValue ( currPt ) ; for ( DBIDIter it = neighs . get ( currPt ) . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { if ( processed . contains ( it ) ) { continue ; } double nrdist = dq . distance ( currPt , it ) ; if ( coredist > nrdist ) { nrdist = coredist ; } if ( reachDist . doubleValue ( it ) == UNDEFINED_DISTANCE ) { reachDist . put ( it , nrdist ) ; } else if ( nrdist < reachDist . doubleValue ( it ) ) { reachDist . put ( it , nrdist ) ; } heap . add ( new OPTICSHeapEntry ( DBIDUtil . deref ( it ) , currPt , nrdist ) ) ; } LOG . incrementProcessed ( prog ) ; } }
OPTICS algorithm for processing a point but with different density estimates