Biogeme: Python Library  2.5
Public Member Functions | Public Attributes | List of all members
bioMatrix.bioMatrix Class Reference

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

Inheritance diagram for bioMatrix.bioMatrix:

Public Member Functions

def __init__ (self, dim, names, values)
 Constructor. More...
 
def setvalue (self, rowname, colname, v)
 Set an entry of the matrix. More...
 
def getvalue (self, rowname, colname)
 Get an entry of the matrix. More...
 
def __str__ (self)
 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.

Definition at line 8 of file bioMatrix.py.

Constructor & Destructor Documentation

def bioMatrix.bioMatrix.__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}\]

1 names = ["ASC_TRAIN","B_TIME","B_COST","ASC_CAR"]
2 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]]
3 theMatrix = bioMatrix(4,names,values)

Definition at line 20 of file bioMatrix.py.

Member Function Documentation

def bioMatrix.bioMatrix.getvalue (   self,
  rowname,
  colname 
)

Get an entry of the matrix.

Parameters
rownameName of the row
colnameName of the column
Returns
Value

Definition at line 51 of file bioMatrix.py.

def bioMatrix.bioMatrix.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

Definition at line 43 of file bioMatrix.py.


The documentation for this class was generated from the following file:
Copyright 2016 Michel Bierlaire