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