Class MatrixInt

All Implemented Interfaces:
AttributeObject, InterfaceObject, NamedObject, TreeObject, CleanableObject, XMLObject, IconObject

public class MatrixInt
extends VariableInt<MguiDouble>
Interface for a 2D matrix, represented internally as a Jama matrix of doubles.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • matrix

      protected Jama.Matrix matrix
  • Constructor Details

    • MatrixInt

      public MatrixInt​(java.lang.String name, int m, int n)
    • MatrixInt

      public MatrixInt​(java.lang.String name, Jama.Matrix m)
    • MatrixInt

      public MatrixInt​(java.util.ArrayList<java.util.ArrayList<MguiNumber>> values)
  • Method Details

    • isNumeric

      public boolean isNumeric()
      Description copied from class: VariableInt
      Determines whether this variable contains numeric values.
      Overrides:
      isNumeric in class VariableInt<MguiDouble>
      Returns:
    • getAsList

      public java.util.ArrayList<MguiDouble> getAsList()
      Description copied from class: VariableInt
      Returns this variable as a single list of values.
      Specified by:
      getAsList in class VariableInt<MguiDouble>
      Returns:
    • getSize

      public int getSize()
      Description copied from class: VariableInt
      Returns the total size (number of elements) of this variable.
      Specified by:
      getSize in class VariableInt<MguiDouble>
      Returns:
    • getType

      public java.lang.Class<MguiDouble> getType()
      Description copied from class: VariableInt
      Returns a Class object which is the parameterized type of this variable.
      Overrides:
      getType in class VariableInt<MguiDouble>
      Returns:
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from interface: IconObject
      Returns the Icon associated with this object.
      Specified by:
      getObjectIcon in interface IconObject
      Overrides:
      getObjectIcon in class VariableInt<MguiDouble>
      Returns:
    • setValue

      public boolean setValue​(java.util.List<java.lang.Integer> indices, MguiDouble value) throws VariableException
      Description copied from class: VariableInt
      Sets the value at the given indices; throws an exception if they are out of bounds, this variable is not editable, or value is an inappropriate value.
      Specified by:
      setValue in class VariableInt<MguiDouble>
      Returns:
      object at the given indices
      Throws:
      VariableException
    • setStringValue

      public boolean setStringValue​(java.util.List<java.lang.Integer> indices, java.lang.String value) throws VariableException
      Description copied from class: VariableInt
      Sets the value at the given indices as a String; throws an exception if they are out of bounds, this variable is not editable, or value is an inappropriate value.
      Specified by:
      setStringValue in class VariableInt<MguiDouble>
      Returns:
      object at the given indices
      Throws:
      VariableException
    • getValue

      public MguiDouble getValue​(int i, int j) throws VariableException
      Throws:
      VariableException
    • getDimensions

      public java.util.ArrayList<java.lang.Integer> getDimensions()
      Specified by:
      getDimensions in class VariableInt<MguiDouble>
    • getValue

      protected MguiDouble getValue​(java.util.List<java.lang.Integer> indices) throws VariableException
      Description copied from class: VariableInt
      Returns the value at the given indices; throws an exception if they are out of bounds. If the indices are of a lower dimension than the variable dimension, the returned object is handled by the subclass method. As a general policy, this object should represent the remaining dimensions in some way.
      Specified by:
      getValue in class VariableInt<MguiDouble>
      Returns:
      object at the given indices
      Throws:
      VariableException
    • getPart

      public MatrixInt getPart​(int row_start, int row_end, int col_start, int col_end)
      Returns a sub-matrix of this matrix, defined by start and end indices.
      Parameters:
      row_start -
      col_start -
      row_end -
      col_end -
      Returns:
    • getPart

      public MatrixInt getPart​(java.lang.String name, int row_start, int col_start, int row_end, int col_end)
      Returns a sub-matrix of this matrix, defined by start and end indices, with the given name.
      Parameters:
      name -
      row_start -
      col_start -
      row_end -
      col_end -
      Returns:
    • getPart

      public MatrixInt getPart​(java.lang.String name, java.lang.String part)
      Parses part to return a sub-matrix. Syntax is: "row_start,col_start:row_end,col_end". E.g., "1,2:20,2". Use an asterisk "*" to indicate the last row and column, respectively (actually replaces the value with M-1, N-1). E.g,, "0,0:*,*" is the entire matrix.
      Specified by:
      getPart in class VariableInt<MguiDouble>
      Parameters:
      name -
      part -
      Returns:
    • getRow

      public VectorInt<MguiDouble> getRow​(int row)
      Returns row row as a VectorInt object.
      Parameters:
      row -
      Returns:
    • getRow

      public VectorInt<MguiDouble> getRow​(java.lang.String name, int row)
      Returns row row as a VectorInt object.
      Parameters:
      row -
      Returns:
    • getColumn

      public VectorInt<MguiDouble> getColumn​(int col)
      Returns column col as a VectorInt object.
      Parameters:
      col -
      Returns:
    • getColumn

      public VectorInt<MguiDouble> getColumn​(java.lang.String name, int col)
      Returns column col as a VectorInt object.
      Parameters:
      row -
      Returns:
    • getM

      public int getM()
      Returns the row dimension, M
      Returns:
    • getN

      public int getN()
      Returns the column dimension, N
      Returns:
    • getJamaMatrix

      public Jama.Matrix getJamaMatrix()
      Returns the Jama matrix for this object.
      Returns:
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class VariableInt<MguiDouble>