COMBINATORIAL_BLAS  1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions
SpImpl< SR, IT, NUM, IVT, OVT > Struct Template Reference

#include <SpImpl.h>

List of all members.

Static Public Member Functions

static void SpMXSpV (const Dcsc< IT, NUM > &Adcsc, int32_t mA, const int32_t *indx, const IVT *numx, int32_t veclen, vector< int32_t > &indy, vector< OVT > &numy)
static void SpMXSpV (const Dcsc< IT, NUM > &Adcsc, int32_t mA, const int32_t *indx, const IVT *numx, int32_t veclen, int32_t *indy, OVT *numy, int *cnts, int *dspls, int p_c)
static void SpMXSpV_ForThreading (const Dcsc< IT, NUM > &Adcsc, int32_t mA, const int32_t *indx, const IVT *numx, int32_t veclen, vector< int32_t > &indy, vector< OVT > &numy, int32_t offset)

Detailed Description

template<class SR, class IT, class NUM, class IVT, class OVT>
struct 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)

Definition at line 70 of file SpImpl.h.


Member Function Documentation

template<class SR , class IT , class NUM , class IVT , class OVT >
void 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,
vector< int32_t > &  indy,
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 }

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 53 of file SpImpl.cpp.

template<class SR , class IT , class NUM , class IVT , class OVT >
static void 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,
int32_t *  indy,
OVT *  numy,
int *  cnts,
int *  dspls,
int  p_c 
)
inlinestatic

Definition at line 75 of file SpImpl.h.

template<class SR , class IT , class NUM , class IVT , class OVT >
static void SpImpl< SR, IT, NUM, IVT, OVT >::SpMXSpV_ForThreading ( const Dcsc< IT, NUM > &  Adcsc,
int32_t  mA,
const int32_t *  indx,
const IVT *  numx,
int32_t  veclen,
vector< int32_t > &  indy,
vector< OVT > &  numy,
int32_t  offset 
)
inlinestatic

Definition at line 81 of file SpImpl.h.


The documentation for this struct was generated from the following files: