Class ApproximationLine
- java.lang.Object
-
- elki.index.tree.metrical.mtreevariants.mktrees.mkcop.ApproximationLine
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class ApproximationLine extends java.lang.Object implements java.io.ExternalizableProvides an approximation for knn-distances line consisting of incline m, axes intercept t and a start value for k.- Since:
- 0.1
- Author:
- Elke Achtert
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intk_0The start value for k.private doublemThe incline.private static longserialVersionUIDprivate doubletThe axes intercept.
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Returns true if this object is the same as the o argument;falseotherwise.doublegetApproximatedKnnDistance(int k)Returns the approximated knn-distance at the specified k.intgetK_0()Returns the start value for k.doublegetM()Returns the incline.doublegetT()Returns the axes intercept.doublegetValueAt(int k)Returns the function value of the approximation line at the specified k.inthashCode()Returns a hash code value for this objectvoidreadExternal(java.io.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.java.lang.StringtoString()Returns a string representation of the object.voidwriteExternal(java.io.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.
-
-
-
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 km- the inclinet- 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 double getApproximatedKnnDistance(int k)
Returns the approximated knn-distance at the specified k.- Parameters:
k- the value for which the knn-distance should be returned- Returns:
- the approximated knn-distance at the specified k
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionThe 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:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- the stream to write the object to- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOExceptionThe 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:
readExternalin interfacejava.io.Externalizable- Parameters:
in- the stream to read data from in order to restore the object- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
Returns true if this object is the same as the o argument;falseotherwise.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
hashCode
public int hashCode()
Returns a hash code value for this object- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code value for this object.
-
toString
public java.lang.String toString()
Returns a string representation of the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object.
-
-