| 1250 | } |
| 1251 | |
| 1252 | bool HEkk::debugOneNonbasicMoveVsWorkArraysOk(const HighsInt var) const { |
| 1253 | const HighsLp& lp = this->lp_; |
| 1254 | const HighsSimplexInfo& info = this->info_; |
| 1255 | const SimplexBasis& basis = this->basis_; |
| 1256 | const HighsOptions& options = *(this->options_); |
| 1257 | assert(var >= 0); |
| 1258 | assert(var < lp.num_col_ + lp.num_row_); |
| 1259 | // Make sure we're not checking a basic variable |
| 1260 | if (!basis.nonbasicFlag_[var]) return true; |
| 1261 | bool ok; |
| 1262 | if (!highs_isInfinity(-info.workLower_[var])) { |
| 1263 | if (!highs_isInfinity(info.workUpper_[var])) { |
| 1264 | // Finite lower and upper bounds so nonbasic move depends on whether they |
| 1265 | // are equal |
| 1266 | if (info.workLower_[var] == info.workUpper_[var]) { |
| 1267 | // Fixed variable |
| 1268 | ok = basis.nonbasicMove_[var] == kNonbasicMoveZe; |
| 1269 | if (!ok) { |
| 1270 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1271 | "Fixed variable %" HIGHSINT_FORMAT |
| 1272 | " (lp.num_col_ = %" HIGHSINT_FORMAT |
| 1273 | ") [%11g, %11g, " |
| 1274 | "%11g] so nonbasic " |
| 1275 | "move should be zero but is %" HIGHSINT_FORMAT "\n", |
| 1276 | var, lp.num_col_, info.workLower_[var], |
| 1277 | info.workValue_[var], info.workUpper_[var], |
| 1278 | basis.nonbasicMove_[var]); |
| 1279 | return ok; |
| 1280 | } |
| 1281 | ok = info.workValue_[var] == info.workLower_[var]; |
| 1282 | if (!ok) { |
| 1283 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1284 | "Fixed variable %" HIGHSINT_FORMAT |
| 1285 | " (lp.num_col_ = %" HIGHSINT_FORMAT |
| 1286 | ") so " |
| 1287 | "info.work value should be %g but " |
| 1288 | "is %g\n", |
| 1289 | var, lp.num_col_, info.workLower_[var], |
| 1290 | info.workValue_[var]); |
| 1291 | return ok; |
| 1292 | } |
| 1293 | } else { |
| 1294 | // Boxed variable |
| 1295 | ok = (basis.nonbasicMove_[var] == kNonbasicMoveUp) || |
| 1296 | (basis.nonbasicMove_[var] == kNonbasicMoveDn); |
| 1297 | if (!ok) { |
| 1298 | highsLogDev( |
| 1299 | options.log_options, HighsLogType::kError, |
| 1300 | "Boxed variable %" HIGHSINT_FORMAT |
| 1301 | " (lp.num_col_ = %" HIGHSINT_FORMAT |
| 1302 | ") [%11g, %11g, " |
| 1303 | "%11g] range %g so " |
| 1304 | "nonbasic move should be up/down but is %" HIGHSINT_FORMAT "\n", |
| 1305 | var, lp.num_col_, info.workLower_[var], info.workValue_[var], |
| 1306 | info.workUpper_[var], info.workUpper_[var] - info.workLower_[var], |
| 1307 | basis.nonbasicMove_[var]); |
| 1308 | return ok; |
| 1309 | } |
no test coverage detected