java.lang.Object
uk.ac.manchester.tornado.api.types.collections.VectorFloat2
- All Implemented Interfaces:
Serializable,TornadoCollectionInterface<FloatBuffer>,PrimitiveStorage<FloatBuffer>
VectorFloat2 relies on preview features of the Java platform:
VectorFloat2refers 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
Constructors -
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(VectorFloat2 values) Sets the elements of this vector to that of the provided vector.intsize()sum()toString()int
-
Field Details
-
TYPE
-
-
Constructor Details
-
VectorFloat2
public VectorFloat2(int numElements) Creates an empty vector.- Parameters:
numElements-
-
-
Method Details
-
vectorWidth
public int vectorWidth() -
get
Returns the float at the given index of this vector.- Parameters:
index-- Returns:
- value
-
set
Sets the float 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
public void fill(float value) -
duplicate
Duplicates this vector.- Returns:
- vector
-
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() -
getArray
-
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>
-
VectorFloat2when preview features are enabled.