Add more assertations to Factor class.

SumOutFirstVariable and SumOutLastVariable will only are correctly defined if the variable is binary.
This commit is contained in:
Tiago Gomes 2013-03-18 15:57:10 +00:00
parent 4ca17b9e9b
commit c550139c8b

View File

@ -149,6 +149,7 @@ Factor::print() const
void
Factor::sumOutFirstVariable()
{
assert (ranges_.size() == 2);
size_t sep = params_.size() / 2;
if (Globals::logDomain) {
std::transform (
@ -172,6 +173,7 @@ Factor::sumOutFirstVariable()
void
Factor::sumOutLastVariable()
{
assert (ranges_.size() == 2);
Params::iterator first1 = params_.begin();
Params::iterator first2 = params_.begin();
Params::iterator last = params_.end();