| 560 | } |
| 561 | |
| 562 | void SignConstraint::eliminateVariable( __attribute__( ( unused ) ) unsigned variable, |
| 563 | __attribute__( ( unused ) ) double fixedValue ) |
| 564 | { |
| 565 | ASSERT( variable == _b || variable == _f ); |
| 566 | |
| 567 | DEBUG( { |
| 568 | if ( variable == _f ) |
| 569 | { |
| 570 | ASSERT( ( FloatUtils::areEqual( fixedValue, 1 ) ) || |
| 571 | ( FloatUtils::areEqual( fixedValue, -1 ) ) ); |
| 572 | |
| 573 | if ( FloatUtils::areEqual( fixedValue, 1 ) ) |
| 574 | { |
| 575 | ASSERT( _phaseStatus != SIGN_PHASE_NEGATIVE ); |
| 576 | } |
| 577 | else if ( FloatUtils::areEqual( fixedValue, -1 ) ) |
| 578 | { |
| 579 | ASSERT( _phaseStatus != SIGN_PHASE_POSITIVE ); |
| 580 | } |
| 581 | } |
| 582 | else if ( variable == _b ) |
| 583 | { |
| 584 | if ( FloatUtils::gte( fixedValue, 0 ) ) |
| 585 | { |
| 586 | ASSERT( _phaseStatus != SIGN_PHASE_NEGATIVE ); |
| 587 | } |
| 588 | else if ( FloatUtils::lt( fixedValue, 0 ) ) |
| 589 | { |
| 590 | ASSERT( _phaseStatus != SIGN_PHASE_POSITIVE ); |
| 591 | } |
| 592 | } |
| 593 | } ); |
| 594 | |
| 595 | // In a Sign constraint, if a variable is removed the entire constraint can be discarded. |
| 596 | _haveEliminatedVariables = true; |
| 597 | } |
| 598 | |
| 599 | unsigned SignConstraint::getB() const |
| 600 | { |
nothing calls this directly
no outgoing calls
no test coverage detected