sonia
Class NetUtils

java.lang.Object
  |
  +--sonia.NetUtils

public class NetUtils
extends java.lang.Object

Contains a set of static utility methods for performing network calculations and matrix operations used in sonia.


Constructor Summary
NetUtils()
           
 
Method Summary
static double calcDiameter(cern.colt.matrix.impl.DenseDoubleMatrix2D distMatrix)
           
static double calcDiameter(LayoutSlice slice)
          Returns a double equal to the graph-theoretic diameter of the passed network (the length of the longest shortest path).
static cern.colt.matrix.impl.DenseDoubleMatrix2D getAllShortPathMatrix(cern.colt.matrix.DoubleMatrix2D adjMatrix)
          returns an adjacency matrix in which each entry is the "All-Pairs shortest path: distance between the nodes, calculated with Dijkstra's algorithm
static cern.colt.matrix.impl.DenseDoubleMatrix2D getAllShortPathMatrix(LayoutSlice slice)
          returns an adjacency matrix in which each entry is the "All-Pairs shortest path: distance between the nodes, calculated with Dijkstra's algorithm
static double[] getAllSliceMaxMin(java.util.ArrayList slices)
          loops over all the slices in engine and returns the max and min value
static java.util.ArrayList getComponents(cern.colt.matrix.impl.SparseDoubleMatrix2D net, boolean isSymetric)
          Returns an array list containing a set of Subnets correspondig to the strong components of the network.
static cern.colt.matrix.impl.SparseDoubleMatrix2D getMatrix(LayoutSlice slice)
          creates and returns the adjacency matrix of arc weights in the passed slice
static double[] getMatrixMaxMin(cern.colt.matrix.DoubleMatrix2D matrix)
          returns the max and min values of a matrix, assumes no negitive values
static double getPearsons(cern.colt.matrix.impl.SparseDoubleMatrix2D network)
           
static cern.colt.matrix.impl.SparseDoubleMatrix2D getReverse(cern.colt.matrix.impl.SparseDoubleMatrix2D similarity, double max, double min)
          reterns a new matrix which is the reverse similarity->disimilairty, disimilarity->similart of the passed matrix.
static double getStress(LayoutSlice slice)
           
static cern.colt.matrix.impl.SparseDoubleMatrix2D getSubnetMatrix(cern.colt.matrix.impl.SparseDoubleMatrix2D net, cern.colt.list.IntArrayList nodes)
          creates a new matrix with dimensions equal to number of nodes in intArrayList and containing only the relationships between the listed elements and of the same type (sparse, dense) as the passed matrix
static cern.colt.matrix.impl.SparseDoubleMatrix2D getSymMaxMatrix(LayoutSlice slice)
          returns a matrix which is the symetrized (i->j and j->i = Max((i->j,j->i))) version of the passed LayoutSlice.
static cern.colt.matrix.impl.SparseDoubleMatrix2D getSymMaxMatrix(cern.colt.matrix.impl.SparseDoubleMatrix2D adjMatrix)
          returns a matrix which is the symetrized (i->j and j->i = Max((i->j,j->i))) version of the passed adjacency matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetUtils

public NetUtils()
Method Detail

getMatrix

public static cern.colt.matrix.impl.SparseDoubleMatrix2D getMatrix(LayoutSlice slice)
creates and returns the adjacency matrix of arc weights in the passed slice


getSymMaxMatrix

public static cern.colt.matrix.impl.SparseDoubleMatrix2D getSymMaxMatrix(LayoutSlice slice)
returns a matrix which is the symetrized (i->j and j->i = Max((i->j,j->i))) version of the passed LayoutSlice.


getReverse

public static cern.colt.matrix.impl.SparseDoubleMatrix2D getReverse(cern.colt.matrix.impl.SparseDoubleMatrix2D similarity,
                                                                    double max,
                                                                    double min)
reterns a new matrix which is the reverse similarity->disimilairty, disimilarity->similart of the passed matrix. returns a matrix in which each value is equal to the original subtracted from the max+min values of the original.


getSymMaxMatrix

public static cern.colt.matrix.impl.SparseDoubleMatrix2D getSymMaxMatrix(cern.colt.matrix.impl.SparseDoubleMatrix2D adjMatrix)
returns a matrix which is the symetrized (i->j and j->i = Max((i->j,j->i))) version of the passed adjacency matrix.


getComponents

public static java.util.ArrayList getComponents(cern.colt.matrix.impl.SparseDoubleMatrix2D net,
                                                boolean isSymetric)
Returns an array list containing a set of Subnets correspondig to the strong components of the network.


getMatrixMaxMin

public static double[] getMatrixMaxMin(cern.colt.matrix.DoubleMatrix2D matrix)
returns the max and min values of a matrix, assumes no negitive values


getAllSliceMaxMin

public static double[] getAllSliceMaxMin(java.util.ArrayList slices)
loops over all the slices in engine and returns the max and min value


getSubnetMatrix

public static cern.colt.matrix.impl.SparseDoubleMatrix2D getSubnetMatrix(cern.colt.matrix.impl.SparseDoubleMatrix2D net,
                                                                         cern.colt.list.IntArrayList nodes)
creates a new matrix with dimensions equal to number of nodes in intArrayList and containing only the relationships between the listed elements and of the same type (sparse, dense) as the passed matrix


getAllShortPathMatrix

public static cern.colt.matrix.impl.DenseDoubleMatrix2D getAllShortPathMatrix(LayoutSlice slice)
returns an adjacency matrix in which each entry is the "All-Pairs shortest path: distance between the nodes, calculated with Dijkstra's algorithm


getAllShortPathMatrix

public static cern.colt.matrix.impl.DenseDoubleMatrix2D getAllShortPathMatrix(cern.colt.matrix.DoubleMatrix2D adjMatrix)
returns an adjacency matrix in which each entry is the "All-Pairs shortest path: distance between the nodes, calculated with Dijkstra's algorithm


calcDiameter

public static double calcDiameter(LayoutSlice slice)
Returns a double equal to the graph-theoretic diameter of the passed network (the length of the longest shortest path). Requires the calculation of all shortest paths using "Dijkstra's" algorithm, and timing will be approx. O(N E log N).Distances are obtained from the outedge's getStrength() method, and are assumed to be symmetric and non-negitive.


calcDiameter

public static double calcDiameter(cern.colt.matrix.impl.DenseDoubleMatrix2D distMatrix)

getPearsons

public static double getPearsons(cern.colt.matrix.impl.SparseDoubleMatrix2D network)

getStress

public static double getStress(LayoutSlice slice)