de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkcop
Class ApproximationLine

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkcop.ApproximationLine
All Implemented Interfaces:
Externalizable, Serializable

public class ApproximationLine
extends Object
implements Externalizable

Provides an approximation for knn-distances line consisting of incline m, axes intercept t and a start value for k.

See Also:
Serialized Form

Field Summary
private  int k_0
          The start value for k.
private  double m
          The incline.
private static long serialVersionUID
           
private  double t
          The axes intercept.
 
Constructor Summary
ApproximationLine()
          Empty constructor for serialization purposes.
ApproximationLine(int k_0, double m, double t)
          Provides an approximation for knn-distances line consisting of incline m, axes intercept t and a start value for k.
 
Method Summary
 boolean equals(Object o)
          Returns true if this object is the same as the o argument; false otherwise.
<O,D extends NumberDistance<D,?>>
D
getApproximatedKnnDistance(int k, DistanceQuery<O,D> distanceFunction)
          Returns the approximated knn-distance at the specified k.
 int getK_0()
          Returns the start value for k.
 double getM()
          Returns the incline.
 double getT()
          Returns the axes intercept.
 double getValueAt(int k)
          Returns the function value of the approximation line at the specified k.
 int hashCode()
          Returns a hash code value for this object
 void readExternal(ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
 String toString()
          Returns a string representation of the object.
 void writeExternal(ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

m

private double m
The incline.


t

private double t
The axes intercept.


k_0

private int k_0
The start value for k.

Constructor Detail

ApproximationLine

public ApproximationLine()
Empty constructor for serialization purposes.


ApproximationLine

public ApproximationLine(int k_0,
                         double m,
                         double t)
Provides an approximation for knn-distances line consisting of incline m, axes intercept t and a start value for k.

Parameters:
k_0 - the start value for k
m - the incline
t - the axes intercept
Method Detail

getM

public double getM()
Returns the incline.

Returns:
the incline

getT

public double getT()
Returns the axes intercept.

Returns:
the axes intercept

getK_0

public int getK_0()
Returns the start value for k.

Returns:
the start value for k

getValueAt

public double getValueAt(int k)
Returns the function value of the approximation line at the specified k.

Parameters:
k - the value for which the function value of the approximation line should be returned
Returns:
the function value of the approximation line at the specified k

getApproximatedKnnDistance

public <O,D extends NumberDistance<D,?>> D getApproximatedKnnDistance(int k,
                                                                      DistanceQuery<O,D> distanceFunction)
Returns the approximated knn-distance at the specified k.

Type Parameters:
O - Object type
D - Distance type
Parameters:
k - the value for which the knn-distance should be returned
distanceFunction - the distance function
Returns:
the approximated knn-distance at the specified k

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - the stream to write the object to
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException

equals

public boolean equals(Object o)
Returns true if this object is the same as the o argument; false otherwise.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for this object

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.

Release 0.4.0 (2011-09-20_1324)