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

Method objectiveGradient

highs/model/HighsModel.cpp:37–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void HighsModel::objectiveGradient(const std::vector<double>& solution,
38 std::vector<double>& gradient) const {
39 if (this->hessian_.dim_ > 0) {
40 this->hessian_.product(solution, gradient);
41 } else {
42 gradient.assign(this->lp_.num_col_, 0);
43 }
44 for (HighsInt iCol = 0; iCol < this->lp_.num_col_; iCol++)
45 gradient[iCol] += this->lp_.col_cost_[iCol];
46}

Callers 2

getKktFailuresFunction · 0.80

Calls 1

productMethod · 0.45

Tested by

no test coverage detected