com.io7m.jtensors.parameterized

## Class PMatrixM4x4F

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

-     public final class PMatrixM4x4F
      extends Object

  A 4x4 mutable matrix type with `float` elements.

  Since:
    7.0.0

- - ### Nested Class Summary

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

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T0,T1,M extends PMatrixWritable4x4FType<T0,T1>> M` | `copy(PMatrixReadable4x4FType<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 PMatrixWritable4x4FType<T1,T0>> boolean` | `invert(PMatrixM4x4F.ContextPM4F context, PMatrixReadable4x4FType<T0,T1> m, MOUT out)` Calculate the inverse of the matrix `m`, saving the resulting matrix to `out`.
    `static <T0,T1,T2,MOUT extends PMatrixWritable4x4FType<T0,T2>> MOUT` | `multiply(PMatrixReadable4x4FType<T1,T2> m0, PMatrixReadable4x4FType<T0,T1> m1, MOUT out)` Multiply the matrix `m0` with the matrix `m1`, writing the result to `out`.
    `static <T0,T1,V extends PVectorWritable4FType<T1>> V` | `multiplyVector4F(PMatrixM4x4F.ContextPM4F context, PMatrixReadable4x4FType<T0,T1> m, PVectorReadable4FType<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 PMatrixWritable4x4FType<T1,T0>> boolean invert(PMatrixM4x4F.ContextPM4F context,
                                                                                           PMatrixReadable4x4FType<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`. The function uses preallocated storage in `context` to avoid allocating memory. 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

    - #### multiply

          public static <T0,T1,T2,MOUT extends PMatrixWritable4x4FType<T0,T2>> MOUT multiply(PMatrixReadable4x4FType<T1,T2> m0,
                                                                                             PMatrixReadable4x4FType<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`

    - #### multiplyVector4F

          public static <T0,T1,V extends PVectorWritable4FType<T1>> V multiplyVector4F(PMatrixM4x4F.ContextPM4F context,
                                                                                       PMatrixReadable4x4FType<T0,T1> m,
                                                                                       PVectorReadable4FType<T0> v,
                                                                                       V out)

      Multiply the matrix `m` with the vector `v`, writing the resulting vector to `out`.

      The function uses preallocated storage in `context` to avoid allocating memory.

      Formally, this can be considered to be premultiplication of the column vector `v` with the matrix `m`.

      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 PMatrixWritable4x4FType<T0,T1>> M copy(PMatrixReadable4x4FType<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