org.apache.commons.math3.stat.clustering
public class EuclideanDoublePoint extends java.lang.Object implements Clusterable<EuclideanDoublePoint>, java.io.Serializable
Clusterable
for points with double coordinates.Modifier and Type | Field and Description |
---|---|
private double[] |
point
Point coordinates.
|
private static long |
serialVersionUID
Serializable version identifier.
|
Constructor and Description |
---|
EuclideanDoublePoint(double[] point)
Build an instance wrapping an integer array.
|
Modifier and Type | Method and Description |
---|---|
EuclideanDoublePoint |
centroidOf(java.util.Collection<EuclideanDoublePoint> points)
Returns the centroid of the given Collection of points.
|
double |
distanceFrom(EuclideanDoublePoint p)
Returns the distance from the given point.
|
boolean |
equals(java.lang.Object other) |
double[] |
getPoint()
Get the n-dimensional point in integer space.
|
int |
hashCode() |
java.lang.String |
toString() |
private static final long serialVersionUID
private final double[] point
public EuclideanDoublePoint(double[] point)
The wrapped array is referenced, it is not copied.
point
- the n-dimensional point in integer spacepublic EuclideanDoublePoint centroidOf(java.util.Collection<EuclideanDoublePoint> points)
centroidOf
in interface Clusterable<EuclideanDoublePoint>
points
- the Collection of points to compute the centroid ofpublic double distanceFrom(EuclideanDoublePoint p)
distanceFrom
in interface Clusterable<EuclideanDoublePoint>
p
- the point to compute the distance frompublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public double[] getPoint()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2003-2013 Apache Software Foundation