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

    • SymMatrix

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

      public SymMatrix(String fname) throws IOException
      Creates a symmetric matrix reading it from file fname.
      Parameters:
      fname - a String object
      Throws:
      IOException - if any.
  • 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
      Parameters:
      row - a int
      col - a int
      x - a int
    • setValue

      public void setValue(int row, int col, short x)
      Assigns short x to matrix element (r, c)

      Sets the value of element (row,col) to x

      Overrides:
      setValue in class LTMatrix
      Parameters:
      row - a int
      col - a int
      x - a short
    • getValue

      public short getValue(int row, int col)
      Returns element (r,c)

      Returns the value of element at (row,col)

      Overrides:
      getValue in class LTMatrix
      Parameters:
      row - a int
      col - a int
      Returns:
      a short
    • toString

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