Some small documentation updates
[libdai.git] / src / bbp.cpp
index 2d329dc..b4bd072 100644 (file)
@@ -157,7 +157,7 @@ void BBP::RegenerateInds() {
         _indices[i].reserve( _fg->nbV(i).size() );
         foreach( const Neighbor &I, _fg->nbV(i) ) {
             _ind_t index;
-            index.reserve( _fg->factor(I).states() );
+            index.reserve( _fg->factor(I).nrStates() );
             for( IndexFor k(_fg->var(i), _fg->factor(I).vars()); k.valid(); ++k )
                 index.push_back( k );
             _indices[i].push_back( index );
@@ -167,49 +167,49 @@ void BBP::RegenerateInds() {
 
 
 void BBP::RegenerateT() {
-    // _T[i][_I]
-    _T.resize( _fg->nrVars() );
+    // _Tmsg[i][_I]
+    _Tmsg.resize( _fg->nrVars() );
     for( size_t i = 0; i < _fg->nrVars(); i++ ) {
-        _T[i].resize( _fg->nbV(i).size() );
+        _Tmsg[i].resize( _fg->nbV(i).size() );
         foreach( const Neighbor &I, _fg->nbV(i) ) {
             Prob prod( _fg->var(i).states(), 1.0 );
             foreach( const Neighbor &J, _fg->nbV(i) )
                 if( J.node != I.node )
                     prod *= _bp_dual.msgM( i, J.iter );
-            _T[i][I.iter] = prod;
+            _Tmsg[i][I.iter] = prod;
         }
     }
 }
 
 
 void BBP::RegenerateU() {
-    // _U[I][_i]
-    _U.resize( _fg->nrFactors() );
+    // _Umsg[I][_i]
+    _Umsg.resize( _fg->nrFactors() );
     for( size_t I = 0; I < _fg->nrFactors(); I++ ) {
-        _U[I].resize( _fg->nbF(I).size() );
+        _Umsg[I].resize( _fg->nbF(I).size() );
         foreach( const Neighbor &i, _fg->nbF(I) ) {
-            Prob prod( _fg->factor(I).states(), 1.0 );
+            Prob prod( _fg->factor(I).nrStates(), 1.0 );
             foreach( const Neighbor &j, _fg->nbF(I) )
                 if( i.node != j.node ) {
                     Prob n_jI( _bp_dual.msgN( j, j.dual ) );
                     const _ind_t &ind = _index( j, j.dual );
                     // multiply prod by n_jI
                     for( size_t x_I = 0; x_I < prod.size(); x_I++ )
-                        prod[x_I] *= n_jI[ind[x_I]];
+                        prod.set( x_I, prod[x_I] * n_jI[ind[x_I]] );
                 }
-            _U[I][i.iter] = prod;
+            _Umsg[I][i.iter] = prod;
         }
     }
 }
 
 
 void BBP::RegenerateS() {
-    // _S[i][_I][_j]
-    _S.resize( _fg->nrVars() );
+    // _Smsg[i][_I][_j]
+    _Smsg.resize( _fg->nrVars() );
     for( size_t i = 0; i < _fg->nrVars(); i++ ) {
-        _S[i].resize( _fg->nbV(i).size() );
+        _Smsg[i].resize( _fg->nbV(i).size() );
         foreach( const Neighbor &I, _fg->nbV(i) ) {
-            _S[i][I.iter].resize( _fg->nbF(I).size() );
+            _Smsg[i][I.iter].resize( _fg->nbF(I).size() );
             foreach( const Neighbor &j, _fg->nbF(I) )
                 if( i != j ) {
                     Factor prod( _fg->factor(I) );
@@ -217,14 +217,14 @@ void BBP::RegenerateS() {
                         if( k != i && k.node != j.node ) {
                             const _ind_t &ind = _index( k, k.dual );
                             Prob p( _bp_dual.msgN( k, k.dual ) );
-                            for( size_t x_I = 0; x_I < prod.states(); x_I++ )
-                                prod.p()[x_I] *= p[ind[x_I]];
+                            for( size_t x_I = 0; x_I < prod.nrStates(); x_I++ )
+                                prod.set( x_I, prod[x_I] * p[ind[x_I]] );
                         }
                     }
                     // "Marginalize" onto i|j (unnormalized)
                     Prob marg;
                     marg = prod.marginal( VarSet(_fg->var(i), _fg->var(j)), false ).p();
-                    _S[i][I.iter][j.iter] = marg;
+                    _Smsg[i][I.iter][j.iter] = marg;
                 }
         }
     }
@@ -232,19 +232,19 @@ void BBP::RegenerateS() {
 
 
 void BBP::RegenerateR() {
-    // _R[I][_i][_J]
-    _R.resize( _fg->nrFactors() );
+    // _Rmsg[I][_i][_J]
+    _Rmsg.resize( _fg->nrFactors() );
     for( size_t I = 0; I < _fg->nrFactors(); I++ ) {
-        _R[I].resize( _fg->nbF(I).size() );
+        _Rmsg[I].resize( _fg->nbF(I).size() );
         foreach( const Neighbor &i, _fg->nbF(I) ) {
-            _R[I][i.iter].resize( _fg->nbV(i).size() );
+            _Rmsg[I][i.iter].resize( _fg->nbV(i).size() );
             foreach( const Neighbor &J, _fg->nbV(i) ) {
                 if( I != J ) {
                     Prob prod( _fg->var(i).states(), 1.0 );
                     foreach( const Neighbor &K, _fg->nbV(i) )
                         if( K.node != I && K.node != J.node )
                             prod *= _bp_dual.msgM( i, K.iter );
-                    _R[I][i.iter][J.iter] = prod;
+                    _Rmsg[I][i.iter][J.iter] = prod;
                 }
             }
         }
@@ -279,13 +279,13 @@ void BBP::RegeneratePsiAdjoints() {
     _adj_psi_F.reserve( _fg->nrFactors() );
     for( size_t I = 0; I < _fg->nrFactors(); I++ ) {
         Prob p( _adj_b_F_unnorm[I] );
-        DAI_ASSERT( p.size() == _fg->factor(I).states() );
+        DAI_ASSERT( p.size() == _fg->factor(I).nrStates() );
         foreach( const Neighbor &i, _fg->nbF(I) ) {
             Prob n_iI( _bp_dual.msgN( i, i.dual ) );
             const _ind_t& ind = _index( i, i.dual );
             // multiply prod with n_jI
             for( size_t x_I = 0; x_I < p.size(); x_I++ )
-                p[x_I] *= n_iI[ind[x_I]];
+                p.set( x_I, p[x_I] * n_iI[ind[x_I]] );
         }
         p += _init_adj_psi_F[I];
         _adj_psi_F.push_back( p );
@@ -319,12 +319,12 @@ void BBP::RegenerateParMessageAdjoints() {
                         const _ind_t &ind = _index( j, j.dual );
                         // multiply prod with n_jI
                         for( size_t x_I = 0; x_I < prod.size(); x_I++ )
-                            prod[x_I] *= n_jI[ind[x_I]];
+                            prod.set( x_I, prod[x_I] * n_jI[ind[x_I]] );
                     }
                 Prob marg( _fg->var(i).states(), 0.0 );
                 const _ind_t &ind = _index( i, I.iter );
                 for( size_t r = 0; r < prod.size(); r++ )
-                    marg[ind[r]] += prod[r];
+                    marg.set( ind[r], marg[ind[r]] + prod[r] );
                 _new_adj_n[i][I.iter] = marg;
                 upMsgN( i, I.iter );
             }
@@ -376,12 +376,12 @@ void BBP::RegenerateSeqMessageAdjoints() {
                     const _ind_t& ind = _index( j, j.dual );
                     // multiply prod with n_jI
                     for( size_t x_I = 0; x_I < prod.size(); x_I++ )
-                        prod[x_I] *= n_jI[ind[x_I]];
+                        prod.set( x_I, prod[x_I] * n_jI[ind[x_I]] );
                 }
             Prob marg( _fg->var(i).states(), 0.0 );
             const _ind_t &ind = _index( i, I.iter );
             for( size_t r = 0; r < prod.size(); r++ )
-                marg[ind[r]] += prod[r];
+                marg.set( ind[r], marg[ind[r]] + prod[r] );
             sendSeqMsgN( i, I.iter,marg );
         }
     }
@@ -411,10 +411,10 @@ void BBP::calcNewN( size_t i, size_t _I ) {
     size_t I = _fg->nbV(i)[_I];
     foreach( const Neighbor &j, _fg->nbF(I) )
         if( j != i ) {
-            const Prob &p = _S[i][_I][j.iter];
+            const Prob &p = _Smsg[i][_I][j.iter];
             const Prob &_adj_m_unnorm_jI = _adj_m_unnorm[j][j.dual];
             LOOP_ij(
-                new_adj_n_iI[xi] += p[xij] * _adj_m_unnorm_jI[xj];
+                new_adj_n_iI.set( xi, new_adj_n_iI[xi] + p[xij] * _adj_m_unnorm_jI[xj] );
             );
             /* THE FOLLOWING WOULD BE ABOUT TWICE AS SLOW:
             Var vi = _fg->var(i);
@@ -431,7 +431,7 @@ void BBP::calcNewM( size_t i, size_t _I ) {
     const Prob &adj = _adj_m_unnorm[i][_I];
     const _ind_t &ind = _index(i,_I);
     for( size_t x_I = 0; x_I < p.size(); x_I++ )
-        p[x_I] *= adj[ind[x_I]];
+        p.set( x_I, p[x_I] * adj[ind[x_I]] );
     _adj_psi_F[I] += p;
     /* THE FOLLOWING WOULD BE SLIGHTLY SLOWER:
     _adj_psi_F[I] += (Factor( _fg->factor(I).vars(), U(I, I.dual) ) * Factor( _fg->var(i), _adj_m_unnorm[i][_I] )).p();
@@ -440,7 +440,7 @@ void BBP::calcNewM( size_t i, size_t _I ) {
     _new_adj_m[i][_I] = Prob( _fg->var(i).states(), 0.0 );
     foreach( const Neighbor &J, _fg->nbV(i) )
         if( J != I )
-            _new_adj_m[i][_I] += _R[I][I.dual][J.iter] * _adj_n_unnorm[i][J.iter];
+            _new_adj_m[i][_I] += _Rmsg[I][I.dual][J.iter] * _adj_n_unnorm[i][J.iter];
 }
 
 
@@ -547,8 +547,8 @@ void BBP::sendSeqMsgN( size_t i, size_t _I, const Prob &f ) {
                 DAI_DMSG("in sendSeqMsgN loop");
                 DAI_PV(J);
                 DAI_PV(f_unnorm);
-                DAI_PV(_R[J][J.dual][_I]);
-                DAI_PV(f_unnorm * _R[J][J.dual][_I]);
+                DAI_PV(_Rmsg[J][J.dual][_I]);
+                DAI_PV(f_unnorm * _Rmsg[J][J.dual][_I]);
             }
 #endif
             incrSeqMsgM( i, J.iter, f_unnorm * R(J, J.dual, _I) );
@@ -571,7 +571,7 @@ void BBP::sendSeqMsgM( size_t j, size_t _I ) {
     Prob um( U(I, _j) );
     const _ind_t &ind = _index(j, _I);
     for( size_t x_I = 0; x_I < um.size(); x_I++ )
-        um[x_I] *= _adj_m_unnorm_jI[ind[x_I]];
+        um.set( x_I, um[x_I] * _adj_m_unnorm_jI[ind[x_I]] );
     um *= 1 - props.damping;
     _adj_psi_F[I] += um;
 
@@ -586,10 +586,10 @@ void BBP::sendSeqMsgM( size_t j, size_t _I ) {
 //     DAI_PV(_fg->nbF(I).size());
     foreach( const Neighbor &i, _fg->nbF(I) ) {
         if( i.node != j ) {
-            const Prob &S = _S[i][i.dual][_j];
+            const Prob &S = _Smsg[i][i.dual][_j];
             Prob msg( _fg->var(i).states(), 0.0 );
             LOOP_ij(
-                msg[xi] += S[xij] * _adj_m_unnorm_jI[xj];
+                msg.set( xi, msg[xi] + S[xij] * _adj_m_unnorm_jI[xj] );
             );
             msg *= 1.0 - props.damping;
             /* THE FOLLOWING WOULD BE ABOUT TWICE AS SLOW:
@@ -606,7 +606,7 @@ void BBP::sendSeqMsgM( size_t j, size_t _I ) {
                 DAI_PV(_I);
                 DAI_PV(_fg->nbF(I).size());
                 DAI_PV(_fg->factor(I).p());
-                DAI_PV(_S[i][i.dual][_j]);
+                DAI_PV(_Smsg[i][i.dual][_j]);
 
                 DAI_PV(i);
                 DAI_PV(i.dual);
@@ -629,7 +629,7 @@ Prob BBP::unnormAdjoint( const Prob &w, Real Z_w, const Prob &adj_w ) {
     for( size_t i = 0; i < w.size(); i++ )
         s += w[i] * adj_w[i];
     for( size_t i = 0; i < w.size(); i++ )
-        adj_w_unnorm[i] = (adj_w[i] - s) / Z_w;
+        adj_w_unnorm.set( i, (adj_w[i] - s) / Z_w );
     return adj_w_unnorm;
 //  THIS WOULD BE ABOUT 50% SLOWER:  return (adj_w - (w * adj_w).sum()) / Z_w;
 }
@@ -737,7 +737,7 @@ std::vector<Prob> BBP::getZeroAdjF( const FactorGraph &fg ) {
     vector<Prob> adj_2;
     adj_2.reserve( fg.nrFactors() );
     for( size_t I = 0; I < fg.nrFactors(); I++ )
-        adj_2.push_back( Prob( fg.factor(I).states(), 0.0 ) );
+        adj_2.push_back( Prob( fg.factor(I).nrStates(), 0.0 ) );
     return adj_2;
 }
 
@@ -769,22 +769,22 @@ void BBP::initCostFnAdj( const BBPCostFunction &cfn, const vector<size_t> *state
                 int c = fg.nbV(i).size();
                 Prob p(dim,0.0);
                 for( size_t xi = 0; xi < dim; xi++ )
-                    p[xi] = (1 - c) * (1 + log( _ia->beliefV(i)[xi] ));
+                    p.set( xi, (1 - c) * (1 + log( _ia->beliefV(i)[xi] )) );
                 b1_adj.push_back( p );
 
                 for( size_t xi = 0; xi < dim; xi++ )
-                    p[xi] = -_ia->beliefV(i)[xi];
+                    p.set( xi, -_ia->beliefV(i)[xi] );
                 psi1_adj.push_back( p );
             }
             for( size_t I = 0; I < fg.nrFactors(); I++ ) {
-                size_t dim = fg.factor(I).states();
+                size_t dim = fg.factor(I).nrStates();
                 Prob p( dim, 0.0 );
                 for( size_t xI = 0; xI < dim; xI++ )
-                    p[xI] = 1 + log( _ia->beliefF(I)[xI] / fg.factor(I).p()[xI] );
+                    p.set( xI, 1 + log( _ia->beliefF(I)[xI] / fg.factor(I).p()[xI] ) );
                 b2_adj.push_back( p );
 
                 for( size_t xI = 0; xI < dim; xI++ )
-                    p[xI] = -_ia->beliefF(I)[xI] / fg.factor(I).p()[xI];
+                    p.set( xI, -_ia->beliefF(I)[xI] / fg.factor(I).p()[xI] );
                 psi2_adj.push_back( p );
             }
             init( b1_adj, b2_adj, psi1_adj, psi2_adj );
@@ -793,14 +793,14 @@ void BBP::initCostFnAdj( const BBPCostFunction &cfn, const vector<size_t> *state
             vector<Prob> b2_adj;
             b2_adj.reserve( fg.nrFactors() );
             for( size_t I = 0; I < fg.nrFactors(); I++ ) {
-                size_t dim = fg.factor(I).states();
+                size_t dim = fg.factor(I).nrStates();
                 Prob p( dim, 0.0 );
                 for( size_t xI = 0; xI < dim; xI++ ) {
                     Real bIxI = _ia->beliefF(I)[xI];
                     if( bIxI < 1.0e-15 )
-                        p[xI] = -1.0e10;
+                        p.set( xI, -1.0e10 );
                     else
-                        p[xI] = 1 + log( bIxI );
+                        p.set( xI, 1 + log( bIxI ) );
                 }
                 b2_adj.push_back(p);
             }
@@ -815,9 +815,9 @@ void BBP::initCostFnAdj( const BBPCostFunction &cfn, const vector<size_t> *state
                 for( size_t xi = 0; xi < fg.var(i).states(); xi++ ) {
                     Real bixi = _ia->beliefV(i)[xi];
                     if( bixi < 1.0e-15 )
-                        p[xi] = -1.0e10;
+                        p.set( xi, -1.0e10 );
                     else
-                        p[xi] = 1 + log( bixi );
+                        p.set( xi, 1 + log( bixi ) );
                 }
                 b1_adj.push_back( p );
             }
@@ -843,13 +843,13 @@ void BBP::initCostFnAdj( const BBPCostFunction &cfn, const vector<size_t> *state
                 Real b = _ia->beliefV(i)[state[i]];
                 switch( (size_t)cfn ) {
                     case BBPCostFunction::CFN_GIBBS_B:
-                        delta[state[i]] = 1.0;
+                        delta.set( state[i], 1.0 );
                         break;
                     case BBPCostFunction::CFN_GIBBS_B2:
-                        delta[state[i]] = b;
+                        delta.set( state[i], b );
                         break;
                     case BBPCostFunction::CFN_GIBBS_EXP:
-                        delta[state[i]] = exp(b);
+                        delta.set( state[i], exp(b) );
                         break;
                     default:
                         DAI_THROW(UNKNOWN_ENUM_VALUE);
@@ -872,7 +872,7 @@ void BBP::initCostFnAdj( const BBPCostFunction &cfn, const vector<size_t> *state
             vector<Prob> b2_adj;
             b2_adj.reserve( fg.nrVars() );
             for( size_t I = 0; I <  fg.nrFactors(); I++ ) {
-                size_t n = fg.factor(I).states();
+                size_t n = fg.factor(I).nrStates();
                 Prob delta( n, 0.0 );
 
                 size_t x_I = getFactorEntryForState( fg, I, state );
@@ -881,13 +881,13 @@ void BBP::initCostFnAdj( const BBPCostFunction &cfn, const vector<size_t> *state
                 Real b = _ia->beliefF(I)[x_I];
                 switch( (size_t)cfn ) {
                     case BBPCostFunction::CFN_GIBBS_B_FACTOR:
-                        delta[x_I] = 1.0;
+                        delta.set( x_I, 1.0 );
                         break;
                     case BBPCostFunction::CFN_GIBBS_B2_FACTOR:
-                        delta[x_I] = b;
+                        delta.set( x_I, b );
                         break;
                     case BBPCostFunction::CFN_GIBBS_EXP_FACTOR:
-                        delta[x_I] = exp( b );
+                        delta.set( x_I, exp( b ) );
                         break;
                     default:
                         DAI_THROW(UNKNOWN_ENUM_VALUE);
@@ -1011,10 +1011,11 @@ Real numericBBPTest( const InfAlg &bp, const std::vector<size_t> *state, const P
                 // perturb it
                 size_t n = bp_prb->fg().var(i).states();
                 Prob psi_1_prb( n, 1.0 );
-                psi_1_prb[xi] += h;
+                psi_1_prb.set( xi, psi_1_prb[xi] + h );
 //                 psi_1_prb.normalize();
                 size_t I = bp_prb->fg().nbV(i)[0]; // use first factor in list of neighbors of i
-                bp_prb->fg().factor(I) *= Factor( bp_prb->fg().var(i), psi_1_prb );
+                Factor tmp = bp_prb->fg().factor(I) * Factor( bp_prb->fg().var(i), psi_1_prb );
+                bp_prb->fg().setFactor( I, tmp );
 
                 // call 'init' on the perturbed variables
                 bp_prb->init( bp_prb->fg().var(i) );
@@ -1036,7 +1037,7 @@ Real numericBBPTest( const InfAlg &bp, const std::vector<size_t> *state, const P
             cout << "i: " << i
                  << ", p_adj_est: " << p_adj_est
                  << ", bbp.adj_psi_V(i): " << bbp.adj_psi_V(i) << endl;
-            d += dist( p_adj_est, bbp.adj_psi_V(i), Prob::DISTL1 );
+            d += dist( p_adj_est, bbp.adj_psi_V(i), DISTL1 );
         }
     }
     /*    if(1) {
@@ -1086,14 +1087,14 @@ Real numericBBPTest( const InfAlg &bp, const std::vector<size_t> *state, const P
                 cerr << "i: " << i << ", I: " << I
                      << ", adj_n_est: " << p_adj_n_est
                      << ", bbp.adj_n(i,I): " << bbp.adj_n(i,I) << endl;
-                d += dist(p_adj_n_est, bbp.adj_n(i,I), Prob::DISTL1);
+                d += dist(p_adj_n_est, bbp.adj_n(i,I), DISTL1);
 
                 Prob p_adj_m_est( adj_m_est );
                 // compare this numerical estimate to the BBP estimate; sum the distances
                 cerr << "i: " << i << ", I: " << I
                      << ", adj_m_est: " << p_adj_m_est
                      << ", bbp.adj_m(I,i): " << bbp.adj_m(I,i) << endl;
-                d += dist(p_adj_m_est, bbp.adj_m(I,i), Prob::DISTL1);
+                d += dist(p_adj_m_est, bbp.adj_m(I,i), DISTL1);
             }
         }
     }
@@ -1120,7 +1121,7 @@ Real numericBBPTest( const InfAlg &bp, const std::vector<size_t> *state, const P
             cerr << "i: " << i
                  << ", adj_b_V_est: " << p_adj_b_V_est
                  << ", bbp.adj_b_V(i): " << bbp.adj_b_V(i) << endl;
-            d += dist(p_adj_b_V_est, bbp.adj_b_V(i), Prob::DISTL1);
+            d += dist(p_adj_b_V_est, bbp.adj_b_V(i), DISTL1);
         }
     }
     */
@@ -1141,26 +1142,32 @@ namespace dai {
 void BBP::Properties::set(const PropertySet &opts)
 {
     const std::set<PropertyKey> &keys = opts.keys();
-    std::set<PropertyKey>::const_iterator i;
-    for(i=keys.begin(); i!=keys.end(); i++) {
-        if(*i == "verbose") continue;
-        if(*i == "maxiter") continue;
-        if(*i == "tol") continue;
-        if(*i == "damping") continue;
-        if(*i == "updates") continue;
-        DAI_THROWE(UNKNOWN_PROPERTY_TYPE, "BBP: Unknown property " + *i);
+    std::string errormsg;
+    for( std::set<PropertyKey>::const_iterator i = keys.begin(); i != keys.end(); i++ ) {
+        if( *i == "verbose" ) continue;
+        if( *i == "maxiter" ) continue;
+        if( *i == "tol" ) continue;
+        if( *i == "damping" ) continue;
+        if( *i == "updates" ) continue;
+        errormsg = errormsg + "BBP: Unknown property " + *i + "\n";
+    }
+    if( !errormsg.empty() )
+        DAI_THROWE(UNKNOWN_PROPERTY, errormsg);
+    if( !opts.hasKey("maxiter") )
+        errormsg = errormsg + "BBP: Missing property \"maxiter\" for method \"BBP\"\n";
+    if( !opts.hasKey("tol") )
+        errormsg = errormsg + "BBP: Missing property \"tol\" for method \"BBP\"\n";
+    if( !opts.hasKey("damping") )
+        errormsg = errormsg + "BBP: Missing property \"damping\" for method \"BBP\"\n";
+    if( !opts.hasKey("updates") )
+        errormsg = errormsg + "BBP: Missing property \"updates\" for method \"BBP\"\n";
+    if( !errormsg.empty() )
+        DAI_THROWE(NOT_ALL_PROPERTIES_SPECIFIED,errormsg);
+    if( opts.hasKey("verbose") ) {
+        verbose = opts.getStringAs<size_t>("verbose");
+    } else {
+        verbose = 0;
     }
-    if(!opts.hasKey("verbose"))
-        DAI_THROWE(NOT_ALL_PROPERTIES_SPECIFIED,"BBP: Missing property \"verbose\" for method \"BBP\"");
-    if(!opts.hasKey("maxiter"))
-        DAI_THROWE(NOT_ALL_PROPERTIES_SPECIFIED,"BBP: Missing property \"maxiter\" for method \"BBP\"");
-    if(!opts.hasKey("tol"))
-        DAI_THROWE(NOT_ALL_PROPERTIES_SPECIFIED,"BBP: Missing property \"tol\" for method \"BBP\"");
-    if(!opts.hasKey("damping"))
-        DAI_THROWE(NOT_ALL_PROPERTIES_SPECIFIED,"BBP: Missing property \"damping\" for method \"BBP\"");
-    if(!opts.hasKey("updates"))
-        DAI_THROWE(NOT_ALL_PROPERTIES_SPECIFIED,"BBP: Missing property \"updates\" for method \"BBP\"");
-    verbose = opts.getStringAs<size_t>("verbose");
     maxiter = opts.getStringAs<size_t>("maxiter");
     tol = opts.getStringAs<Real>("tol");
     damping = opts.getStringAs<Real>("damping");
@@ -1168,11 +1175,11 @@ void BBP::Properties::set(const PropertySet &opts)
 }
 PropertySet BBP::Properties::get() const {
     PropertySet opts;
-    opts.Set("verbose", verbose);
-    opts.Set("maxiter", maxiter);
-    opts.Set("tol", tol);
-    opts.Set("damping", damping);
-    opts.Set("updates", updates);
+    opts.set("verbose", verbose);
+    opts.set("maxiter", maxiter);
+    opts.set("tol", tol);
+    opts.set("damping", damping);
+    opts.set("updates", updates);
     return opts;
 }
 string BBP::Properties::toString() const {