org.geworkbench.util.network
Class EdgeMatrix

java.lang.Object
  extended by org.geworkbench.util.network.EdgeMatrix

public class EdgeMatrix
extends java.lang.Object

Title: Sequence and Pattern Plugin

Description:

Copyright: Copyright (c) 2003

Company:

This class is used to represent a graph as a set of edges through a sparse matrix EM. If the entry EM(a, b) is not empty then an edge exists between nodes a and b. This matrix structure can be used to implement several graph algorithms

Note that while the matrix could be implemented as a triangular one to save space, as edge(a,b) == edge(b,a), it is better to have two entries for each edge so that one can find all edges of a node by just exploring one column instead of having to look in all the columns.

Version:
1.0
Author:
not attributable

Nested Class Summary
 class EdgeMatrix.MatrixCell
           
 
Constructor Summary
EdgeMatrix()
           
 
Method Summary
 void clear()
           
 void deserialize(DSMicroarraySet<DSMicroarray> microarraySet, javax.swing.JProgressBar bar)
           
 java.util.Set getConnectedNodes(DSGeneMarker aa)
           
 EdgeMatrix.MatrixCell getEdge(DSGeneMarker a, DSGeneMarker b)
          This method returns the edge between a and b, it it exists.
 EdgeMatrix.MatrixCell getEdge(java.lang.Integer a, java.lang.Integer b)
          This method returns the edge between a and b, it it exists.
 java.util.Collection getEdges(DSGeneMarker aa)
           
 void reduce(DSMicroarraySet microarraySet, javax.swing.JProgressBar bar)
           
 boolean remove(DSGeneMarker aa, DSGeneMarker bb)
           
 void serialize(DSMicroarraySet<DSMicroarray> microarraySet, int cpuId, int cpuNo)
          Serializes the whole edge matrix
 void serializeNode(DSGeneMarker aNode)
          This method serializes a column of the HashTable
 void setActive(DSGeneMarker a, DSGeneMarker b, boolean status)
           
 boolean setEdge(DSGeneMarker aa, DSGeneMarker bb, GeneNetworkEdge edge)
          Adds an edge to the network if one is not already present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeMatrix

public EdgeMatrix()
Method Detail

setEdge

public boolean setEdge(DSGeneMarker aa,
                       DSGeneMarker bb,
                       GeneNetworkEdge edge)
Adds an edge to the network if one is not already present. This is the private version of the method that assumes that a.getSerial() > b.getSerial()

Parameters:
a -
b -
anEdge -
Returns:

getEdge

public EdgeMatrix.MatrixCell getEdge(DSGeneMarker a,
                                     DSGeneMarker b)
This method returns the edge between a and b, it it exists.

Parameters:
a -
b -
Returns:
null if the edge does not exist, an IGeneNetworkEdge otherwise

getEdge

public EdgeMatrix.MatrixCell getEdge(java.lang.Integer a,
                                     java.lang.Integer b)
This method returns the edge between a and b, it it exists.

Parameters:
a - an Integer with the serial id of the first gene
b - an Integer with the serial id of the second gene
Returns:
null if the edge does not exist, an IGeneNetworkEdge otherwise

serializeNode

public void serializeNode(DSGeneMarker aNode)
This method serializes a column of the HashTable

Parameters:
aNode - the node to serialize

serialize

public void serialize(DSMicroarraySet<DSMicroarray> microarraySet,
                      int cpuId,
                      int cpuNo)
Serializes the whole edge matrix


deserialize

public void deserialize(DSMicroarraySet<DSMicroarray> microarraySet,
                        javax.swing.JProgressBar bar)

setActive

public void setActive(DSGeneMarker a,
                      DSGeneMarker b,
                      boolean status)

remove

public boolean remove(DSGeneMarker aa,
                      DSGeneMarker bb)

getEdges

public java.util.Collection getEdges(DSGeneMarker aa)

getConnectedNodes

public java.util.Set getConnectedNodes(DSGeneMarker aa)

clear

public void clear()

reduce

public void reduce(DSMicroarraySet microarraySet,
                   javax.swing.JProgressBar bar)