Class StorageTransform
java.lang.Object
com.apple.foundationdb.async.common.StorageTransform
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionStorageTransform(LinearOperator linearOperator, RealVector translationVector, boolean normalizeVectors) -
Method Summary
Modifier and TypeMethodDescriptionapply(RealVector vector) Apply this operator to the vector passed in.intReturns the numbers of dimensions a vector must have to be able to be applied or apply-inverted.static StorageTransformidentity()invertedApply(RealVector vector) Apply the inverted operator to the vector passed in.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.apple.foundationdb.linear.VectorOperator
transform, untransform
-
Constructor Details
-
StorageTransform
public StorageTransform(@Nullable LinearOperator linearOperator, @Nullable RealVector translationVector, boolean normalizeVectors)
-
-
Method Details
-
getNumDimensions
public int getNumDimensions()Description copied from interface:VectorOperatorReturns the numbers of dimensions a vector must have to be able to be applied or apply-inverted.- Specified by:
getNumDimensionsin interfaceVectorOperator- Returns:
- the numbers of dimensions this vector operator supports; can be
-1if any number of dimensions is supported.
-
apply
Description copied from interface:VectorOperatorApply this operator to the vector passed in.- Specified by:
applyin interfaceVectorOperator- Parameters:
vector- the vector- Returns:
- a new vector
-
invertedApply
Description copied from interface:VectorOperatorApply the inverted operator to the vector passed in.applyInverted(apply(v)) == vshould hold.- Specified by:
invertedApplyin interfaceVectorOperator- Parameters:
vector- the vector- Returns:
- a new vector
-
identity
-