at.tuwien.ifs.somtoolbox.layers.metrics
Class LnAlphaMetric
java.lang.Object
at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric
at.tuwien.ifs.somtoolbox.layers.metrics.LnAlphaMetric
- All Implemented Interfaces:
- DistanceMetric, Comparable<DistanceMetric>
public class LnAlphaMetric
- extends AbstractMetric
- implements DistanceMetric
- Version:
- $Id: LnAlphaMetric.java 3583 2010-05-21 10:07:41Z mayer $
- Author:
- Rudolf Mayer
Field Summary |
private double |
alpha
|
private double |
n
|
Method Summary |
double |
distance(double[] vector1,
double[] vector2)
Calculates the distance between two vectors provided by argument vector1 and vector2 . |
double |
distanceFromPrecalc(double[] vector1,
double[] vector2)
|
void |
setMetricParams(String metricParamString)
Sets specific parameters for the LnAlpha metric, namely alpha and n. |
int |
signum(double number)
|
String |
toString()
|
double |
transformValue(double value)
|
Methods inherited from class at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric |
checkDimensions, checkDimensions, compareTo, distance, distance, distance, distance, distance, distance, distance, distance, instantiate, instantiateNice, meanVector, performanceTest, transformVector |
alpha
private double alpha
n
private double n
LnAlphaMetric
public LnAlphaMetric(double alpha,
double n)
LnAlphaMetric
public LnAlphaMetric()
setMetricParams
public void setMetricParams(String metricParamString)
throws MetricException
- Sets specific parameters for the LnAlpha metric, namely alpha and n.
- Specified by:
setMetricParams
in interface DistanceMetric
- Overrides:
setMetricParams
in class AbstractMetric
- Throws:
MetricException
distance
public double distance(double[] vector1,
double[] vector2)
throws MetricException
- Description copied from interface:
DistanceMetric
- Calculates the distance between two vectors provided by argument
vector1
and vector2
. A
MetricException
is thrown, if the dimensionalities of the two vectors differ.
- Specified by:
distance
in interface DistanceMetric
- Specified by:
distance
in class AbstractMetric
- Parameters:
vector1
- first vector.vector2
- second vector.
- Returns:
- the distance between
vector1
and vector2
.
- Throws:
MetricException
- if the dimensionalities of the two vectors differ.- See Also:
DistanceMetric.distance(double[], double[])
distanceFromPrecalc
public double distanceFromPrecalc(double[] vector1,
double[] vector2)
throws MetricException
- Throws:
MetricException
transformValue
public double transformValue(double value)
- Specified by:
transformValue
in interface DistanceMetric
- Overrides:
transformValue
in class AbstractMetric
toString
public String toString()
- Overrides:
toString
in class Object
signum
public int signum(double number)