MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / sort_f

Function sort_f

src/thundersvm/kernel/smo_kernel.cpp:321–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319 }
320
321 void sort_f(SyncArray<float_type> &f_val2sort, SyncArray<int> &f_idx2sort) {
322 vector<std::pair<float_type, int>> paris;
323 float_type *f_val2sort_data = f_val2sort.host_data();
324 int *f_idx2sort_data = f_idx2sort.host_data();
325 for (int i = 0; i < f_val2sort.size(); ++i) {
326 paris.emplace_back(f_val2sort_data[i], f_idx2sort_data[i]);
327 }
328 std::sort(paris.begin(), paris.end());
329 for (int i = 0; i < f_idx2sort.size(); ++i) {
330 f_idx2sort_data[i] = paris[i].second;
331 }
332 }
333}
334

Callers 1

solveMethod · 0.85

Calls 4

endMethod · 0.80
host_dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected