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

Method debugCheckData

highs/simplex/HSimplexNla.cpp:424–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424HighsDebugStatus HSimplexNla::debugCheckData(const std::string message) const {
425 std::string scale_status;
426 if (scale_ == NULL) {
427 scale_status = "NULL";
428 } else {
429 scale_status = "non-NULL";
430 }
431 // if (options_->highs_debug_level < kHighsDebugLevelCheap) return
432 // HighsDebugStatus::kOk;
433 HighsLp check_lp = *lp_;
434 bool error0_found = false;
435 bool error1_found = false;
436 bool error2_found = false;
437 bool error_found = false;
438 const HighsInt* factor_Astart = factor_.getAstart();
439 const HighsInt* factor_Aindex = factor_.getAindex();
440 const double* factor_Avalue = factor_.getAvalue();
441
442 if (scale_ == NULL) {
443 if (factor_Astart != lp_->a_matrix_.start_.data()) error0_found = true;
444 if (factor_Aindex != lp_->a_matrix_.index_.data()) error1_found = true;
445 if (factor_Avalue != lp_->a_matrix_.value_.data()) error2_found = true;
446 error_found = error0_found || error1_found || error2_found;
447 if (error_found) {
448 highsLogUser(options_->log_options, HighsLogType::kError,
449 "CheckNlaData: (%s) scale_ is %s lp_ - factor_ matrix "
450 "pointer errors\n",
451 message.c_str(), scale_status.c_str());
452 if (error0_found)
453 printf("a_matrix_.start_ pointer error: %p vs %p\n",
454 (void*)factor_Astart, (void*)lp_->a_matrix_.start_.data());
455 if (error1_found) printf("a_matrix_.index pointer error\n");
456 if (error2_found) printf("a_matrix_.value pointer error\n");
457 assert(!error_found);
458 return HighsDebugStatus::kLogicalError;
459 }
460 } else {
461 check_lp.applyScale();
462 }
463 HighsInt error_col = -1;
464 for (HighsInt iCol = 0; iCol < check_lp.num_col_ + 1; iCol++) {
465 if (check_lp.a_matrix_.start_[iCol] != factor_Astart[iCol]) {
466 error_col = iCol;
467 break;
468 }
469 }
470 error_found = error_col >= 0;
471 if (error_found) {
472 highsLogUser(options_->log_options, HighsLogType::kError,
473 "CheckNlaData: (%s) scale_ is %s check_lp.a_matrix_.start_ != "
474 "factor_Astart for col %d (%d != %d)\n",
475 message.c_str(), scale_status.c_str(), (int)error_col,
476 (int)check_lp.a_matrix_.start_[error_col],
477 (int)factor_Astart[error_col]);
478 assert(!error_found);
479 return HighsDebugStatus::kLogicalError;
480 }
481 HighsInt nnz = check_lp.a_matrix_.numNz();

Callers 1

solveMethod · 0.80

Calls 8

highsLogUserFunction · 0.85
getAstartMethod · 0.80
getAindexMethod · 0.80
getAvalueMethod · 0.80
dataMethod · 0.80
c_strMethod · 0.80
applyScaleMethod · 0.45
numNzMethod · 0.45

Tested by

no test coverage detected