fix showing the weights on edge labels when there is a SetOrNode ancestor
This commit is contained in:
parent
59f653aabd
commit
57a31c2c36
@ -78,6 +78,16 @@ double
|
|||||||
LeafNode::weight (void) const
|
LeafNode::weight (void) const
|
||||||
{
|
{
|
||||||
assert (clause_->isUnit());
|
assert (clause_->isUnit());
|
||||||
|
if (clause_->posCountedLogVars().empty() == false
|
||||||
|
|| clause_->negCountedLogVars().empty() == false) {
|
||||||
|
if (SetOrNode::isSet() == false) {
|
||||||
|
// return a NaN if we have a SetOrNode
|
||||||
|
// ancester that is not set. This can only
|
||||||
|
// happen when calculating the weights
|
||||||
|
// for the edge labels in graphviz
|
||||||
|
return 0.0 / 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
double weight = clause_->literals()[0].isPositive()
|
double weight = clause_->literals()[0].isPositive()
|
||||||
? lwcnf_.posWeight (clause_->literals().front().lid())
|
? lwcnf_.posWeight (clause_->literals().front().lid())
|
||||||
: lwcnf_.negWeight (clause_->literals().front().lid());
|
: lwcnf_.negWeight (clause_->literals().front().lid());
|
||||||
|
@ -79,6 +79,8 @@ class SetOrNode : public CircuitNode
|
|||||||
|
|
||||||
static unsigned nrNegatives (void) { return nrGrsStack.top().second; }
|
static unsigned nrNegatives (void) { return nrGrsStack.top().second; }
|
||||||
|
|
||||||
|
static bool isSet (void) { return nrGrsStack.size() > 0; }
|
||||||
|
|
||||||
double weight (void) const;
|
double weight (void) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user