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

Function sortSetData

highs/util/HighsSort.cpp:322–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322void sortSetData(const HighsInt num_entries, vector<HighsInt>& set,
323 const double* data0, const double* data1, const double* data2,
324 double* sorted_data0, double* sorted_data1,
325 double* sorted_data2) {
326 if (num_entries <= 0) return;
327 vector<HighsInt> sort_set_vec(1 + num_entries);
328 vector<HighsInt> perm_vec(1 + num_entries);
329
330 HighsInt* sort_set = sort_set_vec.data();
331 HighsInt* perm = perm_vec.data();
332
333 for (HighsInt ix = 0; ix < num_entries; ix++) {
334 sort_set[1 + ix] = set[ix];
335 perm[1 + ix] = ix;
336 }
337 maxheapsort(sort_set, perm, num_entries);
338 for (HighsInt ix = 0; ix < num_entries; ix++) {
339 set[ix] = sort_set[1 + ix];
340 if (data0 != NULL) sorted_data0[ix] = data0[perm[1 + ix]];
341 if (data1 != NULL) sorted_data1[ix] = data1[perm[1 + ix]];
342 if (data2 != NULL) sorted_data2[ix] = data2[perm[1 + ix]];
343 }
344}
345
346void sortSetData(const HighsInt num_entries, vector<HighsInt>& set,
347 const HighsVarType* data0, HighsVarType* sorted_data0) {

Callers 7

changeColsIntegralityMethod · 0.85
changeColsCostMethod · 0.85
changeColsBoundsMethod · 0.85
changeRowsBoundsMethod · 0.85
TestSort.cppFile · 0.85

Calls 2

maxheapsortFunction · 0.85
dataMethod · 0.80

Tested by

no test coverage detected