LabelType
- This type allows for the labels to be any object type or
enumpublic interface EnergyFunction<LabelType>
Modifier and Type | Method and Description |
---|---|
Pair<java.lang.Integer,java.lang.Integer> |
getEdge(int i)
Returns the indices for the two endpoints in the specified path.
|
double |
getPairwiseCost(int edgeId,
LabelType ilabel,
LabelType jlabel)
This is the -log(getPairwisePotential(.)).
|
double |
getPairwisePotential(int edgeId,
LabelType ilabel,
LabelType jlabel)
Returns the pairwise cost of node i being assigned label_i and node j
being assigned label_j.
|
java.util.Collection<LabelType> |
getPossibleLabels(int nodeId)
Returns the set of labels that this message passer supports
|
double |
getUnaryCost(int i,
LabelType label)
This is the -log(getUnaryPotential(.)).
|
double |
getUnaryPotential(int i,
LabelType label)
Returns the unary cost for node i having the input label.
|
int |
numEdges()
Returns the number of paths that messages should be passed down.
|
int |
numNodes()
Returns the number of nodes in the energy function.
|
java.util.Collection<LabelType> getPossibleLabels(int nodeId)
nodeId
- The node whose labels is wantedint numEdges()
getEdge(int)
method, all paths can be
retrieved.int numNodes()
Pair<java.lang.Integer,java.lang.Integer> getEdge(int i)
numEdges()
- 1) should return a non-null value. All path IDs outside that range
should throw an Exception.i
- The path ID (should be in [0 ... numEdges()
) ).#getUnaryCost(int)
and #getPairwisePotential(int, int, Object, Object)
)double getUnaryPotential(int i, LabelType label)
getEdge(int)
. If not, an exception
should be thrown.i
- The index of the node whose unary cost should be returnedlabel
- The label that could be applied to the nodedouble getPairwisePotential(int edgeId, LabelType ilabel, LabelType jlabel)
getEdge(int)
in the ordere specified by the returned pair (i
= getFirst, j = getSecond). If not, an exception should be thrown.edgeId
- The id for the edge being requestedilabel
- The label being (possibly) assigned to node ijlabel
- The label being (possibly) assigned to node jdouble getUnaryCost(int i, LabelType label)
i
- label
-