Class PVectorByteBufferedFloating4s64<T>
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.PVectorByteBufferedFloating4s64<T>
- Type Parameters:
T- A phantom type parameter
- All Implemented Interfaces:
PVectorReadable2DType<T>, PVectorReadable3DType<T>, PVectorReadable4DType<T>, VectorReadable2DType, VectorReadable3DType, VectorReadable4DType, PVectorStorageFloating2Type<T>, PVectorStorageFloating3Type<T>, PVectorStorageFloating4Type<T>, VectorStorageFloating2Type, VectorStorageFloating3Type, VectorStorageFloating4Type, VectorStorageType, PVectorByteBufferedFloating4Type<T>, TensorByteBufferedType, VectorByteBufferedType
public final class PVectorByteBufferedFloating4s64<T>
extends Object
implements PVectorByteBufferedFloating4Type<T>
A storage vector.
Storage component type: double
Storage component count: 4
-
Method Summary
Modifier and TypeMethodDescriptionfinal ByteBufferfinal longprotected final intbyteOffsetForIndex(int component_index) protected final intprotected intstatic <T> PVectorByteBufferedFloating4s64<T> createWithBase(ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset) Return a new vector that is backed by the given byte bufferbfinal intoffset()voidsetW(double w) Set thewcomponent.voidsetX(double x) Set thexcomponent.voidsetY(double y) Set theYcomponent.voidsetZ(double z) Set thezcomponent.final intdoublew()doublex()doubley()doublez()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PVectorStorageFloating2Type
setPVector2D, setPVector2FMethods inherited from interface PVectorStorageFloating3Type
setPVector3D, setPVector3FMethods inherited from interface PVectorStorageFloating4Type
setPVector4D, setPVector4FMethods inherited from interface TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytesMethods inherited from interface VectorStorageFloating2Type
setVector2D, setVector2F, setXYMethods inherited from interface VectorStorageFloating3Type
setVector3D, setVector3F, setXYZMethods inherited from interface VectorStorageFloating4Type
setVector4D, setVector4F, setXYZW
-
Method Details
-
createWithBase
public static <T> PVectorByteBufferedFloating4s64<T> createWithBase(ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset) Return a new vector that is backed by the given byte buffer
bThe 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.
- Type Parameters:
T- A phantom type parameter- 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:
xin interfaceVectorReadable2DType- Returns:
- The
xcomponent
-
y
public double y()- Specified by:
yin interfaceVectorReadable2DType- Returns:
- The
ycomponent
-
z
public double z()- Specified by:
zin interfaceVectorReadable3DType- Returns:
- The
zcomponent
-
w
public double w()- Specified by:
win interfaceVectorReadable4DType- Returns:
- The
wcomponent
-
setX
public void setX(double x) Description copied from interface:VectorStorageFloating2TypeSet thexcomponent.- Specified by:
setXin interfaceVectorStorageFloating2Type- Parameters:
x- The X component
-
setY
public void setY(double y) Description copied from interface:VectorStorageFloating2TypeSet theYcomponent.- Specified by:
setYin interfaceVectorStorageFloating2Type- Parameters:
y- The Y component
-
setZ
public void setZ(double z) Description copied from interface:VectorStorageFloating3TypeSet thezcomponent.- Specified by:
setZin interfaceVectorStorageFloating3Type- Parameters:
z- The Z component
-
setW
public void setW(double w) Description copied from interface:VectorStorageFloating4TypeSet thewcomponent.- Specified by:
setWin interfaceVectorStorageFloating4Type- Parameters:
w- The W component
-
componentBytes
protected final int componentBytes() -
byteBuffer
- Specified by:
byteBufferin interfaceTensorByteBufferedType- Returns:
- The byte buffer that backs the tensor
-
byteOffset
public final long byteOffset()- Specified by:
byteOffsetin interfaceTensorByteBufferedType- Returns:
- The byte offset of the current tensor
-
offset
public final int offset()- Specified by:
offsetin interfaceTensorByteBufferedType- Returns:
- A constant offset added to
TensorByteBufferedType.byteOffset().
-
sizeBytes
public final int sizeBytes()- Specified by:
sizeBytesin interfaceTensorByteBufferedType- Returns:
- The size of a single tensor in bytes
-
byteOffsetForIndex
protected final int byteOffsetForIndex(int component_index)
-