Class Point

java.lang.Object
org.ojalgo.data.cluster.Point
All Implemented Interfaces:
Comparable<Point>

public final class Point extends Object implements 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.
  • Field Details

    • coordinates

      public final float[] coordinates
      Features
    • id

      public final int id
      Index/Key
  • Constructor Details

    • Point

      Point(int id, float[] coordinates)
  • Method Details

    • mean

      public static double[] mean(Collection<Point> points)
    • newFactory

      public static Point.Factory newFactory()
    • of

      public static Point of(int id, float... coordinates)
      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

      public int compareTo(Point ref)
      Specified by:
      compareTo in interface Comparable<Point>
    • distance

      public double distance(DistanceMeasure measure, Point other)
      Distance using the supplied DistanceMeasure.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object