Fixed testem failure caused by rounding error
[libdai.git] / include / dai / prob.h
index 238f32f..4b85374 100644 (file)
@@ -370,7 +370,7 @@ template <typename T> class TProb {
             TProb<T> x;
             x._p.reserve( size() );
             for( size_t i = 0; i < size(); i++ )
-                x._p.push_back( _p[i] < 0 ? (-p[i]) : p[i] );
+                x._p.push_back( _p[i] < 0 ? (-_p[i]) : _p[i] );
             return x;
         }
 
@@ -455,7 +455,7 @@ template <typename T> class TProb {
                 arg = i;
               }
             }
-            return make_pair(arg,max);
+            return std::make_pair(arg,max);
         }
 
         /// Normalizes vector using the specified norm