Fixed tabs and trailing whitespaces
[libdai.git] / tests / testbbp.cpp
index 502d869..a0ffb1c 100644 (file)
@@ -38,14 +38,13 @@ int main( int argc, char *argv[] ) {
         // Read FactorGraph from the file specified by the first command line argument
         FactorGraph fg;
         fg.ReadFromFile(argv[1]);
-        
+
         // Set some constants
         size_t verbose = 0;
         double tol = 1.0e-9;
         size_t maxiter = 10000;
         double damping = 0.0;
         BBP::Properties::UpdateType updates = BBP::Properties::UpdateType::PAR;
-        bool   clean_updates = false;
 
         // Store the constants in a PropertySet object
         PropertySet opts;
@@ -62,10 +61,9 @@ int main( int argc, char *argv[] ) {
 
         vector<size_t> state( fg.nrVars(), 0 );
 
-        for( size_t t = 0; t < 90; t++ ) {
-            clean_updates = t % 2;
+        for( size_t t = 0; t < 45; t++ ) {
             BBP::Properties::UpdateType updates;
-            switch( (t / 2) % 5 ) {
+            switch( t % 5 ) {
                 case BBP::Properties::UpdateType::SEQ_FIX:
                     updates = BBP::Properties::UpdateType::SEQ_FIX;
                     break;
@@ -83,39 +81,39 @@ int main( int argc, char *argv[] ) {
                     break;
             }
             bbp_cfn_t cfn;
-            switch( (t / 10) % 9 ) {
+            switch( (t / 5) % 9 ) {
                 case 0:
-                    cfn = bbp_cfn_t::cfn_gibbs_b;
+                    cfn = bbp_cfn_t::CFN_GIBBS_B;
                     break;
                 case 1:
-                    cfn = bbp_cfn_t::cfn_gibbs_b2;
+                    cfn = bbp_cfn_t::CFN_GIBBS_B2;
                     break;
                 case 2:
-                    cfn = bbp_cfn_t::cfn_gibbs_exp;
+                    cfn = bbp_cfn_t::CFN_GIBBS_EXP;
                     break;
                 case 3:
-                    cfn = bbp_cfn_t::cfn_gibbs_b_factor;
+                    cfn = bbp_cfn_t::CFN_GIBBS_B_FACTOR;
                     break;
                 case 4:
-                    cfn = bbp_cfn_t::cfn_gibbs_b2_factor;
+                    cfn = bbp_cfn_t::CFN_GIBBS_B2_FACTOR;
                     break;
                 case 5:
-                    cfn = bbp_cfn_t::cfn_gibbs_exp_factor;
+                    cfn = bbp_cfn_t::CFN_GIBBS_EXP_FACTOR;
                     break;
                 case 6:
-                    cfn = bbp_cfn_t::cfn_var_ent;
+                    cfn = bbp_cfn_t::CFN_VAR_ENT;
                     break;
                 case 7:
-                    cfn = bbp_cfn_t::cfn_factor_ent;
+                    cfn = bbp_cfn_t::CFN_FACTOR_ENT;
                     break;
                 case 8:
-                    cfn = bbp_cfn_t::cfn_bethe_ent;
+                    cfn = bbp_cfn_t::CFN_BETHE_ENT;
                     break;
             }
 
             double h = 1e-4;
-            double result = numericBBPTest( bp, &state, opts("updates",updates)("clean_updates",clean_updates), cfn, h );
-            cout << "clean_updates=" << clean_updates << ", updates=" << updates << ", cfn=" << cfn << ", result: " << result << endl;
+            double result = numericBBPTest( bp, &state, opts("updates",updates), cfn, h );
+            cout << "result: " << result << ",\tupdates=" << updates << ", cfn=" << cfn << endl;
         }
     }