Class MatrixByteBuffered2x2s16
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.MatrixByteBuffered2x2s16
- All Implemented Interfaces:
MatrixReadable2x2DType,MatrixReadableDType,MatrixStorageType,MatrixStorage2x2Type,MatrixByteBuffered2x2Type,MatrixByteBufferedType,TensorByteBufferedType
public final class MatrixByteBuffered2x2s16 extends java.lang.Object implements MatrixByteBuffered2x2Type
A storage matrix.
Storage component type: binary16
Storage component count: 2x2
-
Method Summary
Modifier and Type Method Description java.nio.ByteBufferbyteBuffer()longbyteOffset()protected intbyteOffsetForIndex(int component_index)protected intcomponentBytes()protected intcomponentCount()static MatrixByteBuffered2x2s16createWithBase(java.nio.ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset)Return a new vector that is backed by the given byte bufferbintoffset()doubler0c0()doubler0c1()doubler1c0()doubler1c1()voidsetMatrix2x2D(Matrix2x2D m)Set the components from the given matrix.voidsetMatrix2x2F(Matrix2x2F m)Set the components from the given matrix.intsizeBytes()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.io7m.jtensors.core.unparameterized.matrices.MatrixReadable2x2DType
rowColumnMethods inherited from interface com.io7m.jtensors.storage.bytebuffered.TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytes
-
Method Details
-
createWithBase
public static MatrixByteBuffered2x2s16 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
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.
- Parameters:
b- The byte bufferbase- The base addressoffset- A constant offset- Returns:
- A new buffered vector
-
componentCount
protected int componentCount() -
r0c0
public double r0c0()- Specified by:
r0c0in interfaceMatrixReadable2x2DType- Returns:
- The value at row 0 column 0
-
r0c1
public double r0c1()- Specified by:
r0c1in interfaceMatrixReadable2x2DType- Returns:
- The value at row 0 column 1
-
r1c0
public double r1c0()- Specified by:
r1c0in interfaceMatrixReadable2x2DType- Returns:
- The value at row 1 column 0
-
r1c1
public double r1c1()- Specified by:
r1c1in interfaceMatrixReadable2x2DType- Returns:
- The value at row 1 column 1
-
setMatrix2x2D
Description copied from interface:MatrixStorage2x2TypeSet the components from the given matrix.- Specified by:
setMatrix2x2Din interfaceMatrixStorage2x2Type- Parameters:
m- The source matrix
-
setMatrix2x2F
Description copied from interface:MatrixStorage2x2TypeSet the components from the given matrix.- Specified by:
setMatrix2x2Fin interfaceMatrixStorage2x2Type- Parameters:
m- The source matrix
-
componentBytes
protected final int componentBytes() -
byteBuffer
public final java.nio.ByteBuffer 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)
-