support model counting in inc-exc nodes

This commit is contained in:
Tiago Gomes 2012-10-30 01:51:10 +00:00
parent 8b77b93a3b
commit 864f764391

View File

@ -44,6 +44,22 @@ SetAndNode::weight (void) const
double
IncExcNode::weight (void) const
{
double w = 0.0;
if (Globals::logDomain) {
w = Util::logSum (plus1Branch_->weight(), plus2Branch_->weight());
w = std::log (std::exp (w) - std::exp (minusBranch_->weight()));
} else {
w = plus1Branch_->weight() + plus2Branch_->weight();
w -= minusBranch_->weight();
}
return w;
}
double double
LeafNode::weight (void) const LeafNode::weight (void) const
{ {