| 191 | } |
| 192 | |
| 193 | void FixedBoundsConstraintsModel::postprocess_solution(Iterate& iterate) const { |
| 194 | // move the multipliers back from the general constraints to the bound constraints |
| 195 | size_t current_constraint = this->model.number_constraints; |
| 196 | for (size_t variable_index: this->model.get_fixed_variables()) { |
| 197 | const double constraint_multiplier = iterate.multipliers.constraints[current_constraint]; |
| 198 | if (0. < constraint_multiplier) { |
| 199 | iterate.multipliers.lower_bounds[variable_index] = constraint_multiplier; |
| 200 | } |
| 201 | else { |
| 202 | iterate.multipliers.upper_bounds[variable_index] = constraint_multiplier; |
| 203 | } |
| 204 | ++current_constraint; |
| 205 | } |
| 206 | this->model.postprocess_solution(iterate); |
| 207 | } |
| 208 | |
| 209 | size_t FixedBoundsConstraintsModel::number_jacobian_nonzeros() const { |
| 210 | return this->model.number_jacobian_nonzeros() + this->model.get_fixed_variables().size(); |
nothing calls this directly
no outgoing calls
no test coverage detected