com.io7m.jtensors.bytebuffered

## Class MatrixByteBufferedM2x2D

- java.lang.Object
- - com.io7m.jtensors.bytebuffered.MatrixByteBufferedM2x2D

- All Implemented Interfaces:
    ByteBufferedType, MatrixByteBuffered2x2DType, Matrix2x2DType, MatrixReadable2x2DType, MatrixReadableDType, MatrixWritable2x2DType, MatrixWritableDType

      public final class MatrixByteBufferedM2x2D
      extends Object
      implements MatrixByteBuffered2x2DType

  A 2x2 matrix type with `double` 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)`
    `long` | `getByteOffset()`
    `double` | `getR0C0D()`
    `double` | `getR0C1D()`
    `double` | `getR1C0D()`
    `double` | `getR1C1D()`
    `<V extends VectorWritable2DType> void` | `getRow2D(int row, V out)` Retrieve row `row`, saving the result to `out`.
    `<V extends VectorWritable2DType> void` | `getRow2DUnsafe(int row, V out)` Retrieve row `row`, saving the result to `out`.
    `double` | `getRowColumnD(int row, int column)`
    `int` | `hashCode()`
    `static MatrixByteBuffered2x2DType` | `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 .
    `void` | `setByteOffset(long b)` Set the base byte offset of this value.
    `void` | `setR0C0D(double x)` Set row 0, column 0 of the matrix to `x`.
    `void` | `setR0C1D(double x)` Set row 0, column 1 of the matrix to `x`.
    `void` | `setR1C0D(double x)` Set row 1, column 0 of the matrix to `x`.
    `void` | `setR1C1D(double x)` Set row 1, column 1 of the matrix to `x`.
    `void` | `setRowColumnD(int row, int column, double value)` Set the value from the matrix at row `row`, column `column` to `value`.
    `void` | `setRowWith2D(int row, VectorReadable2DType v)` Set row `row` of the matrix to `v`.
    `void` | `setRowWith2DUnsafe(int row, VectorReadable2DType v)` Set row `row` of the matrix to `v`.
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### newMatrixFromByteBuffer

          public static MatrixByteBuffered2x2DType 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

    - #### 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`

    - #### getRow2D

          public <V extends VectorWritable2DType> void getRow2D(int row,
                                                                V out)

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

    - #### getRow2DUnsafe

          public <V extends VectorWritable2DType> void getRow2DUnsafe(int row,
                                                                      V out)

      Description copied from interface: `MatrixReadable2x2DType`
      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:
        `getRow2DUnsafe` in interface `MatrixReadable2x2DType`
      Type Parameters:
        `V` - The precise type of writable vector.
      Parameters:
        `row` - The index of the row, starting at `0`.
        `out` - The output vector.

    - #### getR0C0D

          public double getR0C0D()

      Specified by:
        `getR0C0D` in interface `MatrixReadable2x2DType`
      Returns:
        The value at row 0, column 0

    - #### setR0C0D

          public void setR0C0D(double x)

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

    - #### getR1C0D

          public double getR1C0D()

      Specified by:
        `getR1C0D` in interface `MatrixReadable2x2DType`
      Returns:
        The value at row 1, column 0

    - #### setR1C0D

          public void setR1C0D(double x)

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

    - #### getR0C1D

          public double getR0C1D()

      Specified by:
        `getR0C1D` in interface `MatrixReadable2x2DType`
      Returns:
        The value at row 0, column 1

    - #### setR0C1D

          public void setR0C1D(double x)

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

    - #### getR1C1D

          public double getR1C1D()

      Specified by:
        `getR1C1D` in interface `MatrixReadable2x2DType`
      Returns:
        The value at row 1, column 1

    - #### setR1C1D

          public void setR1C1D(double x)

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

    - #### getRowColumnD

          public double getRowColumnD(int row,
                                      int column)

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

    - #### setRowWith2D

          public void setRowWith2D(int row,
                                   VectorReadable2DType v)

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

    - #### setRowWith2DUnsafe

          public void setRowWith2DUnsafe(int row,
                                         VectorReadable2DType v)

      Description copied from interface: `MatrixWritable2x2DType`
      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:
        `setRowWith2DUnsafe` in interface `MatrixWritable2x2DType`
      Parameters:
        `row` - The row index
        `v` - The row vector

    - #### setRowColumnD

          public void setRowColumnD(int row,
                                    int column,
                                    double value)

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

    - #### getByteOffset

          public long getByteOffset()

      Specified by:
        `getByteOffset` in interface `ByteBufferedType`
      Returns:
        The base byte offset of this value

    - #### setByteOffset

          public void setByteOffset(long b)

      Description copied from interface: `ByteBufferedType`

      Set the base byte offset of this value.

      Must be non-negative.

      Specified by:
        `setByteOffset` in interface `ByteBufferedType`
      Parameters:
        `b` - The offset in bytes

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