MCPcopy Create free account
hub / github.com/OriginQ/QPanda-2 / quickSort

Function quickSort

Applications/NodeSort/NodeSort.cpp:242–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240
241template<class T>
242std::vector<std::pair<int, T>> quickSort(const std::vector<T>& vec)
243{
244 std::vector<std::pair<int, T>> sort_vec;
245 for (int i = 0; i < vec.size(); i++)
246 {
247 sort_vec.push_back(std::make_pair(i, vec[i]));
248 }
249
250 std::sort(sort_vec.begin(), sort_vec.end(), lessCmp<T>);
251
252 return sort_vec;
253}
254
255int calcNodeSort(
256 const vector<vector<double>>& graph,

Callers 1

calcNodeSortFunction · 0.70

Calls 5

sortFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected