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

Method changeRowBoundsInterface

highs/lp_data/HighsInterface.cpp:1009–1058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007}
1008
1009HighsStatus Highs::changeRowBoundsInterface(
1010 HighsIndexCollection& index_collection, const double* lower,
1011 const double* upper) {
1012 HighsInt num_row_bounds = dataSize(index_collection);
1013 // If a non-positive number of costs (may) need changing nothing needs to be
1014 // done
1015 if (num_row_bounds <= 0) return HighsStatus::kOk;
1016 bool null_data = false;
1017 null_data =
1018 doubleUserDataNotNull(options_.log_options, lower, "row lower bounds") ||
1019 null_data;
1020 null_data =
1021 doubleUserDataNotNull(options_.log_options, upper, "row upper bounds") ||
1022 null_data;
1023 if (null_data) return HighsStatus::kError;
1024 // Take a copy of the cost that can be normalised
1025 std::vector<double> local_rowLower{lower, lower + num_row_bounds};
1026 std::vector<double> local_rowUpper{upper, upper + num_row_bounds};
1027 // If changing the bounds for a set of rows, ensure that the
1028 // set and data are in ascending order
1029 if (index_collection.is_set_)
1030 sortSetData(index_collection.set_num_entries_, index_collection.set_, lower,
1031 upper, NULL, local_rowLower.data(), local_rowUpper.data(),
1032 NULL);
1033 HighsStatus return_status = HighsStatus::kOk;
1034 return_status = interpretCallStatus(
1035 options_.log_options,
1036 assessBounds(options_, "row", 0, index_collection, local_rowLower,
1037 local_rowUpper, options_.infinite_bound),
1038 return_status, "assessBounds");
1039 if (return_status == HighsStatus::kError) return return_status;
1040 HighsLp& lp = model_.lp_;
1041
1042 changeLpRowBounds(lp, index_collection, local_rowLower, local_rowUpper);
1043 // Update HiGHS basis status and (any) simplex move status of
1044 // nonbasic variables whose bounds have changed
1045 setNonbasicStatusInterface(index_collection, false);
1046 // Deduce the consequences of new row bounds
1047 if (!this->basis_.useful && feasibleWrtBounds(false)) {
1048 // Retain the solution if there's no basis, and the solution is
1049 // feasible
1050 invalidateModelStatusAndInfo();
1051 } else {
1052 // Invalidate the solution
1053 invalidateModelStatusSolutionAndInfo();
1054 }
1055 // Determine any implications for simplex data
1056 ekk_instance_.updateStatus(LpAction::kNewBounds);
1057 return HighsStatus::kOk;
1058}
1059
1060// Change a single coefficient in the matrix
1061void Highs::changeCoefficientInterface(const HighsInt ext_row,

Callers

nothing calls this directly

Calls 8

dataSizeFunction · 0.85
doubleUserDataNotNullFunction · 0.85
sortSetDataFunction · 0.85
interpretCallStatusFunction · 0.85
assessBoundsFunction · 0.85
changeLpRowBoundsFunction · 0.85
dataMethod · 0.80
updateStatusMethod · 0.80

Tested by

no test coverage detected