Class IndexedMatrix

java.lang.Object
edu.cmu.tetrad.util.IndexedMatrix

public final class IndexedMatrix extends Object
Indexed matrix.
Author:
josephramsey Returns values of the given square matrix, where the indices are remapped via the given indices array. If the supplied matrix is 6 x 6, for example, and the indices set are [5 4 2 1], then getValue(1, 2) will return element [4][2] of the given matrix.
  • Constructor Details

    • IndexedMatrix

      public IndexedMatrix(double[][] matrix)
      Constructs a new IndexedMatrix for the given matrix.
      Parameters:
      matrix - The wrapped matrix.
  • Method Details

    • getIndices

      public int[] getIndices()
      Returns:
      Ibid.
    • setIndices

      public void setIndices(int[] indices)
      Sets the index array. The index array must be of length <= the order of the matrix, each element of which is distinct and < the order of the matrix.
      Parameters:
      indices - The indices of the submatrix desired.
    • getValue

      public double getValue(int i, int j)
      Parameters:
      i - The row value in the remapped indices of the cell desired.
      j - The column value in teh remapped indices of the cell desired.
      Returns:
      Ibid.