This class implements a matrix object designed to store the variance covariance matrix. More...
Public Member Functions | |
def | __init__ |
Constructor. | |
def | setvalue |
Set an entry of the matrix. | |
def | getvalue |
Get an entry of the matrix. | |
def | __str__ |
Function called by the print statement. | |
Public Attributes | |
dim | |
Dimension of the (square) matrix. | |
names | |
keys | |
matrix |
This class implements a matrix object designed to store the variance covariance matrix.
def bioMatrix::Matrix::__init__ | ( | self, | |
dim, | |||
names, | |||
values | |||
) |
Constructor.
dim | Dimension of the (square) matrix |
names | Array of dimension dim containing the names of the parameters |
values | Two-dimensional array of dimension dim x dim containing the entries of the matrix |
Example for the diagonal matrix
names = ["ASC_TRAIN","B_TIME","B_COST","ASC_CAR"] values = [[7.0,0.0,0.0,0.0],[0.0,7.0,0.0,0.0],[0.0,0.0,7.0,0.0],[0.0,0.0,0.0,7.0]] theMatrix = Matrix(4,names,values)
def bioMatrix::Matrix::__str__ | ( | self ) |
Function called by the print statement.
def bioMatrix::Matrix::getvalue | ( | self, | |
rowname, | |||
colname | |||
) |
Get an entry of the matrix.
rowname | Name of the row |
colname | Name of the column |
def bioMatrix::Matrix::setvalue | ( | self, | |
rowname, | |||
colname, | |||
v | |||
) |
Set an entry of the matrix.
If it is an off-diagonal entry, the symmetric entry is set to the same value to maintain the symmetry of the matrix.
rowname | Name of the row |
colname | Name of the column |
v | Value |
Dimension of the (square) matrix.