Class MutableMatrix<E>

java.lang.Object
dk.jonaslindstrom.ruffini.common.matrices.elements.BaseMatrix<E>
dk.jonaslindstrom.ruffini.common.matrices.elements.MutableMatrix<E>
All Implemented Interfaces:
Matrix<E>, java.util.function.BiFunction<Vector<E>,Ring<E>,Vector<E>>

public class MutableMatrix<E> extends BaseMatrix<E>
Instances of this class represents a mutable matrix.
  • Field Details

  • Constructor Details

    • MutableMatrix

      public MutableMatrix(int m, int n, E defaultValue)
    • MutableMatrix

      public MutableMatrix(int m, int n, IntBinaryFunction<E> populator)
  • Method Details

    • set

      public void set(int i, int j, E value)
    • submatrix

      public Matrix<E> submatrix(int r0, int r1, int c0, int c1)
      Return a submatrix of this matrix containing row r0,...,r1-1 and column c0,...,c1-1.
    • minor

      public Matrix<E> minor(int i, int j)
    • transpose

      public Matrix<E> transpose()
    • submatrix

      public Matrix<E> submatrix(int[] rows, int[] columns)
      Return a submatrix of this matrix with the given rows and columns.
      Parameters:
      rows - Rows to include in submatrix.
      columns - Columns to include in submatrix.
    • get

      public E get(int i, int j)
    • getRow

      public ConcreteVector<E> getRow(int i)
      Specified by:
      getRow in interface Matrix<E>
      Overrides:
      getRow in class BaseMatrix<E>
    • getColumn

      public ConcreteVector<E> getColumn(int j)
      Specified by:
      getColumn in interface Matrix<E>
      Overrides:
      getColumn in class BaseMatrix<E>
    • getHeight

      public int getHeight()
    • getWidth

      public int getWidth()
    • rows

      public Iterable<Vector<E>> rows()
      Specified by:
      rows in interface Matrix<E>
      Overrides:
      rows in class BaseMatrix<E>
    • view

      public Matrix<E> view()
      Description copied from interface: Matrix
      Returns a view of the given matrix. This does not store any values but instead maps operations to this matrix.
    • extendTo

      public Matrix<E> extendTo(int m, int n, E padding)
      Description copied from interface: Matrix
      Returns a new larger matrix of size m x n which has this matrix in the top left corner and pads the rest using the given padding value.
    • map

      public <F> Matrix<F> map(java.util.function.Function<E,F> f)