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

Function csr_sum_duplicates

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

Source from the content-addressed store, hash-verified

376
377template <class I, class T>
378void csr_sum_duplicates(const I n_row,
379 const I n_col,
380 I Ap[],
381 I Aj[],
382 T Ax[])
383{
384 I nnz = 0;
385 I row_end = 0;
386 for(I i = 0; i < n_row; i++){
387 I jj = row_end;
388 row_end = Ap[i+1];
389 while( jj < row_end ){
390 I j = Aj[jj];
391 T x = Ax[jj];
392 jj++;
393 while( jj < row_end && Aj[jj] == j ){
394 x += Ax[jj];
395 jj++;
396 }
397 Aj[nnz] = j;
398 Ax[nnz] = x;
399 nnz++;
400 }
401 Ap[i+1] = nnz;
402 }
403}
404
405EIGEN_DONT_INLINE Scalar* setrand_scipy(const Coordinates& coords, const Values& vals)
406{

Callers 1

setrand_scipyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected