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

Function analyseSetCreateError

highs/lp_data/Highs.cpp:2957–2993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2955}
2956
2957static HighsStatus analyseSetCreateError(HighsLogOptions log_options,
2958 const std::string& method,
2959 const HighsInt create_error,
2960 const bool ordered,
2961 const HighsInt num_set_entries,
2962 const HighsInt* set,
2963 const HighsInt dimension) {
2964 if (create_error == kIndexCollectionCreateIllegalSetSize) {
2965 highsLogUser(log_options, HighsLogType::kError,
2966 "Set supplied to Highs::%s has illegal size of %d\n",
2967 method.c_str(), int(num_set_entries));
2968 } else if (create_error == kIndexCollectionCreateIllegalSetOrder) {
2969 if (ordered) {
2970 // Creating an index_collection data structure for the set
2971 // includes a test that the indices increase strictly. If this
2972 // is not the case then, since an increasing set was created
2973 // locally, it must contain duplicate entries. return with an
2974 // error
2975 highsLogUser(log_options, HighsLogType::kError,
2976 "Set supplied to Highs::%s contains duplicate entries\n",
2977 method.c_str());
2978 } else {
2979 highsLogUser(log_options, HighsLogType::kError,
2980 "Set supplied to Highs::%s not ordered\n", method.c_str());
2981 }
2982 } else if (create_error < 0) {
2983 HighsInt illegal_set_index = -1 - create_error;
2984 HighsInt illegal_set_entry = set[illegal_set_index];
2985 highsLogUser(
2986 log_options, HighsLogType::kError,
2987 "Set supplied to Highs::%s has entry %d of %d out of range [0, %d)\n",
2988 method.c_str(), int(illegal_set_index), int(illegal_set_entry),
2989 int(dimension));
2990 }
2991 assert(create_error != kIndexCollectionCreateIllegalSetDimension);
2992 return HighsStatus::kError;
2993}
2994
2995HighsStatus Highs::changeColsIntegrality(const HighsInt num_set_entries,
2996 const HighsInt* set,

Callers 8

changeColsIntegralityMethod · 0.85
changeColsCostMethod · 0.85
changeColsBoundsMethod · 0.85
changeRowsBoundsMethod · 0.85
getColsMethod · 0.85
getRowsMethod · 0.85
deleteColsMethod · 0.85
deleteRowsMethod · 0.85

Calls 2

highsLogUserFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected