Class VectorByteBufferedFloating3s32
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.VectorByteBufferedFloating3s32
- All Implemented Interfaces:
VectorReadable2DType
,VectorReadable3DType
,VectorStorageFloating2Type
,VectorStorageFloating3Type
,VectorStorageType
,TensorByteBufferedType
,VectorByteBufferedFloating2Type
,VectorByteBufferedFloating3Type
,VectorByteBufferedType
public final class VectorByteBufferedFloating3s32 extends java.lang.Object implements VectorByteBufferedFloating3Type
A storage vector.
Storage component type: float
Storage component count: 3
-
Method Summary
Modifier and Type Method Description java.nio.ByteBuffer
byteBuffer()
long
byteOffset()
protected int
byteOffsetForIndex(int component_index)
protected int
componentBytes()
protected int
componentCount()
static VectorByteBufferedFloating3s32
createWithBase(java.nio.ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset)
Return a new vector that is backed by the given byte bufferb
int
offset()
void
setX(double x)
Set thex
component.void
setY(double y)
Set theY
component.void
setZ(double z)
Set thez
component.int
sizeBytes()
double
x()
double
y()
double
z()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.io7m.jtensors.storage.bytebuffered.TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytes
Methods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageFloating2Type
setVector2D, setVector2F, setXY
Methods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageFloating3Type
setVector3D, setVector3F, setXYZ
-
Method Details
-
createWithBase
public static VectorByteBufferedFloating3s32 createWithBase(java.nio.ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset)Return a new vector that is backed by the given byte buffer
b
The data for the instance will be taken from the data at the current value of
base.get() + offset
, each time a field is requested or set.No initialization of the data is performed.
- Parameters:
b
- The byte bufferbase
- The base addressoffset
- A constant offset- Returns:
- A new buffered vector
-
componentCount
protected int componentCount() -
x
public double x()- Specified by:
x
in interfaceVectorReadable2DType
- Returns:
- The
x
component
-
y
public double y()- Specified by:
y
in interfaceVectorReadable2DType
- Returns:
- The
y
component
-
z
public double z()- Specified by:
z
in interfaceVectorReadable3DType
- Returns:
- The
z
component
-
setX
public void setX(double x)Description copied from interface:VectorStorageFloating2Type
Set thex
component.- Specified by:
setX
in interfaceVectorStorageFloating2Type
- Parameters:
x
- The X component
-
setY
public void setY(double y)Description copied from interface:VectorStorageFloating2Type
Set theY
component.- Specified by:
setY
in interfaceVectorStorageFloating2Type
- Parameters:
y
- The Y component
-
setZ
public void setZ(double z)Description copied from interface:VectorStorageFloating3Type
Set thez
component.- Specified by:
setZ
in interfaceVectorStorageFloating3Type
- Parameters:
z
- The Z component
-
componentBytes
protected final int componentBytes() -
byteBuffer
public final java.nio.ByteBuffer byteBuffer()- Specified by:
byteBuffer
in interfaceTensorByteBufferedType
- Returns:
- The byte buffer that backs the tensor
-
byteOffset
public final long byteOffset()- Specified by:
byteOffset
in interfaceTensorByteBufferedType
- Returns:
- The byte offset of the current tensor
-
offset
public final int offset()- Specified by:
offset
in interfaceTensorByteBufferedType
- Returns:
- A constant offset added to
TensorByteBufferedType.byteOffset()
.
-
sizeBytes
public final int sizeBytes()- Specified by:
sizeBytes
in interfaceTensorByteBufferedType
- Returns:
- The size of a single tensor in bytes
-
byteOffsetForIndex
protected final int byteOffsetForIndex(int component_index)
-