RePast
v. 2.0

uchicago.src.sim.network
Interface AdjacencyMatrix

All Known Implementing Classes:
AbstractAdjacencyMatrix

public interface AdjacencyMatrix


Method Summary
 int columns()
          Returns the number of columns in the matrix.
 double get(int row, int col)
          Gets the value at row, col.
 double getAvgDegree()
          Gets the average degree of this matrix.
 String getComment()
          Gets the comment, if any, associated with this matrix.
 double getDensity()
          Gets (computes) the density of this matrix.
 List getLabels()
          Gets the node labels for this matrix.
 String getMatrixLabel()
          Gets the label for this matrix.
 cern.colt.matrix.impl.DenseDoubleMatrix1D getRow(int row)
          Gets the specified row of data for this matrix.
 String matrixToString()
          Returns a String representation of only the actual data matrix.
 int rows()
          Returns the number of rows int matrix.
 void set(int row, int col, double val)
          Sets a data value in this matrix.
 void setComment(String comment)
          Associates a comment with this matrix (e.g.
 void setMatrix(cern.colt.matrix.impl.DenseDoubleMatrix2D m)
          Sets the actual matrix for this AdjacencyMatrix.
 void setMatrixLabel(String mLabel)
          Sets the label for this matrix.
 

Method Detail

setMatrixLabel

public void setMatrixLabel(String mLabel)
Sets the label for this matrix. This is used to indicated the type of matrix (i.e. kinship etc.).

Parameters:
mLabel - the label for this matrix

getMatrixLabel

public String getMatrixLabel()
Gets the label for this matrix. This is used to indicated the type of matrix (i.e. kinship etc.).


setMatrix

public void setMatrix(cern.colt.matrix.impl.DenseDoubleMatrix2D m)
Sets the actual matrix for this AdjacencyMatrix.

Parameters:
m - the actual matrix data for this AdjacencyMatrix

setComment

public void setComment(String comment)
Associates a comment with this matrix (e.g. the tick count at which it was created.)

Parameters:
comment - the comment

getComment

public String getComment()
Gets the comment, if any, associated with this matrix.


getLabels

public List getLabels()
Gets the node labels for this matrix.


getRow

public cern.colt.matrix.impl.DenseDoubleMatrix1D getRow(int row)
Gets the specified row of data for this matrix.

Parameters:
row - the index of the row to get

getDensity

public double getDensity()
Gets (computes) the density of this matrix.


getAvgDegree

public double getAvgDegree()
Gets the average degree of this matrix.


set

public void set(int row,
                int col,
                double val)
Sets a data value in this matrix.

Parameters:
row - the row index (i)
col - the col index (j)

get

public double get(int row,
                  int col)
Gets the value at row, col.

Parameters:
row - the row index (i)
col - the col index (j)
Returns:
the double value at row, col (ij)

rows

public int rows()
Returns the number of rows int matrix.


columns

public int columns()
Returns the number of columns in the matrix.


matrixToString

public String matrixToString()
Returns a String representation of only the actual data matrix.


RePast
v. 2.0

Bug reports and feature requests to RePast