|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.util.MinkowskiMetric
public class MinkowskiMetric
The Minkowski Metric is a generic measure of distance. It is defined in:
Article{ 331504, author = "A. K. Jain and M. N. Murty and P. J. Flynn", title = "Data Clustering: A Review", journal = "ACM Computing Surveys", volume = "31", number = "3", year = "1999", issn = "0360-0300", pages = "264--323", doi = "http://0-doi.acm.org.innopac.up.ac.za:80/10.1145/331499.331504", publisher = "ACM Press", address = "New York, NY, USA" }
Manhattan Distance
is a special case of the Minkowski Metric with 'alpha' := 1.
Euclidean Distance
is a special case of the Minkowski Metric with 'alpha' := 2.
NOTE: The default 'alpha' value is 0 when this class is instantiated.
Field Summary | |
---|---|
protected int |
alpha
|
Constructor Summary | |
---|---|
MinkowskiMetric()
Instantiate the Minkowski Metric with 'alpha' value equal to zero. |
|
MinkowskiMetric(int a)
Instantiate the Minkowski Metric with the specified 'alpha' value. |
Method Summary | ||
---|---|---|
|
distance(T x,
T y)
Calculate the distance between two vectors represented by Java Collection objects. |
|
|
distance(U x,
U y)
Calculate the distance between two vectors. |
|
void |
setAlpha(int a)
Set the 'alpha' value that will be used in the calculation of the Minkowski Metric. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int alpha
Constructor Detail |
---|
public MinkowskiMetric()
public MinkowskiMetric(int a)
a
- the value to which 'alpha' should be setMethod Detail |
---|
public <T extends Type,U extends StructuredType<T>> double distance(U x, U y)
distance
in interface DistanceMeasure
x
- the one vector.y
- the other vector.
IllegalArgumentException
- when the two vectors' dimension differ.public <T extends Collection<? extends Number>> double distance(T x, T y)
distance
in interface DistanceMeasure
T
- The Collection type.x
- the one Java Collection object.y
- the other Java Collection object.
IllegalArgumentException
- when the two vectors' dimension differ.public void setAlpha(int a)
a
- the new 'alpha' value
IllegalArgumentException
- when the given parameter is less than one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |