Class PMatrixByteBuffered2x2s32<A,B>
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.PMatrixByteBuffered2x2s32<A,B>
- Type Parameters:
A
- A phantom type parameter (possibly representing a source coordinate system)B
- A phantom type parameter (possibly representing a target coordinate system)
- All Implemented Interfaces:
PMatrixReadable2x2DType<A,B>
,MatrixReadable2x2DType
,MatrixReadableDType
,MatrixStorageType
,PMatrixStorage2x2Type<A,B>
,MatrixStorage2x2Type
,MatrixByteBufferedType
,PMatrixByteBuffered2x2Type<A,B>
,TensorByteBufferedType
public final class PMatrixByteBuffered2x2s32<A,B> extends java.lang.Object implements PMatrixByteBuffered2x2Type<A,B>
A storage matrix.
Storage component type: double
Storage component count: 2x2
-
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 <A, B> PMatrixByteBuffered2x2s32<A,B>
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()
double
r0c0()
double
r0c1()
double
r1c0()
double
r1c1()
void
setMatrix2x2D(Matrix2x2D m)
Set the components from the given matrix.void
setMatrix2x2F(Matrix2x2F m)
Set the components from the given matrix.void
setPMatrix2x2D(PMatrix2x2D<A,B> m)
Set the components from the given matrix.void
setPMatrix2x2F(PMatrix2x2F<A,B> m)
Set the components from the given matrix.int
sizeBytes()
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.core.unparameterized.matrices.MatrixReadable2x2DType
rowColumn
Methods inherited from interface com.io7m.jtensors.storage.bytebuffered.TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytes
-
Method Details
-
createWithBase
public static <A, B> PMatrixByteBuffered2x2s32<A,B> 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.
- Type Parameters:
A
- A phantom type parameter (possibly representing a source coordinate system)B
- A phantom type parameter (possibly representing a target coordinate system)- 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:
r0c0
in interfaceMatrixReadable2x2DType
- Returns:
- The value at row 0 column 0
-
r0c1
public double r0c1()- Specified by:
r0c1
in interfaceMatrixReadable2x2DType
- Returns:
- The value at row 0 column 1
-
r1c0
public double r1c0()- Specified by:
r1c0
in interfaceMatrixReadable2x2DType
- Returns:
- The value at row 1 column 0
-
r1c1
public double r1c1()- Specified by:
r1c1
in interfaceMatrixReadable2x2DType
- Returns:
- The value at row 1 column 1
-
setPMatrix2x2D
Description copied from interface:PMatrixStorage2x2Type
Set the components from the given matrix.- Specified by:
setPMatrix2x2D
in interfacePMatrixStorage2x2Type<A,B>
- Parameters:
m
- The source matrix
-
setPMatrix2x2F
Description copied from interface:PMatrixStorage2x2Type
Set the components from the given matrix.- Specified by:
setPMatrix2x2F
in interfacePMatrixStorage2x2Type<A,B>
- Parameters:
m
- The source matrix
-
setMatrix2x2D
Description copied from interface:MatrixStorage2x2Type
Set the components from the given matrix.- Specified by:
setMatrix2x2D
in interfaceMatrixStorage2x2Type
- Parameters:
m
- The source matrix
-
setMatrix2x2F
Description copied from interface:MatrixStorage2x2Type
Set the components from the given matrix.- Specified by:
setMatrix2x2F
in interfaceMatrixStorage2x2Type
- Parameters:
m
- The source matrix
-
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)
-