java.lang.Object
uk.ac.manchester.tornado.api.types.collections.VectorHalf2
- All Implemented Interfaces:
Serializable,TornadoCollectionInterface<ShortBuffer>,PrimitiveStorage<ShortBuffer>
VectorHalf2 relies on preview features of the Java platform:
VectorHalf2refers to one or more preview APIs:MemorySegment.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionVectorHalf2(int numElements) Creates an empty vector.protectedVectorHalf2(int numElements, HalfFloatArray array) -
Method Summary
Modifier and TypeMethodDescriptionasBuffer()voidclear()Duplicates this vector.voidget(int index) Returns theHalf2at the given index of this vector.getArray()intlonglongvoidloadFromBuffer(ShortBuffer buffer) voidSets theHalf2values at the given index of this vector.voidset(HalfFloatArray values) Sets the elements of this vector to that of the provided array.voidset(VectorHalf2 values) Sets the elements of this vector to that of the provided vector.intsize()sum()toString()int
-
Field Details
-
TYPE
-
-
Constructor Details
-
VectorHalf2
-
VectorHalf2
public VectorHalf2(int numElements) Creates an empty vector.- Parameters:
numElements-
-
-
Method Details
-
vectorWidth
public int vectorWidth() -
get
Returns theHalf2at the given index of this vector.- Parameters:
index-- Returns:
- value
-
set
Sets theHalf2values at the given index of this vector.- Parameters:
index-value-
-
set
Sets the elements of this vector to that of the provided vector.- Parameters:
values-
-
set
Sets the elements of this vector to that of the provided array.- Parameters:
values-
-
fill
-
duplicate
Duplicates this vector.- Returns:
- vector
-
toString
-
sum
-
loadFromBuffer
- Specified by:
loadFromBufferin interfacePrimitiveStorage<ShortBuffer>
-
asBuffer
- Specified by:
asBufferin interfacePrimitiveStorage<ShortBuffer>
-
size
public int size()- Specified by:
sizein interfacePrimitiveStorage<ShortBuffer>
-
getLength
public int getLength() -
getArray
-
clear
public void clear() -
getNumBytes
public long getNumBytes()- Specified by:
getNumBytesin interfaceTornadoCollectionInterface<ShortBuffer>
-
getNumBytesWithHeader
public long getNumBytesWithHeader()- Specified by:
getNumBytesWithHeaderin interfaceTornadoCollectionInterface<ShortBuffer>
-
getSegment
- Specified by:
getSegmentin interfaceTornadoCollectionInterface<ShortBuffer>
-
getSegmentWithHeader
- Specified by:
getSegmentWithHeaderin interfaceTornadoCollectionInterface<ShortBuffer>
-
VectorHalf2when preview features are enabled.