MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / debugNonbasicMove

Method debugNonbasicMove

highs/simplex/HEkkDebug.cpp:939–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937}
938
939HighsDebugStatus HEkk::debugNonbasicMove(const HighsLp* pass_lp) const {
940 // Non-trivially expensive check of NonbasicMove
941 if (this->options_->highs_debug_level < kHighsDebugLevelCostly)
942 return HighsDebugStatus::kNotChecked;
943 HighsDebugStatus return_status = HighsDebugStatus::kOk;
944 const HighsOptions& options = *(this->options_);
945 const SimplexBasis& basis = this->basis_;
946 HighsInt num_free_variable_move_errors = 0;
947 HighsInt num_lower_bounded_variable_move_errors = 0;
948 HighsInt num_upper_bounded_variable_move_errors = 0;
949 HighsInt num_boxed_variable_move_errors = 0;
950 HighsInt num_fixed_variable_move_errors = 0;
951 HighsInt num_col;
952 HighsInt num_row;
953 const bool use_pass_lp = (pass_lp != nullptr);
954 if (use_pass_lp) {
955 num_col = pass_lp->num_col_;
956 num_row = pass_lp->num_row_;
957 } else {
958 assert(1 == 0);
959 num_col = this->lp_.num_col_;
960 num_row = this->lp_.num_row_;
961 }
962
963 const HighsInt numTot = num_col + num_row;
964 bool right_size = (HighsInt)basis.nonbasicMove_.size() == numTot;
965 // Check consistency of nonbasicMove
966 if (!right_size) {
967 highsLogDev(options.log_options, HighsLogType::kError,
968 "nonbasicMove size error\n");
969 assert(right_size);
970 return_status = HighsDebugStatus::kLogicalError;
971 }
972 double lower;
973 double upper;
974
975 for (HighsInt iVar = 0; iVar < numTot; iVar++) {
976 if (!basis.nonbasicFlag_[iVar]) continue;
977 // Nonbasic variable
978 if (use_pass_lp) {
979 if (iVar < num_col) {
980 lower = pass_lp->col_lower_[iVar];
981 upper = pass_lp->col_upper_[iVar];
982 } else {
983 HighsInt iRow = iVar - num_col;
984 lower = -pass_lp->row_upper_[iRow];
985 upper = -pass_lp->row_lower_[iRow];
986 }
987 } else {
988 if (iVar < num_col) {
989 lower = this->lp_.col_lower_[iVar];
990 upper = this->lp_.col_upper_[iVar];
991 } else {
992 HighsInt iRow = iVar - num_col;
993 lower = -this->lp_.row_upper_[iRow];
994 upper = -this->lp_.row_lower_[iRow];
995 }
996 }

Callers 1

debugBasisCorrectMethod · 0.95

Calls 3

highsLogDevFunction · 0.85
highs_isInfinityFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected