java.io.Serializable
public class ClusterDiagram
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field | Description |
---|---|---|
int[][] |
mConnections |
|
int |
mNumBody |
|
int |
mNumIdenticalPermutations |
|
int |
mReeHooverFactor |
Constructor | Description |
---|---|
ClusterDiagram(int numBody,
int numRootPoints) |
Constructs a cluster having numBody points of which numRootPoints are root points,
with bonds between each pair of points (full star).
|
ClusterDiagram(int numBody,
int numRootPoints,
int[][] bonds) |
Constructs a cluster having numBody points of which numRootPoints are root points,
with bonds as given by the array bonds.
|
ClusterDiagram(int numBody,
int numRootPoints,
int[][] bonds,
Rational weight) |
|
ClusterDiagram(ClusterDiagram cluster) |
Creates a copy of the given cluster
|
Modifier and Type | Method | Description |
---|---|---|
void |
addConnection(int node1,
int node2) |
Adds a connection between the node1 and node2.
|
void |
calcScore(int[] score) |
compute a score for the cluster.
|
void |
copyTo(ClusterDiagram destCluster) |
|
boolean |
deleteConnection(int node1,
int node2) |
Deletes a connection from one node1 to node2.
|
int |
getNumConnections() |
returns the number of active connections in the cluster.
|
int |
getNumRootPoints() |
|
Rational |
getWeight() |
|
boolean |
isIsomorphOf(ClusterDiagram anotherCluster) |
Returns true if this cluster is an isomorph of the given cluster.
|
boolean |
isRootPoint(int i) |
returns true if the given point is a root point
|
static void |
main(java.lang.String[] args) |
|
void |
makeFullStar() |
Turns this cluster into a full star -- each point in the cluster is
connected to every other point in the cluster.
|
void |
reset() |
Resets the cluster to being fully connected except that root points
are not connected to each other.
|
protected boolean |
scoreGreaterThan(int[] compareScore) |
Determines if the cluster's current configuration has a score greater
than the given score.
|
void |
setWeight(Rational weight) |
|
void |
sort() |
Sorts list of connections for each node in the diagram such that
mConnections[i][j] < mConnections[i][k] for k > j.
|
void |
swap(int point1,
int point2) |
Swaps point1 and point2.
|
java.lang.String |
toString() |
public final int mNumBody
public final int[][] mConnections
public int mNumIdenticalPermutations
public int mReeHooverFactor
public ClusterDiagram(int numBody, int numRootPoints)
public ClusterDiagram(int numBody, int numRootPoints, int[][] bonds)
bonds
- array of integer pairs that specifies nodes that have a bond joining thempublic ClusterDiagram(int numBody, int numRootPoints, int[][] bonds, Rational weight)
public ClusterDiagram(ClusterDiagram cluster)
public void copyTo(ClusterDiagram destCluster)
public int getNumRootPoints()
public boolean isRootPoint(int i)
public int getNumConnections()
public Rational getWeight()
public void setWeight(Rational weight)
public void makeFullStar()
public void swap(int point1, int point2)
public boolean deleteConnection(int node1, int node2)
public void addConnection(int node1, int node2)
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean scoreGreaterThan(int[] compareScore)
public void calcScore(int[] score)
public void reset()
public void sort()
public boolean isIsomorphOf(ClusterDiagram anotherCluster)
public static void main(java.lang.String[] args)