Class SymMatrix
java.lang.Object
edu.cmu.tetrad.study.gene.tetrad.gene.algorithm.util.BasicMatrix
edu.cmu.tetrad.study.gene.tetrad.gene.algorithm.util.BasicLTMatrix
edu.cmu.tetrad.study.gene.tetrad.gene.algorithm.util.LTMatrix
edu.cmu.tetrad.study.gene.tetrad.gene.algorithm.util.SymMatrix
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)
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshortgetValue(int row, int col) Returns element (r,c)voidsetValue(int row, int col, int x) Sets the value of element (row,col) toxvoidsetValue(int row, int col, short x) Assigns short x to matrix element (r, c)toString()Returns a specially formatted string with all the contents of this matrixMethods inherited from class edu.cmu.tetrad.study.gene.tetrad.gene.algorithm.util.LTMatrix
getDoubleValue, setAllValuesToZero, setDoubleValueMethods inherited from class edu.cmu.tetrad.study.gene.tetrad.gene.algorithm.util.BasicMatrix
getName, getSize, setName
-
Constructor Details
-
SymMatrix
Creates a symmetric matrix withnrowsrows.- Parameters:
mname- aStringobjectnrows- a int
-
SymMatrix
Creates a symmetric matrix reading it from filefname.- Parameters:
fname- aStringobject- Throws:
IOException- if any.
-
-
Method Details
-
setValue
public void setValue(int row, int col, int x) Sets the value of element (row,col) tox -
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) tox -
getValue
public short getValue(int row, int col) Returns element (r,c)Returns the value of element at (
row,col) -
toString
Returns a specially formatted string with all the contents of this matrix
-