Module org.elasticsearch.simdvec
Class PanamaESVectorUtilSupport
java.lang.Object
org.elasticsearch.simdvec.internal.vectorization.PanamaESVectorUtilSupport
- All Implemented Interfaces:
ESVectorUtilSupport
-
Field Summary
Fields inherited from interface org.elasticsearch.simdvec.internal.vectorization.ESVectorUtilSupport
B_QUERY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateOSQGridPoints(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(float[] vector, float[] 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.floatdotProduct(byte[] a, byte[] b) Calculates the dot product of the given byte arrays.floatdotProduct(float[] a, float[] b) Calculates the dot product of the given float arrays.intindexOf(byte[] bytes, int offset, int length, byte marker) static longipByteBin128(byte[] q, byte[] d) longipByteBinByte(byte[] q, byte[] d) Compute dot product betweenqanddintipByteBit(byte[] q, byte[] d) floatipFloatBit(float[] q, byte[] d) floatipFloatByte(float[] q, byte[] d) static floatipFloatByteImpl(float[] q, byte[] d) voidpackAsBinary(int[] vector, byte[] packed) voidpackDibit(int[] vector, byte[] packed) intquantizeVectorWithIntervals(float[] vector, int[] destination, float lowInterval, float upperInterval, byte bits) floatsoarDistance(float[] v1, float[] centroid, float[] originalResidual, float soarLambda, float rnorm) 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(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(float[] query, float[] v0, float[] v1, float[] v2, float[] v3, float[] distances) voidsquareDistanceBulk(float[] query, int queryOffset, int length, float[] v0, float[] v1, float[] v2, float[] v3, float[] distances) voidtransposeHalfByte(int[] q, byte[] quantQueryByte)
-
Constructor Details
-
PanamaESVectorUtilSupport
public PanamaESVectorUtilSupport()
-
-
Method Details
-
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
-
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
-
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
-
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
-
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
-
ipByteBin128
public static long ipByteBin128(byte[] q, byte[] d) -
ipFloatByteImpl
public static float ipFloatByteImpl(float[] q, byte[] d) -
quantizeVectorWithIntervals
public int quantizeVectorWithIntervals(float[] vector, int[] destination, float lowInterval, float upperInterval, byte bits) - Specified by:
quantizeVectorWithIntervalsin interfaceESVectorUtilSupport
-
squareDistanceBulk
public void squareDistanceBulk(float[] query, float[] v0, float[] v1, float[] v2, float[] v3, float[] distances) - Specified by:
squareDistanceBulkin interfaceESVectorUtilSupport
-
squareDistanceBulk
public void squareDistanceBulk(float[] query, int queryOffset, int length, float[] v0, float[] v1, float[] v2, float[] v3, float[] distances) - 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
-
packAsBinary
public void packAsBinary(int[] vector, byte[] packed) - Specified by:
packAsBinaryin interfaceESVectorUtilSupport
-
packDibit
public void packDibit(int[] vector, byte[] packed) - Specified by:
packDibitin 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
-