Commit 3b4a2308 authored by Davis King's avatar Davis King

Clarified spec regarding infinite factor potentials and flow capacities.

parent 1bcab299
...@@ -138,6 +138,9 @@ namespace dlib ...@@ -138,6 +138,9 @@ namespace dlib
node the label of true. The larger the value, the more desirable it is node the label of true. The larger the value, the more desirable it is
to give it this label. Similarly, a negative value indicates that it is to give it this label. Similarly, a negative value indicates that it is
better to give the node a label of false. better to give the node a label of false.
- It is valid for the returned value to be positive or negative infinity.
A value of positive infinity indicates that the idx-th node must be labeled
true while negative infinity means it must be labeled false.
!*/ !*/
value_type factor_value_disagreement ( value_type factor_value_disagreement (
...@@ -156,6 +159,7 @@ namespace dlib ...@@ -156,6 +159,7 @@ namespace dlib
different labels. Larger values indicate a larger penalty. different labels. Larger values indicate a larger penalty.
- this function is symmetric. That is, it is true that: - this function is symmetric. That is, it is true that:
factor_value_disagreement(i,j) == factor_value_disagreement(j,i) factor_value_disagreement(i,j) == factor_value_disagreement(j,i)
- The return value should be a finite value.
!*/ !*/
}; };
...@@ -218,6 +222,9 @@ namespace dlib ...@@ -218,6 +222,9 @@ namespace dlib
node the label of true. The larger the value, the more desirable it is node the label of true. The larger the value, the more desirable it is
to give it this label. Similarly, a negative value indicates that it is to give it this label. Similarly, a negative value indicates that it is
better to give the node a label of false. better to give the node a label of false.
- It is valid for the returned value to be positive or negative infinity.
A value of positive infinity indicates that the idx-th node must be labeled
true while negative infinity means it must be labeled false.
!*/ !*/
value_type factor_value_disagreement ( value_type factor_value_disagreement (
...@@ -241,6 +248,7 @@ namespace dlib ...@@ -241,6 +248,7 @@ namespace dlib
different labels. Larger values indicate a larger penalty. different labels. Larger values indicate a larger penalty.
- this function is symmetric. That is, it is true that: - this function is symmetric. That is, it is true that:
factor_value_disagreement(i,j) == factor_value_disagreement(j,i) factor_value_disagreement(i,j) == factor_value_disagreement(j,i)
- The return value should be a finite value.
!*/ !*/
}; };
......
...@@ -268,8 +268,9 @@ namespace dlib ...@@ -268,8 +268,9 @@ namespace dlib
- idx2 < number_of_nodes() - idx2 < number_of_nodes()
- idx1 and idx2 are neighbors in the graph - idx1 and idx2 are neighbors in the graph
ensures ensures
- returns the residual flow capacity from the idx1-th - returns the residual flow capacity from the idx1-th node to the idx2-th node.
node to the idx2-th node. - It is valid for this function to return a floating point value of infinity.
This value means this edge has an unlimited capacity.
!*/ !*/
edge_type get_flow ( edge_type get_flow (
...@@ -283,6 +284,8 @@ namespace dlib ...@@ -283,6 +284,8 @@ namespace dlib
- let IDX = node_id(it) - let IDX = node_id(it)
- it represents the directed edge from a node, call it H, to the node IDX. Therefore, - it represents the directed edge from a node, call it H, to the node IDX. Therefore,
this function returns get_flow(H,IDX) this function returns get_flow(H,IDX)
- It is valid for this function to return a floating point value of infinity.
This value means this edge has an unlimited capacity.
!*/ !*/
edge_type get_flow ( edge_type get_flow (
...@@ -296,6 +299,8 @@ namespace dlib ...@@ -296,6 +299,8 @@ namespace dlib
- let IDX = node_id(it) - let IDX = node_id(it)
- it represents the directed edge from node IDX to another node, call it H. Therefore, - it represents the directed edge from node IDX to another node, call it H. Therefore,
this function returns get_flow(IDX,H) this function returns get_flow(IDX,H)
- It is valid for this function to return a floating point value of infinity.
This value means this edge has an unlimited capacity.
!*/ !*/
void adjust_flow ( void adjust_flow (
...@@ -398,7 +403,7 @@ namespace dlib ...@@ -398,7 +403,7 @@ namespace dlib
- sink_node < g.number_of_nodes() - sink_node < g.number_of_nodes()
- for all valid i and j: - for all valid i and j:
- g.get_flow(i,j) >= 0 - g.get_flow(i,j) >= 0
(i.e. all the flow capacities/edge weights are positive) (i.e. all the flow capacities/edge weights are non-negative)
- g does not contain any self loops. That is, no nodes are neighbors with - g does not contain any self loops. That is, no nodes are neighbors with
themselves. themselves.
ensures ensures
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment