Class Point
java.lang.Object
org.ojalgo.data.cluster.Point
- All Implemented Interfaces:
Comparable<Point>
Immutable coordinate point used by the clustering utilities. A
Point wraps a float[] (to
minimise memory footprint) and an id. Distance calculations are central to most algorithms.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSimple factory that generates consecutive ids and ensures consistent dimensionality. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoubledistance(DistanceMeasure measure, Point other) Distance using the suppliedDistanceMeasure.booleaninthashCode()static double[]mean(Collection<Point> points) static Point.Factorystatic Pointof(int id, float... coordinates) Creates a point with the supplied id and coordinates (no defensive copy).toString()
-
Field Details
-
coordinates
public final float[] coordinatesFeatures -
id
public final int idIndex/Key
-
-
Constructor Details
-
Point
Point(int id, float[] coordinates)
-
-
Method Details
-
mean
-
newFactory
-
of
Creates a point with the supplied id and coordinates (no defensive copy). Caller must ensure the coordinate array is not mutated afterwards if logical immutability is desired. -
compareTo
- Specified by:
compareToin interfaceComparable<Point>
-
distance
Distance using the suppliedDistanceMeasure. -
equals
-
hashCode
-
toString
-