Module org.elasticsearch.server
Record Class NeighborHood
java.lang.Object
java.lang.Record
org.elasticsearch.index.codec.vectors.cluster.NeighborHood
-
Constructor Summary
ConstructorsConstructorDescriptionNeighborHood(int[] neighbors, float maxIntraDistance) Creates an instance of aNeighborHoodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic NeighborHood[]computeNeighborhoods(float[][] centers, int clustersPerNeighborhood) static NeighborHood[]computeNeighborhoodsBruteForce(float[][] centers, int clustersPerNeighborhood) static NeighborHood[]computeNeighborhoodsGraph(float[][] centers, int clustersPerNeighborhood) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of themaxIntraDistancerecord component.int[]Returns the value of theneighborsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NeighborHood
public NeighborHood(int[] neighbors, float maxIntraDistance) Creates an instance of aNeighborHoodrecord class.- Parameters:
neighbors- the value for theneighborsrecord componentmaxIntraDistance- the value for themaxIntraDistancerecord component
-
-
Method Details
-
computeNeighborhoods
public static NeighborHood[] computeNeighborhoods(float[][] centers, int clustersPerNeighborhood) throws IOException - Throws:
IOException
-
computeNeighborhoodsBruteForce
public static NeighborHood[] computeNeighborhoodsBruteForce(float[][] centers, int clustersPerNeighborhood) -
computeNeighborhoodsGraph
public static NeighborHood[] computeNeighborhoodsGraph(float[][] centers, int clustersPerNeighborhood) throws IOException - Throws:
IOException
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
neighbors
public int[] neighbors()Returns the value of theneighborsrecord component.- Returns:
- the value of the
neighborsrecord component
-
maxIntraDistance
public float maxIntraDistance()Returns the value of themaxIntraDistancerecord component.- Returns:
- the value of the
maxIntraDistancerecord component
-