COMBINATORIAL_BLAS  1.6
Friends.h File Reference
#include <iostream>
#include "SpMat.h"
#include "SpHelper.h"
#include "StackEntry.h"
#include "Isect.h"
#include "Deleter.h"
#include "SpImpl.h"
#include "SpParHelper.h"
#include "Compare.h"
#include "CombBLAS.h"
#include "PreAllocatedSPA.h"

Go to the source code of this file.

Classes

class  SpTuples< IT, NT >
 
class  SpDCCols< IT, NT >
 
class  Dcsc< IT, NT >
 

Functions

template<typename SR , typename IU , typename NU , typename RHS , typename LHS >
void dcsc_gespmv (const SpDCCols< IU, NU > &A, const RHS *x, LHS *y)
 SpMV with dense vector. More...
 
template<typename SR , typename IU , typename NU , typename RHS , typename LHS >
void dcsc_gespmv_threaded (const SpDCCols< IU, NU > &A, const RHS *x, LHS *y)
 SpMV with dense vector (multithreaded version) More...
 
template<typename SR , typename IU , typename NUM , typename DER , typename IVT , typename OVT >
int generic_gespmv_threaded (const SpMat< IU, NUM, DER > &A, const int32_t *indx, const IVT *numx, int32_t nnzx, int32_t *&sendindbuf, OVT *&sendnumbuf, int *&sdispls, int p_c, PreAllocatedSPA< OVT > &SPA)
 
template<typename SR , typename IU , typename NUM , typename DER , typename IVT , typename OVT >
void generic_gespmv_threaded_setbuffers (const SpMat< IU, NUM, DER > &A, const int32_t *indx, const IVT *numx, int32_t nnzx, int32_t *sendindbuf, OVT *sendnumbuf, int *cnts, int *dspls, int p_c)
 
template<typename SR , typename MIND , typename VIND , typename DER , typename NUM , typename IVT , typename OVT >
void generic_gespmv (const SpMat< MIND, NUM, DER > &A, const VIND *indx, const IVT *numx, VIND nnzx, vector< VIND > &indy, vector< OVT > &numy, PreAllocatedSPA< OVT > &SPA)
 
template<typename SR , typename IU , typename DER , typename NUM , typename IVT , typename OVT >
void generic_gespmv (const SpMat< IU, NUM, DER > &A, const int32_t *indx, const IVT *numx, int32_t nnzx, int32_t *indy, OVT *numy, int *cnts, int *dspls, int p_c, bool indexisvalue)
 
template<typename IU >
void BooleanRowSplit (SpDCCols< IU, bool > &A, int numsplits)
 
template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples< IU, NUO > * Tuples_AnXBt (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA=false, bool clearB=false)
 
template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples< IU, NUO > * Tuples_AnXBn (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA=false, bool clearB=false)
 
template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples< IU, NUO > * Tuples_AtXBt (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA=false, bool clearB=false)
 
template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples< IU, NUO > * Tuples_AtXBn (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA=false, bool clearB=false)
 
template<class SR , class IU , class NU >
SpTuples< IU, NU > MergeAll (const vector< SpTuples< IU, NU > *> &ArrSpTups, IU mstar=0, IU nstar=0, bool delarrs=false)
 
template<typename IU , typename NU1 , typename NU2 >
Dcsc< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseMult (const Dcsc< IU, NU1 > &A, const Dcsc< IU, NU2 > *B, bool exclude)
 
template<typename N_promote , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation >
Dcsc< IU, N_promote > EWiseApply (const Dcsc< IU, NU1 > &A, const Dcsc< IU, NU2 > *B, _BinaryOperation __binary_op, bool notB, const NU2 &defaultBVal)
 
template<typename IU , typename NU1 , typename NU2 >
SpDCCols< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseMult (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool exclude)
 
template<typename N_promote , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation >
SpDCCols< IU, N_promote > EWiseApply (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, _BinaryOperation __binary_op, bool notB, const NU2 &defaultBVal)
 
template<typename RETT , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
Dcsc< IU, RETT > EWiseApply (const Dcsc< IU, NU1 > *Ap, const Dcsc< IU, NU2 > *Bp, _BinaryOperation __binary_op, _BinaryPredicate do_op, bool allowANulls, bool allowBNulls, const NU1 &ANullVal, const NU2 &BNullVal, const bool allowIntersect)
 
template<typename RETT , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
SpDCCols< IU, RETT > EWiseApply (const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, _BinaryOperation __binary_op, _BinaryPredicate do_op, bool allowANulls, bool allowBNulls, const NU1 &ANullVal, const NU2 &BNullVal, const bool allowIntersect)
 

Function Documentation

◆ BooleanRowSplit()

template<typename IU >
void BooleanRowSplit ( SpDCCols< IU, bool > &  A,
int  numsplits 
)

Definition at line 438 of file Friends.h.

◆ dcsc_gespmv()

template<typename SR , typename IU , typename NU , typename RHS , typename LHS >
void dcsc_gespmv ( const SpDCCols< IU, NU > &  A,
const RHS *  x,
LHS *  y 
)

SpMV with dense vector.

Definition at line 63 of file Friends.h.

◆ dcsc_gespmv_threaded()

template<typename SR , typename IU , typename NU , typename RHS , typename LHS >
void dcsc_gespmv_threaded ( const SpDCCols< IU, NU > &  A,
const RHS *  x,
LHS *  y 
)

SpMV with dense vector (multithreaded version)

Definition at line 81 of file Friends.h.

◆ EWiseApply() [1/4]

template<typename N_promote , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation >
Dcsc<IU, N_promote> EWiseApply ( const Dcsc< IU, NU1 > &  A,
const Dcsc< IU, NU2 > *  B,
_BinaryOperation  __binary_op,
bool  notB,
const NU2 &  defaultBVal 
)

Definition at line 813 of file Friends.h.

◆ EWiseApply() [2/4]

template<typename N_promote , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation >
SpDCCols<IU, N_promote> EWiseApply ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
_BinaryOperation  __binary_op,
bool  notB,
const NU2 &  defaultBVal 
)

Definition at line 959 of file Friends.h.

◆ EWiseApply() [3/4]

template<typename RETT , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
Dcsc<IU, RETT> EWiseApply ( const Dcsc< IU, NU1 > *  Ap,
const Dcsc< IU, NU2 > *  Bp,
_BinaryOperation  __binary_op,
_BinaryPredicate  do_op,
bool  allowANulls,
bool  allowBNulls,
const NU1 &  ANullVal,
const NU2 &  BNullVal,
const bool  allowIntersect 
)

Implementation based on operator += Element wise apply with the following constraints The operation to be performed is __binary_op The operation c = __binary_op(a, b) is only performed if do_op(a, b) returns true If allowANulls is true, then if A is missing an element that B has, then ANullVal is used In that case the operation becomes c[i,j] = __binary_op(ANullVal, b[i,j]) If both allowANulls and allowBNulls is false then the function degenerates into intersection

Definition at line 992 of file Friends.h.

◆ EWiseApply() [4/4]

template<typename RETT , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
SpDCCols<IU,RETT> EWiseApply ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
_BinaryOperation  __binary_op,
_BinaryPredicate  do_op,
bool  allowANulls,
bool  allowBNulls,
const NU1 &  ANullVal,
const NU2 &  BNullVal,
const bool  allowIntersect 
)

Definition at line 1223 of file Friends.h.

◆ EWiseMult() [1/2]

template<typename IU , typename NU1 , typename NU2 >
Dcsc<IU, typename promote_trait<NU1,NU2>::T_promote> EWiseMult ( const Dcsc< IU, NU1 > &  A,
const Dcsc< IU, NU2 > *  B,
bool  exclude 
)
Parameters
[in]excludeif false,
then operation is A = A .* B
else operation is A = A .* not(B)

Definition at line 693 of file Friends.h.

◆ EWiseMult() [2/2]

template<typename IU , typename NU1 , typename NU2 >
SpDCCols<IU, typename promote_trait<NU1,NU2>::T_promote > EWiseMult ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
bool  exclude 
)

Definition at line 934 of file Friends.h.

◆ generic_gespmv() [1/2]

template<typename SR , typename MIND , typename VIND , typename DER , typename NUM , typename IVT , typename OVT >
void generic_gespmv ( const SpMat< MIND, NUM, DER > &  A,
const VIND *  indx,
const IVT *  numx,
VIND  nnzx,
vector< VIND > &  indy,
vector< OVT > &  numy,
PreAllocatedSPA< OVT > &  SPA 
)

SpMV with sparse vector MIND: Matrix index type VIND: Vector index type (optimized: int32_t, general: int64_t)

Definition at line 401 of file Friends.h.

◆ generic_gespmv() [2/2]

template<typename SR , typename IU , typename DER , typename NUM , typename IVT , typename OVT >
void generic_gespmv ( const SpMat< IU, NUM, DER > &  A,
const int32_t *  indx,
const IVT *  numx,
int32_t  nnzx,
int32_t *  indy,
OVT *  numy,
int *  cnts,
int *  dspls,
int  p_c,
bool  indexisvalue 
)

SpMV with sparse vector

Parameters
[in]indexisvalueis only used for BFS-like computations, if true then we can call the optimized version that skips SPA

Definition at line 420 of file Friends.h.

◆ generic_gespmv_threaded()

template<typename SR , typename IU , typename NUM , typename DER , typename IVT , typename OVT >
int generic_gespmv_threaded ( const SpMat< IU, NUM, DER > &  A,
const int32_t *  indx,
const IVT *  numx,
int32_t  nnzx,
int32_t *&  sendindbuf,
OVT *&  sendnumbuf,
int *&  sdispls,
int  p_c,
PreAllocatedSPA< OVT > &  SPA 
)

Multithreaded SpMV with sparse vector the assembly of outgoing buffers sendindbuf/sendnumbuf are done here

Definition at line 138 of file Friends.h.

◆ generic_gespmv_threaded_setbuffers()

template<typename SR , typename IU , typename NUM , typename DER , typename IVT , typename OVT >
void generic_gespmv_threaded_setbuffers ( const SpMat< IU, NUM, DER > &  A,
const int32_t *  indx,
const IVT *  numx,
int32_t  nnzx,
int32_t *  sendindbuf,
OVT *  sendnumbuf,
int *  cnts,
int *  dspls,
int  p_c 
)

Multithreaded SpMV with sparse vector and preset buffers the assembly of outgoing buffers sendindbuf/sendnumbuf are done here IVT: input vector numerical type OVT: output vector numerical type

Definition at line 279 of file Friends.h.

◆ MergeAll()

template<class SR , class IU , class NU >
SpTuples<IU,NU> MergeAll ( const vector< SpTuples< IU, NU > *> &  ArrSpTups,
IU  mstar = 0,
IU  nstar = 0,
bool  delarrs = false 
)

Definition at line 604 of file Friends.h.

◆ Tuples_AnXBn()

template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples<IU, NUO>* Tuples_AnXBn ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
bool  clearA = false,
bool  clearB = false 
)

SpTuples(A*B) (Using ColByCol Algorithm) Returns the tuples for efficient merging later Support mixed precision multiplication The multiplication is on the specified semiring (passed as parameter)

Definition at line 553 of file Friends.h.

◆ Tuples_AnXBt()

template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples<IU, NUO>* Tuples_AnXBt ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
bool  clearA = false,
bool  clearB = false 
)

SpTuples(A*B') (Using OuterProduct Algorithm) Returns the tuples for efficient merging later Support mixed precision multiplication The multiplication is on the specified semiring (passed as parameter)

Definition at line 510 of file Friends.h.

◆ Tuples_AtXBn()

template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples<IU, NUO>* Tuples_AtXBn ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
bool  clearA = false,
bool  clearB = false 
)

Definition at line 590 of file Friends.h.

◆ Tuples_AtXBt()

template<class SR , class NUO , class IU , class NU1 , class NU2 >
SpTuples<IU, NUO>* Tuples_AtXBt ( const SpDCCols< IU, NU1 > &  A,
const SpDCCols< IU, NU2 > &  B,
bool  clearA = false,
bool  clearB = false 
)

Definition at line 577 of file Friends.h.