de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkcop
Class MkCoPLeafEntry<D extends NumberDistance<D,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
      extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeLeafEntry<D>
          extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkcop.MkCoPLeafEntry<D>
All Implemented Interfaces:
Entry, LeafEntry, MkCoPEntry<D>, MTreeEntry<D>, Externalizable, Serializable

 class MkCoPLeafEntry<D extends NumberDistance<D,?>>
extends MTreeLeafEntry<D>
implements MkCoPEntry<D>

Represents an entry in a leaf node of a MkCoP-Tree. Additionally to an MTreeLeafEntry an MkCoPLeafEntry holds the conservative and progressive approximation of its knn-distances.


Field Summary
private  ApproximationLine conservativeApproximation
          The conservative approximation.
private  ApproximationLine progressiveApproximation
          The progressive approximation.
private static long serialVersionUID
           
 
Constructor Summary
MkCoPLeafEntry()
          Empty constructor for serialization purposes.
MkCoPLeafEntry(DBID objectID, D parentDistance, ApproximationLine conservativeApproximation, ApproximationLine progressiveApproximation)
          Provides a new MkCoPLeafEntry with the given parameters.
 
Method Summary
<O> D
approximateConservativeKnnDistance(int k, DistanceQuery<O,D> distanceFunction)
          Returns the conservative approximated knn distance of the entry.
<O> D
approximateProgressiveKnnDistance(int k, DistanceQuery<O,D> distanceFunction)
          Returns the progressive approximated knn distance of the entry.
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 ApproximationLine getConservativeKnnDistanceApproximation()
          Returns the conservative approximation line.
 ApproximationLine getProgressiveKnnDistanceApproximation()
          Returns the progressive approximation line.
 void readExternal(ObjectInput in)
          Calls the super method and reads the the conservative and progressive approximation of the knn distances of this entry from the specified input stream.
 void setConservativeKnnDistanceApproximation(ApproximationLine conservativeApproximation)
          Sets the conservative approximation line
 void setProgressiveKnnDistanceApproximation(ApproximationLine progressiveApproximation)
          Sets the progressive approximation line
 String toString()
          Returns a string representation of this entry.
 void writeExternal(ObjectOutput out)
          Calls the super method and writes the conservative and progressive approximation of the knn distances of this entry to the specified stream.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeLeafEntry
getCoveringRadius, getParentDistance, getRoutingObjectID, setCoveringRadius, setParentDistance, setRoutingObjectID
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractLeafEntry
getDBID, hashCode, isLeafEntry
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeEntry
getCoveringRadius, getParentDistance, getRoutingObjectID, setCoveringRadius, setParentDistance, setRoutingObjectID
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Entry
isLeafEntry
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

conservativeApproximation

private ApproximationLine conservativeApproximation
The conservative approximation.


progressiveApproximation

private ApproximationLine progressiveApproximation
The progressive approximation.

Constructor Detail

MkCoPLeafEntry

public MkCoPLeafEntry()
Empty constructor for serialization purposes.


MkCoPLeafEntry

public MkCoPLeafEntry(DBID objectID,
                      D parentDistance,
                      ApproximationLine conservativeApproximation,
                      ApproximationLine progressiveApproximation)
Provides a new MkCoPLeafEntry with the given parameters.

Parameters:
objectID - the id of the underlying data object
parentDistance - the distance from the underlying data object to its parent's routing object
conservativeApproximation - the conservative approximation of the knn distances
progressiveApproximation - the progressive approximation of the knn distances
Method Detail

approximateConservativeKnnDistance

public <O> D approximateConservativeKnnDistance(int k,
                                                DistanceQuery<O,D> distanceFunction)
Returns the conservative approximated knn distance of the entry.

Specified by:
approximateConservativeKnnDistance in interface MkCoPEntry<D extends NumberDistance<D,?>>
Type Parameters:
O - Object type
Parameters:
k - the parameter k of the knn distance
distanceFunction - the distance function
Returns:
the conservative approximated knn distance of the entry

approximateProgressiveKnnDistance

public <O> D approximateProgressiveKnnDistance(int k,
                                               DistanceQuery<O,D> distanceFunction)
Returns the progressive approximated knn distance of the entry.

Type Parameters:
O - Object type
Parameters:
k - the parameter k of the knn distance
distanceFunction - the distance function
Returns:
the progressive approximated knn distance of the entry

getConservativeKnnDistanceApproximation

public ApproximationLine getConservativeKnnDistanceApproximation()
Returns the conservative approximation line.

Specified by:
getConservativeKnnDistanceApproximation in interface MkCoPEntry<D extends NumberDistance<D,?>>
Returns:
the conservative approximation line

getProgressiveKnnDistanceApproximation

public ApproximationLine getProgressiveKnnDistanceApproximation()
Returns the progressive approximation line.

Returns:
the progressive approximation line

setConservativeKnnDistanceApproximation

public void setConservativeKnnDistanceApproximation(ApproximationLine conservativeApproximation)
Sets the conservative approximation line

Specified by:
setConservativeKnnDistanceApproximation in interface MkCoPEntry<D extends NumberDistance<D,?>>
Parameters:
conservativeApproximation - the conservative approximation line to be set

setProgressiveKnnDistanceApproximation

public void setProgressiveKnnDistanceApproximation(ApproximationLine progressiveApproximation)
Sets the progressive approximation line

Parameters:
progressiveApproximation - the progressive approximation line to be set

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Calls the super method and writes the conservative and progressive approximation of the knn distances of this entry to the specified stream.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class MTreeLeafEntry<D extends NumberDistance<D,?>>
Parameters:
out - the stream to write the object to
Throws:
IOException - Includes any I/O exceptions that may occur

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Calls the super method and reads the the conservative and progressive approximation of the knn distances of this entry from the specified input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class MTreeLeafEntry<D extends NumberDistance<D,?>>
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being restored cannot be found.

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class MTreeLeafEntry<D extends NumberDistance<D,?>>
Parameters:
o - the object to be tested
Returns:
true, if the super method returns true and o is an MkCoPLeafEntry and has the same conservative and progressive approximation as this entry.

toString

public String toString()
Returns a string representation of this entry.

Overrides:
toString in class AbstractLeafEntry
Returns:
a string representation of this entry

Release 0.4.0 (2011-09-20_1324)