uchicago.src.sim.network
Interface AdjacencyMatrix

All Known Implementing Classes:
AbstractAdjacencyMatrix

public interface AdjacencyMatrix

A social network adjacency matrix. This is used as an itermediary data structure when moving between Nodes and Edges and other kinds of network representations. The matrix is assumed to be square and that the rows and columns refer to the same nodes.

Version:
$Revision: 1.6 $ $Date: 2004/11/03 19:51:01 $
Author:
Nick Collier
See Also:
Node, Edge

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.
 java.lang.String getComment()
          Gets the comment, if any, associated with this matrix.
 double getDensity()
          Gets (computes) the density of this matrix.
 java.util.List getLabels()
          Gets the node labels for this matrix.
 java.lang.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.
 java.lang.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(java.lang.String comment)
          Associates a comment with this matrix (e.g. the tick count at which it was created.)
 void setMatrix(cern.colt.matrix.impl.DenseDoubleMatrix2D m)
          Sets the actual matrix for this AdjacencyMatrix.
 void setMatrixLabel(java.lang.String mLabel)
          Sets the label for this matrix.
 

Method Detail

setMatrixLabel

public void setMatrixLabel(java.lang.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 java.lang.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(java.lang.String comment)
Associates a comment with this matrix (e.g. the tick count at which it was created.)

Parameters:
comment - the comment

getComment

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


getLabels

public java.util.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 java.lang.String matrixToString()
Returns a String representation of only the actual data matrix.