| 717 | } |
| 718 | |
| 719 | void fullApiOptions() { |
| 720 | void* highs; |
| 721 | |
| 722 | highs = Highs_create(); |
| 723 | Highs_setBoolOptionValue(highs, "output_flag", dev_run); |
| 724 | |
| 725 | const double kHighsInf = Highs_getInfinity(highs); |
| 726 | HighsInt simplex_scale_strategy; |
| 727 | HighsInt return_status; |
| 728 | return_status = Highs_getIntOptionValue(highs, "simplex_scale_strategy", |
| 729 | &simplex_scale_strategy); |
| 730 | assert(return_status == kHighsStatusOk); |
| 731 | if (dev_run) |
| 732 | printf("simplex_scale_strategy = %" HIGHSINT_FORMAT ": setting it to 3\n", |
| 733 | simplex_scale_strategy); |
| 734 | simplex_scale_strategy = 3; |
| 735 | return_status = Highs_setIntOptionValue(highs, "simplex_scale_strategy", |
| 736 | simplex_scale_strategy); |
| 737 | |
| 738 | const HighsInt presolve_index = 0; |
| 739 | char* name = NULL; |
| 740 | return_status = Highs_getOptionName(highs, presolve_index, &name); |
| 741 | if (dev_run) |
| 742 | printf("option %" HIGHSINT_FORMAT " has name %s\n", presolve_index, name); |
| 743 | const char* presolve = "presolve"; |
| 744 | assert(*name == *presolve); |
| 745 | free(name); |
| 746 | |
| 747 | HighsInt check_simplex_scale_strategy; |
| 748 | HighsInt min_simplex_scale_strategy; |
| 749 | HighsInt max_simplex_scale_strategy; |
| 750 | HighsInt default_simplex_scale_strategy; |
| 751 | return_status = |
| 752 | Highs_getIntOptionValues(highs, "scale_strategy", NULL, NULL, NULL, NULL); |
| 753 | assert(return_status == kHighsStatusError); |
| 754 | return_status = Highs_getDoubleOptionValues(highs, "simplex_scale_strategy", |
| 755 | NULL, NULL, NULL, NULL); |
| 756 | assert(return_status == kHighsStatusError); |
| 757 | return_status = Highs_getIntOptionValues( |
| 758 | highs, "simplex_scale_strategy", &check_simplex_scale_strategy, |
| 759 | &min_simplex_scale_strategy, &max_simplex_scale_strategy, |
| 760 | &default_simplex_scale_strategy); |
| 761 | assert(return_status == kHighsStatusOk); |
| 762 | assert(check_simplex_scale_strategy == simplex_scale_strategy); |
| 763 | assert(min_simplex_scale_strategy == 0); |
| 764 | assert(max_simplex_scale_strategy == 4); |
| 765 | assert(default_simplex_scale_strategy == 2); |
| 766 | |
| 767 | // There are some functions to check what type of option value you should |
| 768 | // provide. |
| 769 | HighsInt option_type; |
| 770 | return_status = |
| 771 | Highs_getOptionType(highs, "simplex_scale_strategy", &option_type); |
| 772 | assert(return_status == kHighsStatusOk); |
| 773 | assert(option_type == kHighsOptionTypeInt); |
| 774 | return_status = Highs_getOptionType(highs, "bad_option", &option_type); |
| 775 | assert(return_status == kHighsStatusError); |
| 776 |
no test coverage detected