Interface MatrixI
-
- All Known Implementing Classes:
ComplexMatrix,DoubleMatrix,GenericMatrix,ObjectMatrix,RationalMatrixFactory.RationalMatrix,SequenceMatrix
public interface MatrixIDefines the basic interface implemented by all types of matrix.- Since:
- Jep 3.5 / Extensions 2.0
- Author:
- Richard Morris
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DimensionsgetDimensions()Gets the dimensions of the Vector or Matrixjava.lang.ObjectgetEle(int row, int col)Gets an element of a matrixintgetNCols()The number of columnsintgetNRows()The number of rowsvoidsetEle(int row, int col, java.lang.Object val)Set an element of a matrixjava.lang.Object[][]toArray(java.lang.Object[][] mat)Copies the data to an array
-
-
-
Method Detail
-
getEle
java.lang.Object getEle(int row, int col)Gets an element of a matrix- Parameters:
row- the rowcol- the column- Returns:
- the element
-
setEle
void setEle(int row, int col, java.lang.Object val) throws EvaluationExceptionSet 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
java.lang.Object[][] toArray(java.lang.Object[][] mat) throws EvaluationExceptionCopies 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
-
-