Module org.elasticsearch.simdvec
Class PanamaESVectorUtilSupport
java.lang.Object
org.elasticsearch.simdvec.internal.vectorization.PanamaESVectorUtilSupport
- All Implemented Interfaces:
ESVectorUtilSupport
- Direct Known Subclasses:
Native22ESVectorUtilSupport
public sealed class PanamaESVectorUtilSupport
extends Object
implements ESVectorUtilSupport
permits Native22ESVectorUtilSupport
-
Field Summary
Fields inherited from interface org.elasticsearch.simdvec.internal.vectorization.ESVectorUtilSupport
B_QUERY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbFloat16ToFloat(byte[] bfloats, int bfloatOffset, float[] floats, int floatOffset, int count, ByteOrder byteOrder) Converts bfloat16s to floatsvoidcalculateOSQGridPoints(float[] target, int[] quantize, int points, float[] pts) floatcalculateOSQLoss(float[] target, float lowerInterval, float upperInterval, float step, float invStep, float norm2, float lambda, int[] quantize) voidcenterAndCalculateOSQStatsDp(byte[] vector, byte[] centroid, float[] centered, float[] stats) voidcenterAndCalculateOSQStatsDp(float[] vector, float[] centroid, float[] centered, float[] stats) voidcenterAndCalculateOSQStatsEuclidean(byte[] vector, byte[] centroid, float[] centered, float[] stats) voidcenterAndCalculateOSQStatsEuclidean(float[] vector, float[] centroid, float[] centered, float[] stats) intcodePointCount(org.apache.lucene.util.BytesRef bytesRef) booleancontains(byte[] value, int valueOffset, int valueLength, byte[] term, int termOffset, int termLength) floatcosine(byte[] a, byte[] b) Calculates the cosine of the given byte arrays.voidcosineBulk(byte[] query, byte[] v0, byte[] v1, byte[] v2, byte[] v3, int distancesOffset, float[] distances) floatdotProduct(byte[] a, byte[] b) Calculates the dot product of the given byte arrays.floatdotProduct(byte[] a, byte[] b, int offset, int length) Calculates the dot product over[offset, offset + length).floatdotProduct(float[] a, float[] b) Calculates the dot product of the given float arrays.floatdotProduct(float[] a, float[] b, int offset, int length) Calculates the dot product over[offset, offset + length).voiddotProductBulk(byte[] query, byte[] v0, byte[] v1, byte[] v2, byte[] v3, int distancesOffset, float[] distances) voiddotProductBulk(float[] query, float[] v0, float[] v1, float[] v2, float[] v3, int distancesOffset, float[] distances) voidfloatToBFloat16(float[] floats, int floatOffset, byte[] bfloats, int bfloatOffset, int count, ByteOrder byteOrder) Converts floats to bfloat16sintindexOf(byte[] bytes, int offset, int length, byte marker) voidinRangeBitmask(long[] values, long lowerValue, long upperValue, long[] matches) longipByteBinByte(byte[] q, byte[] d) Compute dot product betweenqanddintipByteBit(byte[] q, byte[] d) floatipFloatBit(float[] q, byte[] d) floatipFloatByte(float[] q, byte[] d) voidl2Normalize(byte[] v, int offset, int length) L2-normalizesv[offset:offset + length)in place using signed byte values as real components.voidl2Normalize(float[] v, int offset, int length) L2-normalizesv[offset:offset + length)in place.voidlinearCombination(float scaleOther, byte[] other, float[] dest) voidlinearCombination(float scaleOther, byte[] other, float scaleDest, float[] dest) voidlinearCombination(float scaleOther, float[] other, float[] dest) voidlinearCombination(float scaleOther, float[] other, float scaleDest, float[] dest) floatlogSumExpNQT(float[] vector) floatlogSumExpNQTDiff(float[] v1, float[] v2, float eps) floatmaxSimDotProduct(MultiBFloat16VectorsSource source, float[][] query, float[] scoresScratch) floatmaxSimDotProduct(MultiByteVectorsSource source, byte[][] query, float[] scoresScratch) floatmaxSimDotProduct(MultiFloatVectorsSource source, float[][] query, float[] scoresScratch) voidpackAsBinary(int[] vector, byte[] packed) voidpackDibit(int[] vector, byte[] packed) voidpackDibitQuad(int[] vector, byte[] packed) voidpow2DiffAndScaleNQT(float[] v1, float[] v2, float a, float eps, float[] result) intquantizeVectorWithIntervals(float[] vector, int[] destination, float lowInterval, float upperInterval, byte bits) floatsoarDistance(byte[] v1, byte[] centroid, float[] originalResidual, float soarLambda, float rnorm) floatsoarDistance(float[] v1, float[] centroid, float[] originalResidual, float soarLambda, float rnorm) voidsoarDistanceBulk(byte[] v1, byte[] c0, byte[] c1, byte[] c2, byte[] c3, float[] originalResidual, float soarLambda, float rnorm, float[] distances) voidsoarDistanceBulk(float[] v1, float[] c0, float[] c1, float[] c2, float[] c3, float[] originalResidual, float soarLambda, float rnorm, float[] distances) floatsquareDistance(byte[] a, byte[] b) Returns the sum of squared differences of the two vectors.floatsquareDistance(byte[] a, byte[] b, int offset, int length) Returns the sum of squared differences of the two byte vectors over a sub-range.floatsquareDistance(float[] a, float[] b) Returns the sum of squared differences of the two vectors.floatsquareDistance(float[] a, float[] b, int offset, int length) Returns the sum of squared differences over[offset, offset + length).voidsquareDistanceBulk(byte[] query, int vectorOffset, byte[] v0, byte[] v1, byte[] v2, byte[] v3, int distancesOffset, float[] distances, int length) voidsquareDistanceBulk(float[] query, int vectorOffset, float[] v0, float[] v1, float[] v2, float[] v3, int distancesOffset, float[] distances, int length) voidtransposeHalfByte(int[] q, byte[] quantQueryByte)
-
Constructor Details
-
PanamaESVectorUtilSupport
public PanamaESVectorUtilSupport()
-
-
Method Details
-
floatToBFloat16
public void floatToBFloat16(float[] floats, int floatOffset, byte[] bfloats, int bfloatOffset, int count, ByteOrder byteOrder) Description copied from interface:ESVectorUtilSupportConverts floats to bfloat16s- Specified by:
floatToBFloat16in interfaceESVectorUtilSupport
-
bFloat16ToFloat
public void bFloat16ToFloat(byte[] bfloats, int bfloatOffset, float[] floats, int floatOffset, int count, ByteOrder byteOrder) Description copied from interface:ESVectorUtilSupportConverts bfloat16s to floats- Specified by:
bFloat16ToFloatin interfaceESVectorUtilSupport
-
dotProduct
public float dotProduct(float[] a, float[] b) Description copied from interface:ESVectorUtilSupportCalculates the dot product of the given float arrays.- Specified by:
dotProductin interfaceESVectorUtilSupport
-
dotProduct
public float dotProduct(float[] a, float[] b, int offset, int length) Description copied from interface:ESVectorUtilSupportCalculates the dot product over[offset, offset + length).- Specified by:
dotProductin interfaceESVectorUtilSupport
-
l2Normalize
public void l2Normalize(float[] v, int offset, int length) Description copied from interface:ESVectorUtilSupportL2-normalizesv[offset:offset + length)in place. A zero prefix is a no-op.- Specified by:
l2Normalizein interfaceESVectorUtilSupport
-
squareDistance
public float squareDistance(float[] a, float[] b) Description copied from interface:ESVectorUtilSupportReturns the sum of squared differences of the two vectors.- Specified by:
squareDistancein interfaceESVectorUtilSupport
-
squareDistance
public float squareDistance(float[] a, float[] b, int offset, int length) Description copied from interface:ESVectorUtilSupportReturns the sum of squared differences over[offset, offset + length).- Specified by:
squareDistancein interfaceESVectorUtilSupport
-
cosine
public float cosine(byte[] a, byte[] b) Description copied from interface:ESVectorUtilSupportCalculates the cosine of the given byte arrays.- Specified by:
cosinein interfaceESVectorUtilSupport
-
dotProduct
public float dotProduct(byte[] a, byte[] b) Description copied from interface:ESVectorUtilSupportCalculates the dot product of the given byte arrays.- Specified by:
dotProductin interfaceESVectorUtilSupport
-
dotProduct
public float dotProduct(byte[] a, byte[] b, int offset, int length) Description copied from interface:ESVectorUtilSupportCalculates the dot product over[offset, offset + length).- Specified by:
dotProductin interfaceESVectorUtilSupport
-
l2Normalize
public void l2Normalize(byte[] v, int offset, int length) Description copied from interface:ESVectorUtilSupportL2-normalizesv[offset:offset + length)in place using signed byte values as real components.- Specified by:
l2Normalizein interfaceESVectorUtilSupport
-
squareDistance
public float squareDistance(byte[] a, byte[] b) Description copied from interface:ESVectorUtilSupportReturns the sum of squared differences of the two vectors.- Specified by:
squareDistancein interfaceESVectorUtilSupport
-
squareDistance
public float squareDistance(byte[] a, byte[] b, int offset, int length) Description copied from interface:ESVectorUtilSupportReturns the sum of squared differences of the two byte vectors over a sub-range.- Specified by:
squareDistancein interfaceESVectorUtilSupport
-
maxSimDotProduct
public float maxSimDotProduct(MultiFloatVectorsSource source, float[][] query, float[] scoresScratch) - Specified by:
maxSimDotProductin interfaceESVectorUtilSupport
-
maxSimDotProduct
public float maxSimDotProduct(MultiBFloat16VectorsSource source, float[][] query, float[] scoresScratch) - Specified by:
maxSimDotProductin interfaceESVectorUtilSupport
-
maxSimDotProduct
- Specified by:
maxSimDotProductin interfaceESVectorUtilSupport
-
ipByteBinByte
public long ipByteBinByte(byte[] q, byte[] d) Description copied from interface:ESVectorUtilSupportCompute dot product betweenqandd- Specified by:
ipByteBinBytein interfaceESVectorUtilSupport- Parameters:
q- query vector,ESVectorUtilSupport.B_QUERY-bit quantized and striped (seeESVectorUtil.transposeHalfByte)d- data vector, 1-bit quantized
-
ipByteBit
public int ipByteBit(byte[] q, byte[] d) - Specified by:
ipByteBitin interfaceESVectorUtilSupport
-
ipFloatBit
public float ipFloatBit(float[] q, byte[] d) - Specified by:
ipFloatBitin interfaceESVectorUtilSupport
-
ipFloatByte
public float ipFloatByte(float[] q, byte[] d) - Specified by:
ipFloatBytein interfaceESVectorUtilSupport
-
centerAndCalculateOSQStatsEuclidean
public void centerAndCalculateOSQStatsEuclidean(float[] vector, float[] centroid, float[] centered, float[] stats) - Specified by:
centerAndCalculateOSQStatsEuclideanin interfaceESVectorUtilSupport
-
centerAndCalculateOSQStatsDp
public void centerAndCalculateOSQStatsDp(float[] vector, float[] centroid, float[] centered, float[] stats) - Specified by:
centerAndCalculateOSQStatsDpin interfaceESVectorUtilSupport
-
centerAndCalculateOSQStatsEuclidean
public void centerAndCalculateOSQStatsEuclidean(byte[] vector, byte[] centroid, float[] centered, float[] stats) - Specified by:
centerAndCalculateOSQStatsEuclideanin interfaceESVectorUtilSupport
-
centerAndCalculateOSQStatsDp
public void centerAndCalculateOSQStatsDp(byte[] vector, byte[] centroid, float[] centered, float[] stats) - Specified by:
centerAndCalculateOSQStatsDpin interfaceESVectorUtilSupport
-
calculateOSQGridPoints
public void calculateOSQGridPoints(float[] target, int[] quantize, int points, float[] pts) - Specified by:
calculateOSQGridPointsin interfaceESVectorUtilSupport
-
calculateOSQLoss
public float calculateOSQLoss(float[] target, float lowerInterval, float upperInterval, float step, float invStep, float norm2, float lambda, int[] quantize) - Specified by:
calculateOSQLossin interfaceESVectorUtilSupport
-
soarDistance
public float soarDistance(float[] v1, float[] centroid, float[] originalResidual, float soarLambda, float rnorm) - Specified by:
soarDistancein interfaceESVectorUtilSupport
-
soarDistance
public float soarDistance(byte[] v1, byte[] centroid, float[] originalResidual, float soarLambda, float rnorm) - Specified by:
soarDistancein interfaceESVectorUtilSupport
-
quantizeVectorWithIntervals
public int quantizeVectorWithIntervals(float[] vector, int[] destination, float lowInterval, float upperInterval, byte bits) - Specified by:
quantizeVectorWithIntervalsin interfaceESVectorUtilSupport
-
dotProductBulk
public void dotProductBulk(float[] query, float[] v0, float[] v1, float[] v2, float[] v3, int distancesOffset, float[] distances) - Specified by:
dotProductBulkin interfaceESVectorUtilSupport
-
squareDistanceBulk
public void squareDistanceBulk(float[] query, int vectorOffset, float[] v0, float[] v1, float[] v2, float[] v3, int distancesOffset, float[] distances, int length) - Specified by:
squareDistanceBulkin interfaceESVectorUtilSupport
-
dotProductBulk
public void dotProductBulk(byte[] query, byte[] v0, byte[] v1, byte[] v2, byte[] v3, int distancesOffset, float[] distances) - Specified by:
dotProductBulkin interfaceESVectorUtilSupport
-
cosineBulk
public void cosineBulk(byte[] query, byte[] v0, byte[] v1, byte[] v2, byte[] v3, int distancesOffset, float[] distances) - Specified by:
cosineBulkin interfaceESVectorUtilSupport
-
squareDistanceBulk
public void squareDistanceBulk(byte[] query, int vectorOffset, byte[] v0, byte[] v1, byte[] v2, byte[] v3, int distancesOffset, float[] distances, int length) - Specified by:
squareDistanceBulkin interfaceESVectorUtilSupport
-
soarDistanceBulk
public void soarDistanceBulk(float[] v1, float[] c0, float[] c1, float[] c2, float[] c3, float[] originalResidual, float soarLambda, float rnorm, float[] distances) - Specified by:
soarDistanceBulkin interfaceESVectorUtilSupport
-
soarDistanceBulk
public void soarDistanceBulk(byte[] v1, byte[] c0, byte[] c1, byte[] c2, byte[] c3, float[] originalResidual, float soarLambda, float rnorm, float[] distances) - Specified by:
soarDistanceBulkin interfaceESVectorUtilSupport
-
packAsBinary
public void packAsBinary(int[] vector, byte[] packed) - Specified by:
packAsBinaryin interfaceESVectorUtilSupport
-
packDibit
public void packDibit(int[] vector, byte[] packed) - Specified by:
packDibitin interfaceESVectorUtilSupport
-
packDibitQuad
public void packDibitQuad(int[] vector, byte[] packed) - Specified by:
packDibitQuadin interfaceESVectorUtilSupport
-
transposeHalfByte
public void transposeHalfByte(int[] q, byte[] quantQueryByte) - Specified by:
transposeHalfBytein interfaceESVectorUtilSupport
-
indexOf
public int indexOf(byte[] bytes, int offset, int length, byte marker) - Specified by:
indexOfin interfaceESVectorUtilSupport
-
contains
public boolean contains(byte[] value, int valueOffset, int valueLength, byte[] term, int termOffset, int termLength) - Specified by:
containsin interfaceESVectorUtilSupport
-
codePointCount
public int codePointCount(org.apache.lucene.util.BytesRef bytesRef) - Specified by:
codePointCountin interfaceESVectorUtilSupport
-
linearCombination
public void linearCombination(float scaleOther, float[] other, float scaleDest, float[] dest) - Specified by:
linearCombinationin interfaceESVectorUtilSupport
-
linearCombination
public void linearCombination(float scaleOther, float[] other, float[] dest) - Specified by:
linearCombinationin interfaceESVectorUtilSupport
-
linearCombination
public void linearCombination(float scaleOther, byte[] other, float scaleDest, float[] dest) - Specified by:
linearCombinationin interfaceESVectorUtilSupport
-
linearCombination
public void linearCombination(float scaleOther, byte[] other, float[] dest) - Specified by:
linearCombinationin interfaceESVectorUtilSupport
-
logSumExpNQT
public float logSumExpNQT(float[] vector) - Specified by:
logSumExpNQTin interfaceESVectorUtilSupport
-
logSumExpNQTDiff
public float logSumExpNQTDiff(float[] v1, float[] v2, float eps) - Specified by:
logSumExpNQTDiffin interfaceESVectorUtilSupport
-
pow2DiffAndScaleNQT
public void pow2DiffAndScaleNQT(float[] v1, float[] v2, float a, float eps, float[] result) - Specified by:
pow2DiffAndScaleNQTin interfaceESVectorUtilSupport
-
inRangeBitmask
public void inRangeBitmask(long[] values, long lowerValue, long upperValue, long[] matches) - Specified by:
inRangeBitmaskin interfaceESVectorUtilSupport
-