Package org.ejml.data

Interface Matrix

All Superinterfaces:
Serializable
All Known Subinterfaces:
CMatrix, DMatrix, DMatrixFixed, DMatrixSparse, FMatrix, FMatrixFixed, FMatrixSparse, MatrixSparse, ReshapeMatrix, ZMatrix
All Known Implementing Classes:
BMatrixRMaj, CMatrixD1, CMatrixRMaj, DMatrix1Row, DMatrix2, DMatrix2x2, DMatrix3, DMatrix3x3, DMatrix4, DMatrix4x4, DMatrix5, DMatrix5x5, DMatrix6, DMatrix6x6, DMatrixD1, DMatrixRBlock, DMatrixRMaj, DMatrixSparseCSC, DMatrixSparseTriplet, FMatrix1Row, FMatrix2, FMatrix2x2, FMatrix3, FMatrix3x3, FMatrix4, FMatrix4x4, FMatrix5, FMatrix5x5, FMatrix6, FMatrix6x6, FMatrixD1, FMatrixRBlock, FMatrixRMaj, FMatrixSparseCSC, FMatrixSparseTriplet, ZMatrixD1, ZMatrixRMaj

public interface Matrix
extends Serializable
Base interface for all rectangular matrices
  • Method Summary

    Modifier and Type Method Description
    <T extends Matrix>
    T
    copy()
    Creates an exact copy of the matrix
    <T extends Matrix>
    T
    create​(int numRows, int numCols)
    Creates a new matrix of the same type with the specified shape
    <T extends Matrix>
    T
    createLike()
    Creates a new matrix with the same shape as this matrix
    int getNumCols()
    Returns the number of columns in this matrix.
    int getNumRows()
    Returns the number of rows in this matrix.
    MatrixType getType()
    Returns the type of matrix
    void print()
    Prints the matrix to standard out using standard formatting.
    void print​(String format)
    Prints the matrix to standard out with the specified formatting.
    void setTo​(Matrix original)
    Sets this matrix to be identical to the 'original' matrix passed in.
    void zero()
    Sets all values inside the matrix to zero
  • Method Details

    • getNumRows

      int getNumRows()
      Returns the number of rows in this matrix.
      Returns:
      Number of rows.
    • getNumCols

      int getNumCols()
      Returns the number of columns in this matrix.
      Returns:
      Number of columns.
    • zero

      void zero()
      Sets all values inside the matrix to zero
    • copy

      <T extends Matrix> T copy()
      Creates an exact copy of the matrix
    • createLike

      <T extends Matrix> T createLike()
      Creates a new matrix with the same shape as this matrix
    • create

      <T extends Matrix> T create​(int numRows, int numCols)
      Creates a new matrix of the same type with the specified shape
    • setTo

      void setTo​(Matrix original)
      Sets this matrix to be identical to the 'original' matrix passed in.
    • print

      void print()
      Prints the matrix to standard out using standard formatting. This is the same as calling print("%e")
    • print

      void print​(String format)
      Prints the matrix to standard out with the specified formatting.
      Parameters:
      format - printf style formatting for a float. E.g. "%f"
      See Also:
      Formatter
    • getType

      MatrixType getType()
      Returns the type of matrix