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