public final class HighCapacityDagLevel extends java.lang.Object implements DagLevel
Class HighCapacityDagLevel represents a level of a leveled
directed acyclic graph (DAG) that can contain up to
Integer.MAX_VALUE edges.
Instances of HighCapacityDagLevel are immutable.
| Constructor and Description |
|---|
HighCapacityDagLevel(int[] parentNodes,
int[] childNodes,
int[] symbols,
float[] counts)
Constructs a new
HighCapacityDagLevel instance from the
specified data. |
| Modifier and Type | Method and Description |
|---|---|
int |
childNode(int edge)
Returns the index of the child node of the specified edge
at this level of the DAG.
|
float |
condEdgeProb(int edge)
Returns the conditional edge probability, which is defined to be
the ratio of the sum of the weights of the sequences that pass
through the specified edge at this level of the DAG and
the sum of the weights of the sequences that pass through the parent
node of the specified edge.
|
float |
edgeProb(int edge)
Returns the edge probability, which is defined to be the ratio of the
sum of the weights of the sequences that pass through the specified
edge at this level of the DAG and the sum of the weights of the
sequences that pass through any edge at this level of the DAG.
|
float |
edgeWeight(int edge)
Returns the sum of weights for the sequences that pass
through the specified edge at this level of the DAG.
|
int |
inEdge(int childNode,
int inEdgeIndex)
Returns the index of the specified edge at this level of the DAG.
|
int |
nChildNodes()
Returns the number of child nodes at this level of the DAG.
|
int |
nEdges()
Returns the number of edges at this level of the DAG.
|
int |
nInEdges(int childNode)
Returns the number of ingoing edges for the specified child node
at this level of the DAG.
|
int |
nOutEdges(int parentNode)
Returns the number of outgoing edges of the specified parent node
at this level of the DAG.
|
int |
nParentNodes()
Returns the number of parent nodes at this level of the DAG.
|
int |
outEdge(int parentNode,
int outEdgeIndex)
Returns the index of the specified edge at this level of the DAG.
|
int |
outEdgeBySymbol(int parentNode,
int symbol)
Returns the index of the specified edge at this level of the
DAG or
-1 if no such edge exists. |
int |
parentNode(int edge)
Returns the index of the parent node of the specified edge
at this level of the DAG.
|
float |
parentProb(int node)
Returns the parent node probability, which is defined to be the
ratio of the sum of the weights of the sequences that pass through
the specified parent node at this level of the DAG and the sum of
the weights of the sequences that pass through any parent node at this
level of the DAG.
|
float |
parentWeight(int parentNode)
Returns the sum of weights for the sequences that pass
through the specified node at this level of the DAG.
|
int |
symbol(int edge)
Returns the symbol labeling the specified edge at this level
of the DAG.
|
java.lang.String |
toString()
Returns a string representation of
this. |
public HighCapacityDagLevel(int[] parentNodes,
int[] childNodes,
int[] symbols,
float[] counts)
HighCapacityDagLevel instance from the
specified data.parentNodes - an array mapping edge index to parent node indexchildNodes - an array mapping edge index to child node indexsymbols - an array mapping edge index to the symbol labeling the
edgecounts - an array mapping edge index to edge countjava.lang.IllegalArgumentException - if the specified arrays do not all
have the same lengthjava.lang.IllegalArgumentException - if any element of the symbols array
is negativejava.lang.IllegalArgumentException - if any two edges have the same
parent node and are both labeled with the same symboljava.lang.IllegalArgumentException - if the set of values of the
parentNodes array is not equal to {0, 1, 2, ..., k} for
some kjava.lang.IllegalArgumentException - if the set of values of the
childNodes array is not equal to {0, 1, 2, ..., k}
for some kjava.lang.NullPointerException - if any parameter is nullpublic int nEdges()
DagLevelpublic int nParentNodes()
DagLevelnParentNodes in interface DagLevelpublic int nChildNodes()
DagLevelnChildNodes in interface DagLevelpublic int parentNode(int edge)
DagLevelparentNode in interface DagLeveledge - an edge indexpublic int childNode(int edge)
DagLevelpublic int symbol(int edge)
DagLevelpublic float edgeWeight(int edge)
DagLeveledgeWeight in interface DagLeveledge - an edge indexpublic float parentWeight(int parentNode)
DagLevelparentWeight in interface DagLevelparentNode - a parent node indexpublic float condEdgeProb(int edge)
DagLevelcondEdgeProb in interface DagLeveledge - an edge indexpublic float edgeProb(int edge)
DagLevelpublic float parentProb(int node)
DagLevelparentProb in interface DagLevelnode - a parent node indexpublic int nOutEdges(int parentNode)
DagLevelpublic int outEdge(int parentNode,
int outEdgeIndex)
DagLevelpublic int outEdgeBySymbol(int parentNode,
int symbol)
DagLevel-1 if no such edge exists.outEdgeBySymbol in interface DagLevelparentNode - a parent node indexsymbol - a symbol labeling an outgoing edge of the specified
parent node-1 if no such edge existspublic int nInEdges(int childNode)
DagLevelpublic int inEdge(int childNode,
int inEdgeIndex)
DagLevelpublic java.lang.String toString()
DagLevelthis. The exact
details of the representation are unspecified and subject to change.