X-Git-Url: http://git.tuebingen.mpg.de/?p=libdai.git;a=blobdiff_plain;f=include%2Fdai%2Ffactor.h;h=30871ec482df99c256710b70727a9975e5f19c4f;hp=9e0b42bfca35d94f13b9ce497d681b6e429bd399;hb=233c76f3860b061a093bf253adf0b4877589df8e;hpb=765e0048664c14c693ceb70a286e1fc41a2f9d02 diff --git a/include/dai/factor.h b/include/dai/factor.h index 9e0b42b..30871ec 100644 --- a/include/dai/factor.h +++ b/include/dai/factor.h @@ -413,11 +413,11 @@ template class TFactor { template TFactor TFactor::partSum(const VarSet & ns) const { - ns &= _vs; + VarSet res_ns = ns & _vs; - TFactor res( ns, 0.0 ); + TFactor res( res_ns, 0.0 ); - IndexFor i_res( ns, _vs ); + IndexFor i_res( res_ns, _vs ); for( size_t i = 0; i < _p.size(); i++, ++i_res ) res._p[i_res] += _p[i];