- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,Closeable,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable,Vector
- All Known Implementing Classes:
ConstantNullVector,DoubleBigArrayVector
public sealed interface DoubleVector
extends Vector
permits DoubleBigArrayVector, ConstantNullVector (not exhaustive)
Vector that stores double values.
This class is generated. Edit
X-Vector.java.st instead.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder that grows as needed.static interfaceA builder that never grows. -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.compute.data.Vector
SERIALIZE_VECTOR_ARRAY, SERIALIZE_VECTOR_BIG_ARRAY, SERIALIZE_VECTOR_CONSTANT, SERIALIZE_VECTOR_ORDINAL, SERIALIZE_VECTOR_VALUES -
Method Summary
Modifier and TypeMethodDescriptionasBlock()Returns Returns a new Block containing this vector..booleanCompares the given object with this vector for equality.static booleanequals(DoubleVector vector1, DoubleVector vector2) Returnstrueif the given vectors are equal to each other, otherwisefalse.filter(int... positions) Creates a new vector that only exposes the positions provided.doublegetDouble(int position) static inthash(DoubleVector vector) Generates the hash code for the given vector.inthashCode()Returns the hash code of this vector, as defined byhash(DoubleVector).keepMask(BooleanVector mask) org.elasticsearch.core.ReleasableIterator<? extends DoubleBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Builds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector.static DoubleVectorreadFrom(BlockFactory blockFactory, StreamInput in) Deserializes a Vector from the given stream input.default voidwriteTo(StreamOutput out) Serializes this Vector to the given stream output.Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.core.Releasable
closeMethods inherited from interface org.elasticsearch.compute.data.Vector
allowPassingToDifferentDriver, blockFactory, elementType, getPositionCount, isConstant, isReleased
-
Method Details
-
getDouble
double getDouble(int position) -
asBlock
DoubleBlock asBlock()Description copied from interface:VectorReturns Returns a new Block containing this vector.. -
filter
Description copied from interface:VectorCreates a new vector that only exposes the positions provided. Materialization of the selected positions is avoided. -
keepMask
Description copied from interface:Vector -
lookup
org.elasticsearch.core.ReleasableIterator<? extends DoubleBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Description copied from interface:VectorBuilds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector. It has the same number ofpositionsas thepositionsparameter.For example, if this vector contained
[a, b, c]and were called with the block[0, 1, 1, [1, 2]]then the result would be[a, b, b, [b, c]].This process produces
count(positions)values per positions which could be quite large. Instead of returning a single Block, this returns an Iterator of Blocks containing all of the promised values.The returned
ReleasableIteratormay retain a reference to thepositionsparameter. Close it to release those references.This block is built using the same
BlockFactoryas was used to build thepositionsparameter. -
equals
Compares the given object with this vector for equality. Returnstrueif and only if the given object is a DoubleVector, and both vectors areequal. -
hashCode
int hashCode()Returns the hash code of this vector, as defined byhash(DoubleVector). -
equals
Returnstrueif the given vectors are equal to each other, otherwisefalse. Two vectors are considered equal if they have the same position count, and contain the same values in the same order. This definition ensures that the equals method works properly across different implementations of the DoubleVector interface. -
hash
Generates the hash code for the given vector. The hash code is computed from the vector's values. This ensures thatvector1.equals(vector2)implies thatvector1.hashCode()==vector2.hashCode()for any two vectors,vector1andvector2, as required by the general contract ofObject.hashCode(). -
readFrom
Deserializes a Vector from the given stream input.- Throws:
IOException
-
writeTo
Serializes this Vector to the given stream output.- Throws:
IOException
-