Interface MatrixI

All Known Implementing Classes:
ComplexMatrix, DoubleMatrix, GenericMatrix, ObjectMatrix, RationalMatrixFactory.RationalMatrix, SequenceMatrix

public interface MatrixI
Defines the basic interface implemented by all types of matrix.
Since:
Jep 3.5 / Extensions 2.0
Author:
Richard Morris
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the dimensions of the Vector or Matrix
    getEle(int row, int col)
    Gets an element of a matrix
    int
    The number of columns
    int
    The number of rows
    void
    setEle(int row, int col, Object val)
    Set an element of a matrix
    Object[][]
    toArray(Object[][] mat)
    Copies the data to an array
  • Method Details

    • getEle

      Object getEle(int row, int col) throws EvaluationException
      Gets an element of a matrix
      Parameters:
      row - the row
      col - the column
      Returns:
      the element
      Throws:
      EvaluationException - if the index is out of range. Since Jep 4.1 extensions 2.2 this now throws an EvaluationException
    • setEle

      void setEle(int row, int col, Object val) throws EvaluationException
      Set an element of a matrix
      Parameters:
      row -
      col -
      val - value to set
      Throws:
      EvaluationException
    • getNRows

      int getNRows()
      The number of rows
      Returns:
      number of rows
    • getNCols

      int getNCols()
      The number of columns
      Returns:
      number of columns
    • getDimensions

      Dimensions getDimensions()
      Gets the dimensions of the Vector or Matrix
      Returns:
      the dimensions
    • toArray

      Object[][] toArray(Object[][] mat) throws EvaluationException
      Copies the data to an array
      Parameters:
      mat -
      Returns:
      mat with the elements filled in
      Throws:
      EvaluationException - if mat is not a matrix of the correct size