|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MusicGraph
MusicGraph is the abstract superclass of MotherGraph
and
Subgraph
. This class contains the fundamental attributes
(vertices and edges) of a graph and a number of general methods to
manipulate a graph.
Field Summary | |
java.util.Vector |
edges
A Vector of MusicEdge . |
java.lang.String |
title
The title is just a name (a label) that makes it easier for the user to distinguish between MusicGraphs. |
java.util.Vector |
vertices
A Vector of MusicVertex . |
Constructor Summary | |
MusicGraph()
|
Method Summary | |
static boolean |
boolMatrixEqual(boolean[][] m1,
boolean[][] m2)
Helper function. |
static boolean[][] |
boolMatrixMultiply(boolean[][] m1,
boolean[][] m2)
Helper function. |
void |
checkSorting()
For debugging. |
abstract java.lang.Object |
clone()
|
boolean |
contains(MusicGraph other)
Checks if all vertices and all edges in the other MusicGraph are also contained in this MusicGraph. |
abstract jm.music.data.Score |
convertToScore()
ConvertToScore returns a Score representing the music in this MusicGraph. |
static boolean[][] |
copyBoolMatrix(boolean[][] m)
Helper function. |
MotherGraph |
deepClone()
A deep clone not only makes a clone of the 'vertices' and 'edges' Vectors of references to MusicVertex and
MusicEdge objects but also clones these objects; the
resulting graph thus points to objects that are not owned by
any other graphs and thus must be a MotherGraph. |
boolean |
equals(MusicGraph other)
If this MusicGraph contains() the other MusicGraph, and the other MusicGraph contains() this MusicGraph, true is returned, otherwise false. |
MusicVertex |
findVertexAt(java.awt.Point p)
Searches for a vertex based on its graphic layout - if it clips p, it is returned. |
java.util.Vector |
getAllPossibleRightExtended(java.util.Vector subs)
Gives a Vector of SeqSubgraph which are all the
possible right extensions of the SeqSubgraphs in the input
Vector; considers only right extensions possible inside this
graph whether its a subgraph or not. |
java.util.Vector |
getAllPossibleRightSlides(java.util.Vector subs)
Gives a Vector of SeqSubgraph which are all the
possible right slides of the SeqSubgraphs in the input Vector;
Considers only right slides possible inside this graph whether
its a subgraph or not. |
abstract java.util.Vector |
getAllProperFollowInEdges(boolean includeWeakEdges)
|
abstract java.util.Vector |
getAllProperFollowOutEdges(boolean includeWeakEdges)
|
abstract java.util.Vector |
getAllProperInEdges(boolean includeWeakEdges)
|
abstract java.util.Vector |
getAllProperOutEdges(boolean includeWeakEdges)
|
java.util.Vector |
getAllSequentialSubgraphsOfSize(int size)
Like getAllSequentialSubgraphsOfSize(int size), but includes weak FOLLOW edges. |
java.util.Vector |
getAllStrongSequentialSubgraphsOfSize(int size)
Returns a Vector of SeqSubgraph . |
java.util.Vector |
getBeginningSubgraphSet(int size)
Gives a Vector of SeqSubgraph which are all the
possible sequential subgraphs of a given length (size) whose
first MusicVertex is one of the first vertices in this
MusicGraph. |
boolean[][] |
getClosure(boolean includeSimEdges,
boolean includeWeakEdges)
Constructs an incidence matrix describing which vertices are connected to which other vertices. |
double |
getMaxEndtime()
Returns the greatest end time found in the 'vertices' Vector. |
abstract int |
getMaximalSequentialSubgraphSize()
|
double |
getMinStarttime()
Returns the least start time found in the 'vertices' Vector. |
abstract MotherGraph |
getMotherGraph()
|
double |
getNestedRestPercentage()
Returns the nestedNumberOfRests divided by the nestedSize. |
java.util.Vector |
getNestedVertexList()
Returns a vector of SimpleVertex 's all contained in
this musicgraph or inside CompoundVertex 's inside
it. |
java.util.Vector |
getNextGroup()
This method is the heart of the group tokenizer built into the MusicGraph class; it finds and returns a Vector of MusicVertex. initGroupTokenizer() must have been called before using this method. |
java.util.Vector |
getNSequentialSubgraphsOfSize(int n,
int size)
Returns a Vector of at least n sequential subgraphs of size 'size'. |
abstract jm.music.data.Score |
getScore()
GetScore returns a pointer to the original Score that this MusicGraph's mothergraph was created from. |
java.util.Vector |
getStrongSinks()
Returns a Vector of all MusicVertices that have no outEdges of type FOLLOWS |
java.util.Vector |
getStrongSources()
Returns a Vector of all MusicVertices that have no inEdges of type FOLLOWS. |
boolean[][] |
getTransitiveClosure(boolean includeSimEdges,
boolean includeWeakEdges)
Constructs a matrix describing which vertices can be reached from which other vertices. |
boolean |
graphicLayoutDone()
A method used in connection with the GUI part of the SimFinder system; it returns true if all vertices and all edges have been assigned a position in the graphical layout. |
boolean |
graphIsConnected(boolean includeSimEdges,
boolean includeWeakEdges)
Determines whether this graph is connected, with or without SIMULTANEOUS, WEAKFOLLOWS and WEAKSIMULTANEOUS edges, according to the parameters. |
boolean |
hasInterpartEdges()
Returns true if there are any edges in this graph that connect two vertices belonging to different Parts; if there are, this is a non-partwise graph, otherwise it is a partwise graph. |
boolean |
hasMusedata()
Returns true if there is information originating from a MuseData file in any vertices in this graph; in particular, pitch spelling. |
boolean |
initGroupTokenizer(double d)
The group tokenizer is a mechanism built into this class which allows us to group nodes that are simultaneous (d=0.0) or within some distance d. |
boolean |
isSimpleGraph()
Returns true if there are no CompoundVertex in this
graph. |
int |
maxUsage()
Returns the maximal value of the usage counter in every vertex in this MusicGraph. |
int |
nestedNumberOfRests()
Returns the number of vertices in this MusicGraph that represent a rest, plus the nestedNumberOfRests of the subgraphs inside any CompoundVertex 's in this
MusicGraph. |
int |
nestedNumOfCompoundVertices()
The nested version of numOfCompoundVertices(). |
int |
nestedSize()
Recursive definition: Returns the number of vertices in this graph plus the nested size of any compound vertices contained in this graph. |
int |
nestingDepth()
Returns how deep a tree we may descend into if we look inside the compound vertices contained in this graph; in other words, how many compound vertices are contained inside each other in this graph. |
int |
numOfCompoundVertices()
Returns the number of CompoundVertex in this graph. |
int |
overlap(MusicGraph other)
Returns the sum of the number of vertices and the number of edges that this MusicGraph has in common with the other; this is mostly useful for comparing Subgraph s. |
static void |
prettyPrintBoolMatrix(boolean[][] b)
For debugging. |
void |
printAllDist()
For debugging. |
int |
size()
Returns the number of simple or compound vertices in this graph; see also method nestedSize(). |
void |
sortEdges()
Deprecated. Not used any more. Use sortVerticesByStarttime() instead. |
void |
sortVertexVectorByStarttime(java.util.Vector vert)
Sorts the input Vector of MusicVertex by start
time. |
void |
sortVerticesByStarttime()
A helper function that calls the sortVertexVectorByStarttime() with the 'vertices' Vector as a parameter. |
int |
testIntegrity()
For debugging. |
java.lang.String |
toString()
Returns a string with the toString's of all vertices and edges in this MusicGraph. |
static boolean[][] |
transitiveClosureOf(boolean[][] res)
Helper function. |
boolean |
vertexAtIndexSplitsSubgraph(int index,
boolean[][] originalClosure)
Uses the transitive closure of the graph to determine if removing the vertex at the specified index in the "vertices" Vector would split this MusicGraph into two unconnected halves. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public java.util.Vector vertices
MusicVertex
.
public java.util.Vector edges
MusicEdge
.
public java.lang.String title
Constructor Detail |
public MusicGraph()
Method Detail |
public int size()
public int nestedSize()
SimpleVertex
contained in this MusicGraph and all of its
inner CompoundVertex
's.
public java.util.Vector getStrongSources()
public java.util.Vector getStrongSinks()
public void checkSorting()
public boolean initGroupTokenizer(double d)
public java.util.Vector getNextGroup()
public boolean vertexAtIndexSplitsSubgraph(int index, boolean[][] originalClosure)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(MusicGraph other)
public boolean contains(MusicGraph other)
public int overlap(MusicGraph other)
Subgraph
s. "Having in
common" means that both MusicGraphs are pointing to the same
MusicVertex
or MusicEdge
objects. A
MusicVertex or MusicEdge object is always owned by some MotherGraph
.
public void sortVerticesByStarttime()
public void sortVertexVectorByStarttime(java.util.Vector vert)
MusicVertex
by start
time.
public void sortEdges()
public abstract java.lang.Object clone()
clone
in class java.lang.Object
public java.util.Vector getAllStrongSequentialSubgraphsOfSize(int size)
SeqSubgraph
. CAREFUL!! The
complexity of this method easily exceeds anything computable in
realistic time! Consider using its little brother,
getNSequentialSubgraphsOfSize() instead.
public java.util.Vector getAllSequentialSubgraphsOfSize(int size)
public java.util.Vector getNSequentialSubgraphsOfSize(int n, int size)
public abstract MotherGraph getMotherGraph()
public abstract int getMaximalSequentialSubgraphSize()
public java.util.Vector getBeginningSubgraphSet(int size)
SeqSubgraph
which are all the
possible sequential subgraphs of a given length (size) whose
first MusicVertex is one of the first vertices in this
MusicGraph.
public java.util.Vector getAllPossibleRightExtended(java.util.Vector subs)
SeqSubgraph
which are all the
possible right extensions of the SeqSubgraphs in the input
Vector; considers only right extensions possible inside this
graph whether its a subgraph or not.
public java.util.Vector getAllPossibleRightSlides(java.util.Vector subs)
SeqSubgraph
which are all the
possible right slides of the SeqSubgraphs in the input Vector;
Considers only right slides possible inside this graph whether
its a subgraph or not.
public abstract java.util.Vector getAllProperFollowInEdges(boolean includeWeakEdges)
public abstract java.util.Vector getAllProperFollowOutEdges(boolean includeWeakEdges)
public abstract java.util.Vector getAllProperInEdges(boolean includeWeakEdges)
public abstract java.util.Vector getAllProperOutEdges(boolean includeWeakEdges)
public boolean graphIsConnected(boolean includeSimEdges, boolean includeWeakEdges)
public boolean[][] getClosure(boolean includeSimEdges, boolean includeWeakEdges)
public boolean[][] getTransitiveClosure(boolean includeSimEdges, boolean includeWeakEdges)
public static boolean[][] transitiveClosureOf(boolean[][] res)
public static boolean[][] copyBoolMatrix(boolean[][] m)
public static boolean boolMatrixEqual(boolean[][] m1, boolean[][] m2)
public static boolean[][] boolMatrixMultiply(boolean[][] m1, boolean[][] m2)
public static void prettyPrintBoolMatrix(boolean[][] b)
public abstract jm.music.data.Score getScore()
public abstract jm.music.data.Score convertToScore()
public double getNestedRestPercentage()
public int nestedNumberOfRests()
CompoundVertex
's in this
MusicGraph.
public int maxUsage()
public double getMinStarttime()
public double getMaxEndtime()
public boolean isSimpleGraph()
CompoundVertex
in this
graph.
public int numOfCompoundVertices()
CompoundVertex
in this graph.
public int nestedNumOfCompoundVertices()
public int nestingDepth()
public java.util.Vector getNestedVertexList()
SimpleVertex
's all contained in
this musicgraph or inside CompoundVertex
's inside
it. This in effect is a flattening of the hierarchical
structure, but without edges.
public boolean hasInterpartEdges()
public boolean hasMusedata()
public MotherGraph deepClone()
MusicVertex
and
MusicEdge
objects but also clones these objects; the
resulting graph thus points to objects that are not owned by
any other graphs and thus must be a MotherGraph.
public boolean graphicLayoutDone()
public MusicVertex findVertexAt(java.awt.Point p)
public int testIntegrity()
public void printAllDist()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |