Class Matrix

java.lang.Object
solvers.linearSystem.simple.matrix.Matrix
Direct Known Subclasses:
StandardMatrix

public abstract class Matrix extends Object
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 Details

    • update_list

      protected List<Tuple<Integer,Integer>> update_list
      List of positions to update
    • size

      protected int size
      Size of Square Matrix
    • basis

      protected CoMoMBasis basis
      The basis of the model under consideration.
  • Constructor Details

    • Matrix

      public Matrix(CoMoMBasis basis, int size)
      Constructor
      Parameters:
      basis - The CoMoM basis of the model under consideration
      size - The size of the basis (will make a matrix of size: size x size)
  • Method Details

    • getArray

      public abstract BigRational[][] getArray()
      Returns the matrix as a BigRational[][] array
      Returns:
      underlying matrix
    • write

      public abstract void write(int row, int col, BigRational v)
      Writes value v at position (row,col) in matrix
      Parameters:
      row - row to be written at
      col - column two be written at
      v - value to be written
    • get

      public abstract BigRational get(int row, int col)
      Returns value a (row, col)
      Parameters:
      row - row
      col - column
      Returns:
      array[row][column]
    • multiply

      public abstract BigRational[] 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 - row
      col - column
    • getUpdateList

      public List<Tuple<Integer,Integer>> getUpdateList()
      Returns the update list.
      Returns:
      the list of positions to be updated
    • 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