Package edu.cmu.tetrad.util
Class IndexedMatrix
java.lang.Object
edu.cmu.tetrad.util.IndexedMatrix
Indexed matrix.
- Version:
- $Id: $Id
- 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 SummaryConstructorsConstructorDescriptionIndexedMatrix(double[][] matrix) Constructs a new IndexedMatrix for the given matrix.
- 
Method SummaryModifier and TypeMethodDescriptionint[]Getter for the fieldindices.doublegetValue(int i, int j) getValue.voidsetIndices(int[] indices) Sets the index array.
- 
Constructor Details- 
IndexedMatrixpublic IndexedMatrix(double[][] matrix) Constructs a new IndexedMatrix for the given matrix.- Parameters:
- matrix- The wrapped matrix.
 
 
- 
- 
Method Details- 
getIndicespublic int[] getIndices()Getter for the field indices.- Returns:
- Ibid.
 
- 
setIndicespublic 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.
 
- 
getValuepublic double getValue(int i, int j) getValue. - 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.
 
 
-