Record Class CentroidAssignments

java.lang.Object
java.lang.Record
org.elasticsearch.index.codec.vectors.diskbbq.CentroidAssignments

public record CentroidAssignments(int numCentroids, float[][] centroids, int[] assignments, int[] overspillAssignments, float[] globalCentroid) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    CentroidAssignments(int dims, float[][] centroids, int[] assignments, int[] overspillAssignments)
     
    CentroidAssignments(int numCentroids, float[][] centroids, int[] assignments, int[] overspillAssignments, float[] globalCentroid)
    Creates an instance of a CentroidAssignments record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int[]
    Returns the value of the assignments record component.
    float[][]
    Returns the value of the centroids record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    float[]
    Returns the value of the globalCentroid record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the numCentroids record component.
    int[]
    Returns the value of the overspillAssignments record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CentroidAssignments

      public CentroidAssignments(int dims, float[][] centroids, int[] assignments, int[] overspillAssignments)
    • CentroidAssignments

      public CentroidAssignments(int numCentroids, float[][] centroids, int[] assignments, int[] overspillAssignments, float[] globalCentroid)
      Creates an instance of a CentroidAssignments record class.
      Parameters:
      numCentroids - the value for the numCentroids record component
      centroids - the value for the centroids record component
      assignments - the value for the assignments record component
      overspillAssignments - the value for the overspillAssignments record component
      globalCentroid - the value for the globalCentroid record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • numCentroids

      public int numCentroids()
      Returns the value of the numCentroids record component.
      Returns:
      the value of the numCentroids record component
    • centroids

      public float[][] centroids()
      Returns the value of the centroids record component.
      Returns:
      the value of the centroids record component
    • assignments

      public int[] assignments()
      Returns the value of the assignments record component.
      Returns:
      the value of the assignments record component
    • overspillAssignments

      public int[] overspillAssignments()
      Returns the value of the overspillAssignments record component.
      Returns:
      the value of the overspillAssignments record component
    • globalCentroid

      public float[] globalCentroid()
      Returns the value of the globalCentroid record component.
      Returns:
      the value of the globalCentroid record component