public class SymMatrix extends LTMatrix
Implements a space-efficient symmetric matrix (of elements of type short), storing only the lower triangular portion of it
Author:
Raul Saavedra (rsaavedr@ai.uwf.edu)
  • Constructor Details

    • SymMatrix

      public SymMatrix(String mname, int nrows)
      Creates a symmetric matrix with nrows rows.
    • SymMatrix

      public SymMatrix(String fname) throws IOException
      Creates a symmetric matrix reading it from file fname.
      Throws:
      IOException
  • Method Details

    • setValue

      public void setValue(int row, int col, int x)
      Sets the value of element (row,col) to x
      Overrides:
      setValue in class LTMatrix
    • setValue

      public void setValue(int row, int col, short x)
      Sets the value of element (row,col) to x
      Overrides:
      setValue in class LTMatrix
    • getValue

      public short getValue(int row, int col)
      Returns the value of element at (row,col)
      Overrides:
      getValue in class LTMatrix
    • toString

      public String toString()
      Returns a specially formatted string with all the contents of this matrix
      Overrides:
      toString in class LTMatrix