Two small bugfixes
authorJoris Mooij <jorism@marvin.jorismooij.nl>
Sat, 13 Sep 2008 17:00:16 +0000 (19:00 +0200)
committerJoris Mooij <jorism@marvin.jorismooij.nl>
Sat, 13 Sep 2008 17:00:16 +0000 (19:00 +0200)
example.cpp
include/dai/bipgraph.h

index 27c244d..53adcfc 100644 (file)
@@ -61,7 +61,7 @@ int main( int argc, char *argv[] ) {
             bp.init();
             bp.run();
 
-            cout << "Exact single node marginals:" << endl;
+            cout << "Approximate (loopy belief propagation) single node marginals:" << endl;
             for( size_t i = 0; i < fg.nrVars(); i++ )
                 cout << bp.belief(fg.var(i)) << endl;
         }
index 233f455..d6e720e 100644 (file)
@@ -26,6 +26,7 @@
 #include <ostream>
 #include <vector>
 #include <cassert>
+#include <algorithm>
 #include <dai/util.h>
 
 
@@ -260,7 +261,7 @@ class BipartiteGraph {
                     if( include || (m1 != n1) )
                         result.push_back( m1 );
             // remove duplicates
-            std::vector<size_t>::iterator it = unique( result.begin(), result.end() );
+            std::vector<size_t>::iterator it = std::unique( result.begin(), result.end() );
             result.erase( it, result.end() );
             return result;
         }
@@ -275,7 +276,7 @@ class BipartiteGraph {
                     if( include || (m2 != n2) )
                         result.push_back( m2 );
             // remove duplicates
-            std::vector<size_t>::iterator it = unique( result.begin(), result.end() );
+            std::vector<size_t>::iterator it = std::unique( result.begin(), result.end() );
             result.erase( it, result.end() );
             return result;
         }