Class Matrix
java.lang.Object
solvers.linearSystem.simple.matrix.Matrix
- Direct Known Subclasses:
StandardMatrix
An abstract class that provides functionality required of the matrices of the simple linear system.
This includes:
- the ability to write to positions in the matrix
- The ability to multiply by the matrix
- A list of positions in the matrix that are to be updated.
- Author:
- Jack Bradshaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CoMoMBasisThe basis of the model under consideration.protected intSize of Square MatrixList of positions to update -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidMakes every entry in the array 0abstract BigRationalget(int row, int col) Returns value a (row, col)abstract BigRational[][]getArray()Returns the matrix as a BigRational[][] arrayReturns the update list.abstract BigRational[]multiply()Multiplies the previous basis by the matrixabstract voidprint()Prints the matrix to screenvoidreset()Reset the data structures for the generation of the linear system for a new class.voidtoBeUpdated(int row, int col) Adds (row, col) to the list of of positions to be updatedabstract voidwrite(int row, int col, BigRational v) Writes value v at position (row,col) in matrix
-
Field Details
-
update_list
-
size
protected int sizeSize of Square Matrix -
basis
The basis of the model under consideration.
-
-
Constructor Details
-
Matrix
Constructor- Parameters:
basis- The CoMoM basis of the model under considerationsize- The size of the basis (will make a matrix of size: size x size)
-
-
Method Details
-
getArray
Returns the matrix as a BigRational[][] array- Returns:
- underlying matrix
-
write
Writes value v at position (row,col) in matrix- Parameters:
row- row to be written atcol- column two be written atv- value to be written
-
get
Returns value a (row, col)- Parameters:
row- rowcol- column- Returns:
- array[row][column]
-
multiply
Multiplies the previous basis by the matrix- Returns:
- rhs of linear system
-
toBeUpdated
public void toBeUpdated(int row, int col) Adds (row, col) to the list of of positions to be updated- Parameters:
row- rowcol- column
-
getUpdateList
-
reset
public void reset()Reset the data structures for the generation of the linear system for a new class. -
fillWithZeros
protected abstract void fillWithZeros()Makes every entry in the array 0 -
print
public abstract void print()Prints the matrix to screen
-