Improved documentation of factor.h, ...
[libdai.git] / src / mf.cpp
index 766acc7..ae92182 100644 (file)
@@ -116,9 +116,9 @@ double MF::run() {
             foreach( const Neighbor &j, nbF(I) ) // for all j in I \ i
                 if( j != i )
                     henk *= _beliefs[j];
             foreach( const Neighbor &j, nbF(I) ) // for all j in I \ i
                 if( j != i )
                     henk *= _beliefs[j];
-            piet = factor(I).log0();
+            piet = factor(I).log(true);
             piet *= henk;
             piet *= henk;
-            piet = piet.partSum(var(i));
+            piet = piet.marginal(var(i), false);
             piet = piet.exp();
             jan *= piet; 
         }
             piet = piet.exp();
             jan *= piet; 
         }
@@ -199,7 +199,7 @@ Real MF::logZ() const {
             henk *= _beliefs[j];
         henk.normalize();
         Factor piet;
             henk *= _beliefs[j];
         henk.normalize();
         Factor piet;
-        piet = factor(I).log0();
+        piet = factor(I).log(true);
         piet *= henk;
         sum -= piet.totalSum();
     }
         piet *= henk;
         sum -= piet.totalSum();
     }