Interface Matrix

All Superinterfaces:
Vector
All Known Subinterfaces:
Float3x3, Float3xN, Float4x4, Float4xN, FloatMxN
All Known Implementing Classes:
ABFloat3x3, ABFloat4x4, ABFloatMxN, BBFloat3x3, BBFloat4x4, BBFloatMxN

public interface Matrix extends Vector
MxN Matrix

N: Width of the Matrix
M: Height of the Matrix


parameters of get and put methods:
x: from 0 (inclusive) to N (exclusive)
y: from 0 (inclusive) to M (exclusive)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     

    Nested classes/interfaces inherited from interface de.linusdev.lutils.math.vector.Vector

    Vector.View<V extends Vector>
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    For a NxM Matrix, return M.
    default int
    Count of components in this vector.
    int
    For a NxM Matrix, return N.
    boolean
    Whether this matrix is array backed.
    boolean
    Whether this vector is buffer backed.
    default boolean
    Whether this vector is only a view onto another vector.
    default int
    positionToIndex(int y, int x)
     
    static <M extends Matrix>
    @NotNull String
    toString(M matrix, @NotNull String name, @NotNull Matrix.MatrixGetter<M> getter)
     

    Methods inherited from interface de.linusdev.lutils.math.vector.Vector

    getAsView, getStructure
  • Method Details

    • toString

      @NotNull static <M extends Matrix> @NotNull String toString(@NotNull M matrix, @NotNull @NotNull String name, @NotNull @NotNull Matrix.MatrixGetter<M> getter)
    • getMemberCount

      default int getMemberCount()
      Description copied from interface: Vector
      Count of components in this vector.
      Specified by:
      getMemberCount in interface Vector
      Returns:
      float count in this vector
    • positionToIndex

      default int positionToIndex(int y, int x)
      Parameters:
      y - y-pos
      x - x-pos
      Returns:
      index of given position in this Matrix
    • getWidth

      int getWidth()
      For a NxM Matrix, return N.
      Returns:
      width of the matrix
    • getHeight

      int getHeight()
      For a NxM Matrix, return M.
      Returns:
      height of the matrix
    • isArrayBacked

      boolean isArrayBacked()
      Whether this matrix is array backed.
      Specified by:
      isArrayBacked in interface Vector
      Returns:
      true if this matrix is array backed.
    • isBufferBacked

      boolean isBufferBacked()
      Whether this vector is buffer backed.
      Specified by:
      isBufferBacked in interface Vector
      Returns:
      true if this vector is buffer backed.
    • isView

      default boolean isView()
      Description copied from interface: Vector
      Whether this vector is only a view onto another vector.
      Specified by:
      isView in interface Vector
      Returns:
      true if this vector is a view.