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

Method computeDualObjectiveValue

highs/simplex/HEkk.cpp:1946–1967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1944}
1945
1946void HEkk::computeDualObjectiveValue(const HighsInt phase) {
1947 analysis_.simplexTimerStart(ComputeDuObjClock);
1948 info_.dual_objective_value = 0;
1949 const HighsInt num_tot = lp_.num_col_ + lp_.num_row_;
1950 for (HighsInt iCol = 0; iCol < num_tot; iCol++) {
1951 if (basis_.nonbasicFlag_[iCol])
1952 info_.dual_objective_value +=
1953 info_.workValue_[iCol] * info_.workDual_[iCol];
1954 }
1955 info_.dual_objective_value *= cost_scale_;
1956 if (phase != 1) {
1957 // In phase 1 the dual objective has no objective
1958 // shift. Otherwise, if minimizing the shift is added. If
1959 // maximizing, workCost (and hence workDual) are negated, so the
1960 // shift is subtracted. Hence the shift is added according to the
1961 // sign implied by sense_
1962 info_.dual_objective_value += ((HighsInt)lp_.sense_) * lp_.offset_;
1963 }
1964 // Now have dual objective value
1965 status_.has_dual_objective_value = true;
1966 analysis_.simplexTimerStop(ComputeDuObjClock);
1967}
1968
1969bool HEkk::rebuildRefactor(HighsInt rebuild_reason) {
1970 // If no updates have been performed, then don't refactor!

Callers 3

rebuildMethod · 0.80
cleanupMethod · 0.80
solvePhase2Method · 0.80

Calls 2

simplexTimerStartMethod · 0.80
simplexTimerStopMethod · 0.80

Tested by

no test coverage detected