| 694 | } |
| 695 | |
| 696 | void Tableau::performPivot() |
| 697 | { |
| 698 | bool decrease; |
| 699 | unsigned nonBasic; |
| 700 | (void)decrease; |
| 701 | (void)nonBasic; |
| 702 | if ( _leavingVariable == _m ) |
| 703 | { |
| 704 | if ( _statistics ) |
| 705 | _statistics->incLongAttribute( Statistics::NUM_TABLEAU_BOUND_HOPPING ); |
| 706 | |
| 707 | double enteringReducedCost = _costFunctionManager->getCostFunction()[_enteringVariable]; |
| 708 | |
| 709 | ASSERT( ( enteringReducedCost <= -GlobalConfiguration::ENTRY_ELIGIBILITY_TOLERANCE ) || |
| 710 | ( enteringReducedCost >= +GlobalConfiguration::ENTRY_ELIGIBILITY_TOLERANCE ) ); |
| 711 | |
| 712 | decrease = ( enteringReducedCost >= +GlobalConfiguration::ENTRY_ELIGIBILITY_TOLERANCE ); |
| 713 | nonBasic = _nonBasicIndexToVariable[_enteringVariable]; |
| 714 | |
| 715 | TABLEAU_LOG( Stringf( "Performing 'fake' pivot. Variable x%u jumping to %s bound", |
| 716 | _nonBasicIndexToVariable[_enteringVariable], |
| 717 | decrease ? "LOWER" : "UPPER" ) |
| 718 | .ascii() ); |
| 719 | TABLEAU_LOG( Stringf( "Current value: %.3lf. Range: [%.3lf, %.3lf]\n", |
| 720 | _nonBasicAssignment[_enteringVariable], |
| 721 | getLowerBound( nonBasic ), |
| 722 | getUpperBound( nonBasic ) ) |
| 723 | .ascii() ); |
| 724 | |
| 725 | updateAssignmentForPivot(); |
| 726 | |
| 727 | return; |
| 728 | } |
| 729 | |
| 730 | struct timespec pivotStart; |
| 731 | |
| 732 | if ( _statistics ) |
| 733 | { |
| 734 | pivotStart = TimeUtils::sampleMicro(); |
| 735 | _statistics->incLongAttribute( Statistics::NUM_TABLEAU_PIVOTS ); |
| 736 | } |
| 737 | |
| 738 | unsigned currentBasic = _basicIndexToVariable[_leavingVariable]; |
| 739 | unsigned currentNonBasic = _nonBasicIndexToVariable[_enteringVariable]; |
| 740 | |
| 741 | TABLEAU_LOG( Stringf( "Tableau performing pivot. Entering: %u, Leaving: %u", |
| 742 | _nonBasicIndexToVariable[_enteringVariable], |
| 743 | _basicIndexToVariable[_leavingVariable] ) |
| 744 | .ascii() ); |
| 745 | TABLEAU_LOG( Stringf( "Leaving variable %s. Current value: %.15lf. Range: [%.15lf, %.15lf]", |
| 746 | _leavingVariableIncreases ? "increases" : "decreases", |
| 747 | _basicAssignment[_leavingVariable], |
| 748 | getLowerBound( currentBasic ), |
| 749 | getUpperBound( currentBasic ) ) |
| 750 | .ascii() ); |
| 751 | TABLEAU_LOG( Stringf( "Entering variable %s. Current value: %.15lf. Range: [%.15lf, %.15lf]", |
| 752 | FloatUtils::isNegative( |
| 753 | _costFunctionManager->getCostFunction()[_enteringVariable] ) |
no test coverage detected