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

Method rebuildRefactor

highs/simplex/HEkk.cpp:1969–2010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1967}
1968
1969bool HEkk::rebuildRefactor(HighsInt rebuild_reason) {
1970 // If no updates have been performed, then don't refactor!
1971 if (info_.update_count == 0) return false;
1972 // Otherwise, refactor by default
1973 bool refactor = true;
1974 double solution_error = 0;
1975 if (options_->no_unnecessary_rebuild_refactor) {
1976 // Consider whether not to refactor in rebuild
1977 //
1978 // Must have an INVERT just to consider this!
1979 assert(status_.has_invert);
1980 if (rebuild_reason == kRebuildReasonNo ||
1981 rebuild_reason == kRebuildReasonPossiblyOptimal ||
1982 rebuild_reason == kRebuildReasonPossiblyPhase1Feasible ||
1983 rebuild_reason == kRebuildReasonPossiblyPrimalUnbounded ||
1984 rebuild_reason == kRebuildReasonPossiblyDualUnbounded ||
1985 rebuild_reason == kRebuildReasonPrimalInfeasibleInPrimalSimplex) {
1986 // By default, don't refactor!
1987 refactor = false;
1988 // Possibly revise the decision based on accuracy when solving a
1989 // test system
1990 const double error_tolerance =
1991 options_->rebuild_refactor_solution_error_tolerance;
1992 if (error_tolerance > 0) {
1993 solution_error = factorSolveError();
1994 refactor = solution_error > error_tolerance;
1995 }
1996 }
1997 }
1998 const bool report_refactorization = false;
1999 if (report_refactorization) {
2000 const std::string logic = refactor ? " " : "no ";
2001 if (info_.update_count &&
2002 rebuild_reason != kRebuildReasonSyntheticClockSaysInvert)
2003 printf(
2004 "%srefactorization after %4d updates and solution error = %11.4g for "
2005 "rebuild reason = %s\n",
2006 logic.c_str(), (int)info_.update_count, solution_error,
2007 rebuildReason(rebuild_reason).c_str());
2008 }
2009 return refactor;
2010}
2011
2012HighsInt HEkk::computeFactor() {
2013 assert(status_.has_nla);

Callers 6

solvePhase1Method · 0.80
solvePhase2Method · 0.80
rebuildMethod · 0.80
solvePhase1Method · 0.80
solvePhase2Method · 0.80
rebuildMethod · 0.80

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected