Package jline.util.matrix
Class SymMatrix
java.lang.Object
jline.util.matrix.SymMatrix
A dense matrix whose entries are
SymExpr rational functions.
The SYMBOLIC counterpart of ComplexMatrix, and it exists for the
same reason that one does: Matrix stores doubles, so a scalar that is
not a double needs its own container rather than a reinterpretation of that
one. The surface here is deliberately only what the pfqn_gld symbolic arm
reads -- shape, element access, row and column slicing -- and not a linear
algebra API. Nothing in that arm multiplies two matrices.
Every entry shares ONE SymContext, which is what makes the entries
addable: Rings fixes the indeterminates when the ring is built.
Copyright (c) 2012-2026, Imperial College London
All rights reserved.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontext()copy()extractColumns(int col0, int col1) Columns[col0,col1)as a new matrix.extractRows(int row0, int row1) Rows[row0,row1)as a new matrix.get(int idx) Linear access in row-major order, asComplexMatrix.get(int)offers.get(int i, int j) intintintbooleanisEmpty()static SymMatrixof(SymContext ctx, double[][] values) A matrix of the given numeric values, carried in exactly.voidtoString()
-
Constructor Details
-
SymMatrix
A zero-filled matrix.- Parameters:
ctx- the shared symbolic contextrows- row countcols- column count
-
-
Method Details
-
of
A matrix of the given numeric values, carried in exactly.- Parameters:
ctx- the shared symbolic contextvalues- row-major values- Returns:
- the matrix
-
context
- Returns:
- the shared symbolic context
-
getNumRows
public int getNumRows()- Returns:
- the row count
-
getNumCols
public int getNumCols()- Returns:
- the column count
-
getNumElements
public int getNumElements()- Returns:
- the element count
-
isEmpty
public boolean isEmpty()- Returns:
- whether the matrix holds no elements
-
get
- Parameters:
i- rowj- column- Returns:
- the entry
-
get
Linear access in row-major order, asComplexMatrix.get(int)offers.- Parameters:
idx- linear index- Returns:
- the entry
-
set
- Parameters:
i- rowj- columnval- the entry
-
extractRows
Rows[row0,row1)as a new matrix.- Parameters:
row0- first row, inclusiverow1- last row, exclusive- Returns:
- the slice
-
extractColumns
Columns[col0,col1)as a new matrix.- Parameters:
col0- first column, inclusivecol1- last column, exclusive- Returns:
- the slice
-
copy
- Returns:
- an independent copy
-
toString
-