MCPcopy Create free account
hub / github.com/Derious/cuMPC / csr_sort_indices

Function csr_sort_indices

dependence/eigen-3.4.0/bench/sparse_setter.cpp:351–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349
350template<class I, class T>
351void csr_sort_indices(const I n_row,
352 const I Ap[],
353 I Aj[],
354 T Ax[])
355{
356 std::vector< std::pair<I,T> > temp;
357
358 for(I i = 0; i < n_row; i++){
359 I row_start = Ap[i];
360 I row_end = Ap[i+1];
361
362 temp.clear();
363
364 for(I jj = row_start; jj < row_end; jj++){
365 temp.push_back(std::make_pair(Aj[jj],Ax[jj]));
366 }
367
368 std::sort(temp.begin(),temp.end(),kv_pair_less<I,T>);
369
370 for(I jj = row_start, n = 0; jj < row_end; jj++, n++){
371 Aj[jj] = temp[n].first;
372 Ax[jj] = temp[n].second;
373 }
374 }
375}
376
377template <class I, class T>
378void csr_sum_duplicates(const I n_row,

Callers 1

setrand_scipyFunction · 0.85

Calls 4

clearMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected