void GLC::CalcFactorBelief( size_t I ) {
VarSet ns = factor(I).vars();
+ Factor tmp( ns, 1.0 );
+ size_t counter = 0;
for( size_t R = 0; R < nrCWs(); R++ )
- if( ns << inds2vars( INRs(R).elements() ) )
- _factorBeliefs[ns] = CW(R).belief(ns);
+ if( ns << inds2vars( INRs(R).elements() ) ) {
+ tmp *= CW(R).belief(ns);
+ counter++;
+ }
+ if( counter > 0 )
+ _factorBeliefs[ns] = tmp ^ (1.0 / counter);
}
map<VarSet, Factor>::const_iterator it = _factorBeliefs.find(ns);
if( it != _factorBeliefs.end() )
return it->second;
+ for( map<VarSet, Factor>::const_iterator it = _factorBeliefs.begin(); it != _factorBeliefs.end(); it++ )
+ if( ns << it->second.vars() )
+ return it->second.marginal( ns );
}
DAI_THROW(BELIEF_NOT_AVAILABLE);
return Factor();
# ({x13}, (9.035e-01, 9.653e-02))
# ({x14}, (2.412e-01, 7.588e-01))
# ({x15}, (6.913e-01, 3.087e-01))
-GLC+_UNICAV_LOOP4 5.578e-06 1.980e-06 3.980e-05 5.551e-06 N/A 1.000e-09
+GLC+_UNICAV_LOOP4 5.578e-06 1.980e-06 3.523e-05 6.616e-06 N/A 1.000e-09
# ({x0}, (3.500e-01, 6.500e-01))
# ({x1}, (6.447e-01, 3.553e-01))
# ({x2}, (4.997e-01, 5.003e-01))
# ({x13}, (9.038e-01, 9.616e-02))
# ({x14}, (2.408e-01, 7.592e-01))
# ({x15}, (6.910e-01, 3.090e-01))
-GLC+_FULLCAV_LOOP4 1.512e-07 2.111e-08 3.977e-07 3.838e-08 N/A 1.000e-09
+GLC+_FULLCAV_LOOP4 1.512e-07 2.111e-08 4.137e-07 5.395e-08 N/A 1.000e-09
# ({x0}, (3.500e-01, 6.500e-01))
# ({x1}, (6.447e-01, 3.553e-01))
# ({x2}, (4.997e-01, 5.003e-01))
# ({x13}, (9.038e-01, 9.617e-02))
# ({x14}, (2.408e-01, 7.592e-01))
# ({x15}, (6.910e-01, 3.090e-01))
-GLC+_UNICAV_LOOP5 5.578e-06 1.980e-06 3.980e-05 5.551e-06 N/A 1.000e-09
+GLC+_UNICAV_LOOP5 5.578e-06 1.980e-06 3.523e-05 6.616e-06 N/A 1.000e-09
# ({x0}, (3.500e-01, 6.500e-01))
# ({x1}, (6.447e-01, 3.553e-01))
# ({x2}, (4.997e-01, 5.003e-01))
# ({x13}, (9.038e-01, 9.616e-02))
# ({x14}, (2.408e-01, 7.592e-01))
# ({x15}, (6.910e-01, 3.090e-01))
-GLC+_FULLCAV_LOOP5 1.513e-07 2.113e-08 3.977e-07 3.838e-08 N/A 1.000e-09
+GLC+_FULLCAV_LOOP5 1.513e-07 2.113e-08 4.137e-07 5.394e-08 N/A 1.000e-09
# ({x0}, (3.500e-01, 6.500e-01))
# ({x1}, (6.447e-01, 3.553e-01))
# ({x2}, (4.997e-01, 5.003e-01))