Class StorageTransform

java.lang.Object
com.apple.foundationdb.async.common.StorageTransform
All Implemented Interfaces:
VectorOperator

public class StorageTransform extends Object implements VectorOperator
A special operator that is used to rotate, translate, and potentially normalize vectors. This operator is used inside the HNSW and GuardiANN packages to transform back and forth between the coordinate system of the client and the coordinate system that is currently employed in the structure.
  • Constructor Details

    • StorageTransform

      public StorageTransform(@Nullable LinearOperator linearOperator, @Nullable RealVector translationVector, boolean normalizeVectors)
  • Method Details

    • getNumDimensions

      public int getNumDimensions()
      Description copied from interface: VectorOperator
      Returns the numbers of dimensions a vector must have to be able to be applied or apply-inverted.
      Specified by:
      getNumDimensions in interface VectorOperator
      Returns:
      the numbers of dimensions this vector operator supports; can be -1 if any number of dimensions is supported.
    • apply

      @Nonnull public RealVector apply(@Nonnull RealVector vector)
      Description copied from interface: VectorOperator
      Apply this operator to the vector passed in.
      Specified by:
      apply in interface VectorOperator
      Parameters:
      vector - the vector
      Returns:
      a new vector
    • invertedApply

      @Nonnull public RealVector invertedApply(@Nonnull RealVector vector)
      Description copied from interface: VectorOperator
      Apply the inverted operator to the vector passed in. applyInverted(apply(v)) == v should hold.
      Specified by:
      invertedApply in interface VectorOperator
      Parameters:
      vector - the vector
      Returns:
      a new vector
    • identity

      @Nonnull public static StorageTransform identity()