[opengm] 27/40: add ibfs test
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Sun Feb 14 16:06:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository opengm.
commit 9db36205bd8734495b647da5b1166e8c707688c8
Author: joergkappes <kappes at math.uni-heidelberg.de>
Date: Fri Dec 4 13:54:24 2015 +0100
add ibfs test
---
src/unittest/inference/test_ibfs.cxx | 39 ++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/src/unittest/inference/test_ibfs.cxx b/src/unittest/inference/test_ibfs.cxx
new file mode 100644
index 0000000..52f3b0d
--- /dev/null
+++ b/src/unittest/inference/test_ibfs.cxx
@@ -0,0 +1,39 @@
+#include <stdlib.h>
+#include <vector>
+#include <set>
+#include <functional>
+#include <iostream>
+
+
+#ifdef WITH_MAXFLOW_IBFS
+# include <opengm/inference/auxiliary/minstcutibfs.hxx>
+#endif
+
+int main() {
+#ifdef WITH_MAXFLOW_IBFS
+ typedef opengm::external::MinSTCutIBFS<int, int> MinStCutType;
+
+ MinStCutType g(5,2+3*2);
+
+ g.addEdge(0,2,1000);
+ g.addEdge(0,3,1);
+ g.addEdge(0,4,1);
+
+ g.addEdge(2,1,5);
+ g.addEdge(3,1,5);
+ g.addEdge(4,1,5);
+
+ g.addEdge(2,3,1);
+ g.addEdge(3,4,1);
+
+
+ std::vector<bool> x(5);
+ g.calculateCut(x);
+
+ for(size_t i=0; i<x.size(); ++i)
+ std::cout <<x[i]<< " ";
+ std::cout << std::endl;
+
+#endif
+ return 0;
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opengm.git
More information about the debian-science-commits
mailing list