| 629 | } |
| 630 | |
| 631 | void InputQuery::dump() const |
| 632 | { |
| 633 | printf( "Total number of variables: %u\n", _numberOfVariables ); |
| 634 | printf( "Input variables:\n" ); |
| 635 | for ( const auto &input : _inputIndexToVariable ) |
| 636 | printf( "\tx%u\n", input.second ); |
| 637 | |
| 638 | printf( "Output variables:\n" ); |
| 639 | for ( const auto &output : _outputIndexToVariable ) |
| 640 | printf( "\tx%u\n", output.second ); |
| 641 | |
| 642 | printf( "Variable bounds:\n" ); |
| 643 | for ( unsigned i = 0; i < _numberOfVariables; ++i ) |
| 644 | { |
| 645 | printf( "\t %u: [%s, %s]\n", |
| 646 | i, |
| 647 | _lowerBounds.exists( i ) ? Stringf( "%lf", _lowerBounds[i] ).ascii() : "-inf", |
| 648 | _upperBounds.exists( i ) ? Stringf( "%lf", _upperBounds[i] ).ascii() : "inf" ); |
| 649 | } |
| 650 | |
| 651 | printf( "Constraints:\n" ); |
| 652 | String constraintString; |
| 653 | for ( const auto &pl : _plConstraints ) |
| 654 | { |
| 655 | pl->dump( constraintString ); |
| 656 | printf( "\t%s\n", constraintString.ascii() ); |
| 657 | } |
| 658 | |
| 659 | for ( const auto &ts : _nlConstraints ) |
| 660 | { |
| 661 | ts->dump( constraintString ); |
| 662 | printf( "\t%s\n", constraintString.ascii() ); |
| 663 | } |
| 664 | |
| 665 | printf( "Equations:\n" ); |
| 666 | for ( const auto &e : _equations ) |
| 667 | { |
| 668 | printf( "\t" ); |
| 669 | e.dump(); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | void InputQuery::adjustInputOutputMapping( const Map<unsigned, unsigned> &oldIndexToNewIndex, |
| 674 | const Map<unsigned, unsigned> &mergedVariables ) |