|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simulator.math.QualityMeasure
org.simulator.math.N_Metric
public class N_Metric
An implementation of an n-metric. An n-metric is basically the n-th root of the sum of the distances of every single element in two vectors (arrays), where this distance will always be exponentiated by the value of n.
Field Summary | |
---|---|
protected double |
root
The n of the metric. |
Fields inherited from class org.simulator.math.QualityMeasure |
---|
defaultValue, meanFunction |
Constructor Summary | |
---|---|
N_Metric()
Constructs a new NMetric with a default root of two. |
|
N_Metric(double root)
Constructs a new NMetric with a costumized root. |
Method Summary | |
---|---|
double |
distance(Iterable<? extends Number> x,
Iterable<? extends Number> y,
double defaultValue)
Returns the distance of the two vectors x and y with the given root. |
double |
getRoot()
Returns the n of the metric. |
void |
setRoot(double root)
Sets the root. |
Methods inherited from class org.simulator.math.QualityMeasure |
---|
distance, distance, distance, getColumnDistances, getDefaultValue, getMeanFunction, setDefaultValue, setMeanFunction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double root
Constructor Detail |
---|
public N_Metric()
public N_Metric(double root)
root
- Method Detail |
---|
public double distance(Iterable<? extends Number> x, Iterable<? extends Number> y, double defaultValue)
QualityMeasure
Double.NaN
values are also ignored.
distance
in class QualityMeasure
x
- an arrayy
- another arraydefaultValue
- The value to be returned in cases in which no distance
computation is possible.
public double getRoot()
public void setRoot(double root)
root
-
|
Generated December 13 2012 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |