org.apache.commons.math3.stat.clustering
public class EuclideanDoublePoint extends Object implements Clusterable<EuclideanDoublePoint>, 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(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(Object other) |
double[] |
getPoint()
Get the n-dimensional point in integer space.
|
int |
hashCode() |
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(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 double[] getPoint()
Copyright (c) 2003-2013 Apache Software Foundation