| 35 | } |
| 36 | |
| 37 | void 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 | } |
no test coverage detected