Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
aac2ea60
Commit
aac2ea60
authored
May 19, 2012
by
Davis King
Browse files
Clarified spec and added more tests.
parent
31e6568f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
dlib/graph_cuts/min_cut_abstract.h
dlib/graph_cuts/min_cut_abstract.h
+1
-1
dlib/test/graph_cuts.cpp
dlib/test/graph_cuts.cpp
+14
-0
No files found.
dlib/graph_cuts/min_cut_abstract.h
View file @
aac2ea60
...
...
@@ -429,7 +429,7 @@ namespace dlib
- #g.get_flow(i,j) == the residual flow capacity left after the max
possible amount of flow is passing from the source node to the sink
node. For example, this means that #g.get_flow(i,j) == 0 whenever
node i and j
are
in
different cuts
.
node i
is in the SOURCE_CUT
and j
is
in
the SINK_CUT
.
- #g.get_flow(i,j) >= 0
!*/
...
...
dlib/test/graph_cuts.cpp
View file @
aac2ea60
...
...
@@ -756,6 +756,20 @@ namespace
print_graph
(
g1
);
// make sure the flow residuals are 0 at the cut locations
for
(
unsigned
long
i
=
0
;
i
<
g1
.
number_of_nodes
();
++
i
)
{
for
(
unsigned
long
j
=
0
;
j
<
g1
.
node
(
i
).
number_of_children
();
++
j
)
{
if
((
g1
.
node
(
i
).
data
==
SOURCE_CUT
&&
g1
.
node
(
i
).
child
(
j
).
data
!=
SOURCE_CUT
)
||
(
g1
.
node
(
i
).
data
!=
SINK_CUT
&&
g1
.
node
(
i
).
child
(
j
).
data
==
SINK_CUT
)
)
{
DLIB_TEST_MSG
(
g1
.
node
(
i
).
child_edge
(
j
)
==
0
,
g1
.
node
(
i
).
child_edge
(
j
));
}
}
}
// copy the edge weights from g2 back to g1 so we can compute cut scores
copy_edge_weights
(
g1
,
g2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment