Various fixes to make libDAI build successfully under modern OSX versions
[libdai.git] / tests / testdai.cpp
index b96f7c6..d15f30a 100644 (file)
@@ -121,7 +121,7 @@ class TestDAI {
                     logZ = obj->logZ();
                     has_logZ = true;
                 } catch( Exception &e ) {
-                    if( e.code() == Exception::NOT_IMPLEMENTED )
+                    if( e.getCode() == Exception::NOT_IMPLEMENTED )
                         has_logZ = false;
                     else
                         throw;
@@ -132,7 +132,7 @@ class TestDAI {
                     maxdiff = obj->maxDiff();
                     has_maxdiff = true;
                 } catch( Exception &e ) {
-                    if( e.code() == Exception::NOT_IMPLEMENTED )
+                    if( e.getCode() == Exception::NOT_IMPLEMENTED )
                         has_maxdiff = false;
                     else
                         throw;
@@ -143,7 +143,7 @@ class TestDAI {
                     iters = obj->Iterations();
                     has_iters = true;
                 } catch( Exception &e ) {
-                    if( e.code() == Exception::NOT_IMPLEMENTED )
+                    if( e.getCode() == Exception::NOT_IMPLEMENTED )
                         has_iters = false;
                     else
                         throw;
@@ -160,7 +160,7 @@ class TestDAI {
                     try {
                         facMarginals.push_back( obj->beliefF( I ) );
                     } catch( Exception &e ) {
-                        if( e.code() == Exception::BELIEF_NOT_AVAILABLE )
+                        if( e.getCode() == Exception::BELIEF_NOT_AVAILABLE )
                             facMarginals.push_back( Factor( obj->fg().factor(I).vars(), INFINITY ) );
                         else
                             throw;
@@ -361,7 +361,7 @@ int main( int argc, char *argv[] ) {
             // If this is not the base method
             if( m > 0 ) {
                 cout.setf( ios_base::scientific );
-                cout.precision( 3 );
+                cout.precision( 2 );
 
                 // Output maximum error in variable marginals
                 Real mev = clipReal( testdai.maxVarErr(), 1e-9 );