Class Lucene90NeighborArray


  • public class Lucene90NeighborArray
    extends java.lang.Object
    NeighborArray encodes the neighbors of a node and their mutual scores in the HNSW graph as a pair of growable arrays.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int[] node  
      (package private) float[] score  
      private int size  
    • Constructor Summary

      Constructors 
      Constructor Description
      Lucene90NeighborArray​(int maxSize)
      Create a neighbour array with the given initial size
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int newNode, float newScore)
      Add a new node with a score
      void clear()
      Clear all the nodes in the array
      int[] node()
      Direct access to the internal list of node ids; provided for efficient writing of the graph
      void removeLast()
      Remove the last nodes from the array
      float[] score()
      Direct access to the internal list of scores
      int size()
      Get the size, the number of nodes added so far
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • size

        private int size
      • score

        float[] score
      • node

        int[] node
    • Constructor Detail

      • Lucene90NeighborArray

        public Lucene90NeighborArray​(int maxSize)
        Create a neighbour array with the given initial size
    • Method Detail

      • add

        public void add​(int newNode,
                        float newScore)
        Add a new node with a score
      • size

        public int size()
        Get the size, the number of nodes added so far
      • node

        public int[] node()
        Direct access to the internal list of node ids; provided for efficient writing of the graph
      • score

        public float[] score()
        Direct access to the internal list of scores
      • clear

        public void clear()
        Clear all the nodes in the array
      • removeLast

        public void removeLast()
        Remove the last nodes from the array
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object