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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Dimensions
getDimensions()
Gets the dimensions of the Vector or Matrixjava.lang.Object
getEle(int row, int col)
Gets an element of a matrixint
getNCols()
The number of columnsint
getNRows()
The number of rowsvoid
setEle(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 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
java.lang.Object[][] toArray(java.lang.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
-
-