Public Member Functions | Public Attributes

bioMatrix::Matrix Class Reference

This class implements a matrix object designed to store the variance covariance matrix. More...

List of all members.

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

Detailed Description

This class implements a matrix object designed to store the variance covariance matrix.


Constructor & Destructor Documentation

def bioMatrix::Matrix::__init__ (   self,
  dim,
  names,
  values 
)

Constructor.

Parameters:
dimDimension of the (square) matrix
namesArray of dimension dim containing the names of the parameters
valuesTwo-dimensional array of dimension dim x dim containing the entries of the matrix

Example for the diagonal matrix

\[\begin{array}{cccc} 7 & 0 & 0 & 0 \\ 0 & 7 & 0 & 0 \\ 0 & 0 & 7 & 0 \\ 0 & 0 & 0 & 7 \end{array}\]

 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)

Member Function Documentation

def bioMatrix::Matrix::__str__ (   self )

Function called by the print statement.

def bioMatrix::Matrix::getvalue (   self,
  rowname,
  colname 
)

Get an entry of the matrix.

Parameters:
rownameName of the row
colnameName of the column
Returns:
Value
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.

Parameters:
rownameName of the row
colnameName of the column
vValue

Member Data Documentation

Dimension of the (square) matrix.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables