public class ApproximationLine extends Object implements Externalizable
Modifier and Type | Field and Description |
---|---|
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 and 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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Returns true if this object is the same as the o argument;
false otherwise. |
<O,D extends NumberDistance<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.
|
private static final long serialVersionUID
private double m
private double t
private int k_0
public ApproximationLine()
public ApproximationLine(int k_0, double m, double t)
k_0
- the start value for km
- the inclinet
- the axes interceptpublic double getM()
public double getT()
public int getK_0()
public double getValueAt(int k)
k
- the value for which the function value of the approximation line
should be returnedpublic <O,D extends NumberDistance<D,?>> D getApproximatedKnnDistance(int k, DistanceQuery<O,D> distanceFunction)
O
- Object typeD
- Distance typek
- the value for which the knn-distance should be returneddistanceFunction
- the distance functionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the stream to write the object toIOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
in
- the stream to read data from in order to restore the objectIOException
public boolean equals(Object o)
false
otherwise.public int hashCode()