com.io7m.jtensors.bytebuffered

## Class MatrixByteBufferedM2x2F

- java.lang.Object
- - com.io7m.jtensors.bytebuffered.ByteBuffered
  - - com.io7m.jtensors.bytebuffered.MatrixByteBufferedM2x2F

- All Implemented Interfaces:
    ByteBufferedType, MatrixByteBuffered2x2FType, Matrix2x2FType, MatrixReadable2x2FType, MatrixReadableFType, MatrixWritable2x2FType, MatrixWritableFType

      public final class MatrixByteBufferedM2x2F
      extends ByteBuffered
      implements MatrixByteBuffered2x2FType

  A 2x2 matrix type with `float` elements, packed into a `ByteBuffer`.

  Values of this type cannot be accessed safely from multiple threads without explicit synchronization.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `float` | `getR0C0F()`
    `float` | `getR0C1F()`
    `float` | `getR1C0F()`
    `float` | `getR1C1F()`
    `<V extends VectorWritable2FType> void` | `getRow2F(int row, V out)` Retrieve row `row`, saving the result to `out`.
    `<V extends VectorWritable2FType> void` | `getRow2FUnsafe(int row, V out)` Retrieve row `row`, saving the result to `out`.
    `float` | `getRowColumnF(int row, int column)`
    `int` | `hashCode()`
    `static MatrixByteBuffered2x2FType` | `newMatrixFromByteBuffer(ByteBuffer b, long byte_offset)` Return a new matrix that is backed by whatever data is at byte offset `byte_offset` in the byte buffer .
    `static MatrixByteBuffered2x2FType` | `newMatrixFromByteBufferAndBase(ByteBuffer b, AtomicLong base, int offset)` Return a new matrix that is backed by the given byte buffer `b`
    `void` | `setR0C0F(float x)` Set row 0, column 0 of the matrix to `x`.
    `void` | `setR0C1F(float x)` Set row 0, column 1 of the matrix to `x`.
    `void` | `setR1C0F(float x)` Set row 1, column 0 of the matrix to `x`.
    `void` | `setR1C1F(float x)` Set row 1, column 1 of the matrix to `x`.
    `void` | `setRowColumnF(int row, int column, float value)` Set the value from the matrix at row `row`, column `column` to `value`.
    `void` | `setRowWith2F(int row, VectorReadable2FType v)` Set row `row` of the matrix to `v`.
    `void` | `setRowWith2FUnsafe(int row, VectorReadable2FType v)` Set row `row` of the matrix to `v`.
    `String` | `toString()`

    - ### Methods inherited from class com.io7m.jtensors.bytebuffered.ByteBuffered

      `getByteOffset, getIndex, getOffset, setBase, setByteOffset`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.jtensors.bytebuffered.ByteBufferedType

      `getByteOffset, setByteOffset`

- - ### Method Detail

    - #### newMatrixFromByteBuffer

          public static MatrixByteBuffered2x2FType newMatrixFromByteBuffer(ByteBuffer b,
                                                                           long byte_offset)

      Return a new matrix that is backed by whatever data is at byte offset `byte_offset` in the byte buffer .

      No initialization of the data is performed.

      Parameters:
        `b` - The byte buffer
        `byte_offset` - A byte offset
      Returns:
        A new buffered matrix

    - #### newMatrixFromByteBufferAndBase

          public static MatrixByteBuffered2x2FType newMatrixFromByteBufferAndBase(ByteBuffer b,
                                                                                  AtomicLong base,
                                                                                  int offset)

      Return a new matrix 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 buffer
        `base` - The base address
        `offset` - A constant offset
      Returns:
        A new buffered matrix

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getRow2F

          public <V extends VectorWritable2FType> void getRow2F(int row,
                                                                V out)

      Description copied from interface: `MatrixReadable2x2FType`
      Retrieve row `row`, saving the result to `out`.
      Specified by:
        `getRow2F` in interface `MatrixReadable2x2FType`
      Type Parameters:
        `V` - The precise type of writable vector.
      Parameters:
        `row` - The index of the row, starting at `0`.
        `out` - The output vector.

    - #### getRow2FUnsafe

          public <V extends VectorWritable2FType> void getRow2FUnsafe(int row,
                                                                      V out)

      Description copied from interface: `MatrixReadable2x2FType`
      Retrieve row `row`, saving the result to `out`. No bounds checking is performed for `row`, and out-of-bounds values result in undefined behaviour.
      Specified by:
        `getRow2FUnsafe` in interface `MatrixReadable2x2FType`
      Type Parameters:
        `V` - The precise type of writable vector.
      Parameters:
        `row` - The index of the row, starting at `0`.
        `out` - The output vector.

    - #### getR0C0F

          public float getR0C0F()

      Specified by:
        `getR0C0F` in interface `MatrixReadable2x2FType`
      Returns:
        The value at row 0, column 0

    - #### setR0C0F

          public void setR0C0F(float x)

      Description copied from interface: `MatrixWritable2x2FType`
      Set row 0, column 0 of the matrix to `x`.
      Specified by:
        `setR0C0F` in interface `MatrixWritable2x2FType`
      Parameters:
        `x` - The value

    - #### getR1C0F

          public float getR1C0F()

      Specified by:
        `getR1C0F` in interface `MatrixReadable2x2FType`
      Returns:
        The value at row 1, column 0

    - #### setR1C0F

          public void setR1C0F(float x)

      Description copied from interface: `MatrixWritable2x2FType`
      Set row 1, column 0 of the matrix to `x`.
      Specified by:
        `setR1C0F` in interface `MatrixWritable2x2FType`
      Parameters:
        `x` - The value

    - #### getR0C1F

          public float getR0C1F()

      Specified by:
        `getR0C1F` in interface `MatrixReadable2x2FType`
      Returns:
        The value at row 0, column 1

    - #### setR0C1F

          public void setR0C1F(float x)

      Description copied from interface: `MatrixWritable2x2FType`
      Set row 0, column 1 of the matrix to `x`.
      Specified by:
        `setR0C1F` in interface `MatrixWritable2x2FType`
      Parameters:
        `x` - The value

    - #### getR1C1F

          public float getR1C1F()

      Specified by:
        `getR1C1F` in interface `MatrixReadable2x2FType`
      Returns:
        The value at row 1, column 1

    - #### setR1C1F

          public void setR1C1F(float x)

      Description copied from interface: `MatrixWritable2x2FType`
      Set row 1, column 1 of the matrix to `x`.
      Specified by:
        `setR1C1F` in interface `MatrixWritable2x2FType`
      Parameters:
        `x` - The value

    - #### getRowColumnF

          public float getRowColumnF(int row,
                                     int column)

      Specified by:
        `getRowColumnF` in interface `MatrixReadableFType`
      Parameters:
        `row` - The row
        `column` - The column
      Returns:
        The value from the matrix at row `row` , column `column`.

    - #### setRowWith2F

          public void setRowWith2F(int row,
                                   VectorReadable2FType v)

      Description copied from interface: `MatrixWritable2x2FType`
      Set row `row` of the matrix to `v`.
      Specified by:
        `setRowWith2F` in interface `MatrixWritable2x2FType`
      Parameters:
        `row` - The row index
        `v` - The row vector

    - #### setRowWith2FUnsafe

          public void setRowWith2FUnsafe(int row,
                                         VectorReadable2FType v)

      Description copied from interface: `MatrixWritable2x2FType`
      Set row `row` of the matrix to `v`. No bounds checking is performed for `row`, and out-of-bounds values result in undefined behaviour.
      Specified by:
        `setRowWith2FUnsafe` in interface `MatrixWritable2x2FType`
      Parameters:
        `row` - The row index
        `v` - The row vector

    - #### setRowColumnF

          public void setRowColumnF(int row,
                                    int column,
                                    float value)

      Description copied from interface: `MatrixWritableFType`
      Set the value from the matrix at row `row`, column `column` to `value`.
      Specified by:
        `setRowColumnF` in interface `MatrixWritableFType`
      Parameters:
        `row` - The row
        `column` - The column
        `value` - The value

Copyright © 2017 <code@io7m.com> http://io7m.com