com.io7m.jtensors.parameterized

## Class PMatrixM3x3D

- java.lang.Object
- - com.io7m.jtensors.parameterized.PMatrixM3x3D

-     public final class PMatrixM3x3D
      extends Object

  A 3x3 mutable matrix type with `double` elements.

  Since:
    7.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PMatrixM3x3D.ContextPM3D` The `ContextPM3D` type contains the minimum storage required for all of the functions of the `PMatrixM3x3D` class.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T0,T1,M extends PMatrixWritable3x3DType<T0,T1>> M` | `copy(PMatrixReadable3x3DType<T0,T1> input, M output)` Copy the contents of the matrix `input` to the matrix `output`, completely replacing all elements.
    `static <T0,T1,MOUT extends PMatrixWritable3x3DType<T1,T0>> boolean` | `invert(PMatrixM3x3D.ContextPM3D context, PMatrixReadable3x3DType<T0,T1> m, MOUT out)` Calculate the inverse of the matrix `m`, saving the resulting matrix to `out`.
    `static <T0,T1,T2,MOUT extends PMatrixWritable3x3DType<T0,T2>> MOUT` | `multiply(PMatrixReadable3x3DType<T1,T2> m0, PMatrixReadable3x3DType<T0,T1> m1, MOUT out)` Multiply the matrix `m0` with the matrix `m1`, writing the result to `out`.
    `static <T0,T1,V extends PVectorWritable3DType<T1>> V` | `multiplyVector3D(PMatrixM3x3D.ContextPM3D context, PMatrixReadable3x3DType<T0,T1> m, PVectorReadable3DType<T0> v, V out)` Multiply the matrix `m` with the vector `v`, writing the resulting vector to `out`.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### invert

          public static <T0,T1,MOUT extends PMatrixWritable3x3DType<T1,T0>> boolean invert(PMatrixM3x3D.ContextPM3D context,
                                                                                           PMatrixReadable3x3DType<T0,T1> m,
                                                                                           MOUT out)

      Calculate the inverse of the matrix `m`, saving the resulting matrix to `out`. The function returns `Some(out)` iff it was possible to invert the matrix, and `None` otherwise. It is not possible to invert a matrix that has a determinant of `0`. If the function returns `None`, `m` is untouched.
      Type Parameters:
        `T0` - A phantom type parameter
        `T1` - A phantom type parameter
        `MOUT` - The precise type of output matrix
      Parameters:
        `context` - Preallocated storage
        `m` - The input matrix
        `out` - The output matrix
      Returns:
        `true` iff the matrix was invertible
      See Also:
        `MatrixM3x3D.determinant(com.io7m.jtensors.MatrixReadable3x3DType)`

    - #### multiply

          public static <T0,T1,T2,MOUT extends PMatrixWritable3x3DType<T0,T2>> MOUT multiply(PMatrixReadable3x3DType<T1,T2> m0,
                                                                                             PMatrixReadable3x3DType<T0,T1> m1,
                                                                                             MOUT out)

      Multiply the matrix `m0` with the matrix `m1`, writing the result to `out`.
      Type Parameters:
        `T0` - A phantom type parameter
        `T1` - A phantom type parameter
        `T2` - A phantom type parameter
        `MOUT` - The precise type of output matrix
      Parameters:
        `m0` - The left input vector
        `m1` - The right input vector
        `out` - The output vector
      Returns:
        `out`

    - #### multiplyVector3D

          public static <T0,T1,V extends PVectorWritable3DType<T1>> V multiplyVector3D(PMatrixM3x3D.ContextPM3D context,
                                                                                       PMatrixReadable3x3DType<T0,T1> m,
                                                                                       PVectorReadable3DType<T0> v,
                                                                                       V out)

      Multiply the matrix `m` with the vector `v`, writing the resulting vector to `out`.
      Type Parameters:
        `T0` - A phantom type parameter
        `T1` - A phantom type parameter
        `V` - The precise type of writable vector
      Parameters:
        `context` - Preallocated storage
        `m` - The input matrix
        `v` - The input vector
        `out` - The output vector
      Returns:
        `out`

    - #### copy

          public static <T0,T1,M extends PMatrixWritable3x3DType<T0,T1>> M copy(PMatrixReadable3x3DType<T0,T1> input,
                                                                                M output)

      Copy the contents of the matrix `input` to the matrix `output`, completely replacing all elements.
      Type Parameters:
        `M` - The precise type of matrix
        `T0` - A phantom type parameter
        `T1` - A phantom type parameter
      Parameters:
        `input` - The input vector
        `output` - The output vector
      Returns:
        `output`

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