Interface RandomAccessVectorValues<T>

All Known Implementing Classes:
ListRandomAccessVectorValues

public interface RandomAccessVectorValues<T>
Provides random access to vectors by dense ordinal. This interface is used by graph-based implementations of KNN search.
  • Method Details

    • size

      int size()
      Return the number of vector values.

      All copies of a given RAVV should have the same size. Typically this is achieved by either (1) implementing a threadsafe, un-shared RAVV, where `copy` returns `this`, or (2) implementing a fixed-size RAVV.

    • dimension

      int dimension()
      Return the dimension of the returned vector values
    • vectorValue

      T vectorValue(int targetOrd)
      Return the vector value indexed at the given ordinal.

      For performance, implementations are free to re-use the same object across invocations. That is, you will get back the same float[] reference (for instance) for every requested ordinal. If you want to use those values across calls, you should make a copy.

      Parameters:
      targetOrd - a valid ordinal, ≥ 0 and < size().
    • isValueShared

      boolean isValueShared()
      Returns:
      true iff the vector returned is shared. A shared vector will only be valid until the next call to vectorValue overwrites it.
    • copy

      Creates a new copy of this RandomAccessVectorValues. This is helpful when you need to access different values at once, to avoid overwriting the underlying float vector returned by a shared vectorValue(int).

      Un-shared implementations may simply return `this`.