template<class SR, class IT, class NUM, class IVT, class OVT>
struct combblas::SpImpl< SR, IT, NUM, IVT, OVT >
IT: The sparse matrix index type. Sparse vector index type is fixed to be int32_t It is the caller function's (inside ParFriends/Friends) job to convert any different types and ensure correctness. Rationale is efficiency, and the fact that we know for sure that 32-bit LOCAL indices are sufficient for all reasonable concurrencies and data sizes (as of 2011)
- Todo:
- : As of 2015, this might not be true!!! (ABAB)
Definition at line 47 of file SpImpl.h.
template<class SR , class IT , class NUM , class IVT , class OVT >
void combblas::SpImpl< SR, IT, NUM, IVT, OVT >::SpMXSpV |
( |
const Dcsc< IT, NUM > & |
Adcsc, |
|
|
int32_t |
mA, |
|
|
const int32_t * |
indx, |
|
|
const IVT * |
numx, |
|
|
int32_t |
veclen, |
|
|
std::vector< int32_t > & |
indy, |
|
|
std::vector< OVT > & |
numy |
|
) |
| |
|
static |
Base template version [full use of the semiring add() and multiply()]
- Parameters
-
[in] | indx | { vector that practically keeps column numbers requested from A } |
Roughly how the below function works: Let's say our sparse vector has entries at 3, 7 and 9. FillColInds() creates a vector of pairs that contain the start and end indices (into matrix.ir and matrix.numx arrays). pair.first is the start index, pair.second is the end index.
Here's how we merge these adjacencies of 3,7 and 9: We keep a heap of size 3 and push the first entries in adj{3}, adj{7}, adj{9} onto the heap wset. That happens in the first for loop.
Then as we pop from the heap we push the next entry from the previously popped adjacency (i.e. matrix column). The heap ensures the output comes out sorted without using a SPA. that's why indy.back() == wset[hsize-1].key is enough to ensure proper merging.
Definition at line 57 of file SpImpl.cpp.