java.lang.Object
uk.ac.manchester.tornado.api.types.collections.VectorFloat4
- All Implemented Interfaces:
Serializable,TornadoCollectionInterface<FloatBuffer>,PrimitiveStorage<FloatBuffer>
VectorFloat4 relies on preview features of the Java platform:
VectorFloat4refers 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
ConstructorsConstructorDescriptionVectorFloat4(int numElements) Creates an empty vector with.VectorFloat4(FloatArray array) Creates a vector using the provided backing array. -
Method Summary
Modifier and TypeMethodDescriptionasBuffer()voidclear()Duplicates this vector.voidfill(float value) get(int index) Returns the float at the given index of this vector.getArray()intlonglongvoidloadFromBuffer(FloatBuffer buffer) max()min()voidSets the float at the given index of this vector.voidset(FloatArray values) Sets the elements of this vector to that of the provided array.voidset(VectorFloat4 values) Sets the elements of this vector to that of the provided vector.intsize()sum()toString()int
-
Field Details
-
TYPE
-
-
Constructor Details
-
VectorFloat4
Creates a vector using the provided backing array. -
VectorFloat4
public VectorFloat4(int numElements) Creates an empty vector with.- Parameters:
numElements- Number of elements
-
-
Method Details
-
vectorWidth
public int vectorWidth() -
getArray
-
get
Returns the float at the given index of this vector.- Parameters:
index- Position- Returns:
- value
-
set
Sets the float at the given index of this vector.- Parameters:
index- positionvalue- value to be stored
-
set
Sets the elements of this vector to that of the provided vector.- Parameters:
values- set aVectorFloat4into the internal array
-
set
Sets the elements of this vector to that of the provided array.- Parameters:
values- set an input array into the internal array
-
fill
public void fill(float value) -
duplicate
Duplicates this vector.- Returns:
VectorFloat4
-
toString
-
sum
-
min
-
max
-
loadFromBuffer
- Specified by:
loadFromBufferin interfacePrimitiveStorage<FloatBuffer>
-
asBuffer
- Specified by:
asBufferin interfacePrimitiveStorage<FloatBuffer>
-
size
public int size()- Specified by:
sizein interfacePrimitiveStorage<FloatBuffer>
-
getLength
public int getLength() -
clear
public void clear() -
getNumBytes
public long getNumBytes()- Specified by:
getNumBytesin interfaceTornadoCollectionInterface<FloatBuffer>
-
getNumBytesWithHeader
public long getNumBytesWithHeader()- Specified by:
getNumBytesWithHeaderin interfaceTornadoCollectionInterface<FloatBuffer>
-
getSegment
- Specified by:
getSegmentin interfaceTornadoCollectionInterface<FloatBuffer>
-
getSegmentWithHeader
- Specified by:
getSegmentWithHeaderin interfaceTornadoCollectionInterface<FloatBuffer>
-
VectorFloat4when preview features are enabled.