java.lang.Object
uk.ac.manchester.tornado.api.types.collections.VectorHalf8
- All Implemented Interfaces:
Serializable,TornadoCollectionInterface<ShortBuffer>,PrimitiveStorage<ShortBuffer>
VectorHalf8 relies on preview features of the Java platform:
VectorHalf8refers 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
ConstructorsModifierConstructorDescriptionVectorHalf8(int numElements) Creates an empty vector.protectedVectorHalf8(int numElements, HalfFloatArray array) -
Method Summary
Modifier and TypeMethodDescriptionasBuffer()voidclear()Duplicates this vector.voidget(int index) Returns theHalf8at the given index of this vector.getArray()intlonglongvoidloadFromBuffer(ShortBuffer buffer) voidSets theHalf8at the given index of this vector.voidset(HalfFloatArray values) Sets the elements of this vector to that of the provided array.voidset(VectorHalf8 values) Sets the elements of this vector to that of the provided vector.intsize()sum()toString()int
-
Field Details
-
TYPE
-
-
Constructor Details
-
VectorHalf8
-
VectorHalf8
public VectorHalf8(int numElements) Creates an empty vector.- Parameters:
numElements-
-
-
Method Details
-
vectorWidth
public int vectorWidth() -
get
Returns theHalf8at the given index of this vector.- Parameters:
index-- Returns:
- value
-
set
Sets theHalf8at 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>
-
VectorHalf8when preview features are enabled.