COMBINATORIAL_BLAS  1.6
FullyDistSpVec< IT, NT > Class Template Reference

#include <FullyDistSpVec.h>

Inheritance diagram for FullyDistSpVec< IT, NT >:
FullyDist< IT, NT, CombBLAS::disable_if< CombBLAS::is_boolean< NT >::value, NT >::type >

Classes

class  ScalarReadSaveHandler
 

Public Member Functions

 FullyDistSpVec ()
 
 FullyDistSpVec (IT glen)
 
 FullyDistSpVec (shared_ptr< CommGrid > grid)
 
 FullyDistSpVec (shared_ptr< CommGrid > grid, IT glen)
 
template<typename _UnaryOperation >
 FullyDistSpVec (const FullyDistVec< IT, NT > &rhs, _UnaryOperation unop)
 
 FullyDistSpVec (const FullyDistVec< IT, NT > &rhs)
 
 FullyDistSpVec (IT globalsize, const FullyDistVec< IT, IT > &inds, const FullyDistVec< IT, NT > &vals, bool SumDuplicates=false)
 
 FullyDistSpVec (shared_ptr< CommGrid > grid, IT globallen, const vector< IT > &indvec, const vector< NT > &numvec, bool SumDuplicates=false, bool sorted=false)
 
IT NnzUntil () const
 Returns the number of nonzeros until this processor. More...
 
FullyDistSpVec< IT, NT > Invert (IT globallen)
 
template<typename _BinaryOperationIdx , typename _BinaryOperationVal , typename _BinaryOperationDuplicate >
FullyDistSpVec< IT, NT > Invert (IT globallen, _BinaryOperationIdx __binopIdx, _BinaryOperationVal __binopVal, _BinaryOperationDuplicate __binopDuplicate)
 
template<typename _BinaryOperationIdx , typename _BinaryOperationVal >
FullyDistSpVec< IT, NT > InvertRMA (IT globallen, _BinaryOperationIdx __binopIdx, _BinaryOperationVal __binopVal)
 
template<typename NT1 , typename _UnaryOperation >
void Select (const FullyDistVec< IT, NT1 > &denseVec, _UnaryOperation unop)
 
template<typename _UnaryOperation >
void FilterByVal (FullyDistSpVec< IT, IT > Selector, _UnaryOperation __unop, bool filterByIndex)
 
template<typename NT1 >
void Setminus (const FullyDistSpVec< IT, NT1 > &other)
 
template<typename NT1 , typename _UnaryOperation , typename _BinaryOperation >
void SelectApply (const FullyDistVec< IT, NT1 > &denseVec, _UnaryOperation __unop, _BinaryOperation __binop)
 
void stealFrom (FullyDistSpVec< IT, NT > &victim)
 
FullyDistSpVec< IT, NT > & operator= (const FullyDistSpVec< IT, NT > &rhs)
 
FullyDistSpVec< IT, NT > & operator= (const FullyDistVec< IT, NT > &rhs)
 
FullyDistSpVec< IT, NT > & operator= (NT fixedval)
 
FullyDistSpVec< IT, NT > & operator+= (const FullyDistSpVec< IT, NT > &rhs)
 
FullyDistSpVec< IT, NT > & operator-= (const FullyDistSpVec< IT, NT > &rhs)
 
template<class HANDLER >
void ParallelWrite (const string &filename, bool onebased, HANDLER handler, bool includeindices=true, bool includeheader=false)
 
void ParallelWrite (const string &filename, bool onebased, bool includeindices=true)
 
template<typename _BinaryOperation >
void ParallelRead (const string &filename, bool onebased, _BinaryOperation BinOp)
 
template<class HANDLER >
ifstream & ReadDistribute (ifstream &infile, int master, HANDLER handler)
 Totally obsolete version that only accepts an ifstream object and ascii files. More...
 
ifstream & ReadDistribute (ifstream &infile, int master)
 
template<class HANDLER >
void SaveGathered (ofstream &outfile, int master, HANDLER handler, bool printProcSplits=false)
 
void SaveGathered (ofstream &outfile, int master)
 
template<typename NNT >
 operator FullyDistSpVec< IT, NNT > () const
 < Type conversion operator More...
 
bool operator== (const FullyDistSpVec< IT, NT > &rhs) const
 
void PrintInfo (string vecname) const
 
void iota (IT globalsize, NT first)
 
void nziota (NT first)
 iota over existing nonzero entries More...
 
FullyDistVec< IT, NT > operator() (const FullyDistVec< IT, IT > &ri) const
 SpRef (expects ri to be 0-based) More...
 
void SetElement (IT indx, NT numx)
 Indexing is performed 0-based. More...
 
void DelElement (IT indx)
 
NT operator[] (IT indx)
 
bool WasFound () const
 
FullyDistSpVec< IT, IT > sort ()
 sort the vector itself, return the permutation vector (0-based) More...
 
template<typename _BinaryOperation >
FullyDistSpVec< IT, NT > Uniq (_BinaryOperation __binary_op, MPI_Op mympiop)
 
IT getlocnnz () const
 
IT getnnz () const
 
void setNumToInd ()
 
template<typename _Predicate >
IT Count (_Predicate pred) const
 Return the number of elements for which pred is true. More...
 
template<typename _UnaryOperation >
void Apply (_UnaryOperation __unary_op)
 
template<typename _BinaryOperation >
void ApplyInd (_BinaryOperation __binary_op)
 
template<typename _BinaryOperation >
NT Reduce (_BinaryOperation __binary_op, NT init) const
 
template<typename OUT , typename _BinaryOperation , typename _UnaryOperation >
OUT Reduce (_BinaryOperation __binary_op, OUT default_val, _UnaryOperation __unary_op) const
 
void DebugPrint ()
 
shared_ptr< CommGridgetcommgrid () const
 
void Reset ()
 
NT GetLocalElement (IT indx)
 
void BulkSet (IT inds[], int count)
 
vector< IT > GetLocalInd ()
 
vector< NT > GetLocalNum ()
 
template<typename _Predicate >
FullyDistVec< IT, IT > FindInds (_Predicate pred) const
 
template<typename _Predicate >
FullyDistVec< IT, NT > FindVals (_Predicate pred) const
 

Friends

template<class IU , class NU >
class FullyDistSpVec
 
template<class IU , class NU >
class FullyDistVec
 
template<class IU , class NU , class UDER >
class SpParMat
 
template<class IU , class NU >
class SparseVectorLocalIterator
 
template<typename SR , typename IU , typename NUM , typename NUV , typename UDER >
FullyDistSpVec< IU, typename promote_trait< NUM, NUV >::T_promote > SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, NUV > &x)
 
template<typename SR , typename IU , typename NUM , typename UDER >
FullyDistSpVec< IU, typename promote_trait< NUM, IU >::T_promote > SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, IU > &x, bool indexisvalue)
 
template<typename VT , typename IU , typename UDER >
FullyDistSpVec< IU, VT > SpMV (const SpParMat< IU, bool, UDER > &A, const FullyDistSpVec< IU, VT > &x, OptBuf< int32_t, VT > &optbuf)
 
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, IVT > &x, FullyDistSpVec< IU, OVT > &y, bool indexisvalue, OptBuf< int32_t, OVT > &optbuf)
 
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, IVT > &x, FullyDistSpVec< IU, OVT > &y, bool indexisvalue, OptBuf< int32_t, OVT > &optbuf, PreAllocatedSPA< OVT > &SPA)
 
template<typename IU , typename NU1 , typename NU2 >
FullyDistSpVec< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseMult (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, bool exclude, NU2 zero)
 
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
FullyDistSpVec< IU, RET > EWiseApply (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, _BinaryPredicate _doOp, bool allowVNulls, NU1 Vzero, const bool useExtendedBinOp)
 
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
FullyDistSpVec< IU, RET > EWiseApply_threaded (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, _BinaryPredicate _doOp, bool allowVNulls, NU1 Vzero, const bool useExtendedBinOp)
 
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
FullyDistSpVec< IU, RET > EWiseApply (const FullyDistSpVec< IU, NU1 > &V, const FullyDistSpVec< IU, NU2 > &W, _BinaryOperation _binary_op, _BinaryPredicate _doOp, bool allowVNulls, bool allowWNulls, NU1 Vzero, NU2 Wzero, const bool allowIntersect, const bool useExtendedBinOp)
 
template<typename IU >
void RandPerm (FullyDistSpVec< IU, IU > &V)
 
template<typename IU >
void RenameVertices (DistEdgeList< IU > &DEL)
 
template<typename IU , typename VT >
void MergeContributions (FullyDistSpVec< IU, VT > &y, int *&recvcnt, int *&rdispls, int32_t *&recvindbuf, VT *&recvnumbuf, int rowneighs)
 Helper functions for sparse matrix X sparse vector. More...
 
template<typename IU , typename NV >
void TransposeVector (MPI_Comm &World, const FullyDistSpVec< IU, NV > &x, int32_t &trxlocnz, IU &lenuntil, int32_t *&trxinds, NV *&trxnums, bool indexisvalue)
 
template<class IU , class NU , class DER , typename _UnaryOperation >
SpParMat< IU, bool, DER > PermMat1 (const FullyDistSpVec< IU, NU > &ri, const IU ncol, _UnaryOperation __unop)
 

Detailed Description

template<class IT, class NT>
class FullyDistSpVec< IT, NT >

A sparse vector of length n (with nnz <= n of them being nonzeros) is distributed to "all the processors" in a way that "respects ordering" of the nonzero indices Example: x = [5,1,6,2,9] for nnz(x)=5 and length(x)=12 we use 4 processors P_00, P_01, P_10, P_11 Then P_00 owns 1,2, P_01 ow`ns 5, and so on. In the case of A(v,w) type sparse matrix indexing, this doesn't matter because n = nnz After all, A(v,w) will have dimensions length(v) x length (w) v and w will be of numerical type (NT) "int" and their indices (IT) will be consecutive integers It is possibly that nonzero counts are distributed unevenly Example: x=[1,2,3,4,5] and length(x) = 20, then P_00 would own all the nonzeros and the rest will hold empry vectors Just like in SpParMat case, indices are local to processors (they belong to range [0,...,length-1] on each processor)

Warning
Always create vectors with the right length, setting elements won't increase its length (similar to operator[] on std::vector)

Definition at line 71 of file FullyDistSpVec.h.

Constructor & Destructor Documentation

◆ FullyDistSpVec() [1/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( )

Definition at line 59 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [2/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( IT  glen)
explicit

Definition at line 64 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [3/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( shared_ptr< CommGrid grid)

Definition at line 49 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [4/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( shared_ptr< CommGrid grid,
IT  glen 
)

Definition at line 54 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [5/8]

template<class IT , class NT >
template<typename _UnaryOperation >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( const FullyDistVec< IT, NT > &  rhs,
_UnaryOperation  unop 
)

Definition at line 91 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [6/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( const FullyDistVec< IT, NT > &  rhs)

Definition at line 82 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [7/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( IT  globalsize,
const FullyDistVec< IT, IT > &  inds,
const FullyDistVec< IT, NT > &  vals,
bool  SumDuplicates = false 
)

Definition at line 209 of file FullyDistSpVec.cpp.

◆ FullyDistSpVec() [8/8]

template<class IT , class NT >
FullyDistSpVec< IT, NT >::FullyDistSpVec ( shared_ptr< CommGrid grid,
IT  globallen,
const vector< IT > &  indvec,
const vector< NT > &  numvec,
bool  SumDuplicates = false,
bool  sorted = false 
)

Definition at line 113 of file FullyDistSpVec.cpp.

Member Function Documentation

◆ Apply()

template<class IT, class NT>
template<typename _UnaryOperation >
void FullyDistSpVec< IT, NT >::Apply ( _UnaryOperation  __unary_op)
inline

Definition at line 235 of file FullyDistSpVec.h.

◆ ApplyInd()

template<class IT, class NT>
template<typename _BinaryOperation >
void FullyDistSpVec< IT, NT >::ApplyInd ( _BinaryOperation  __binary_op)
inline

Definition at line 247 of file FullyDistSpVec.h.

◆ BulkSet()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::BulkSet ( IT  inds[],
int  count 
)

Definition at line 1783 of file FullyDistSpVec.cpp.

◆ Count()

template<class IT , class NT >
template<typename _Predicate >
IT FullyDistSpVec< IT, NT >::Count ( _Predicate  pred) const

Return the number of elements for which pred is true.

Definition at line 1639 of file FullyDistSpVec.cpp.

◆ DebugPrint()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::DebugPrint ( )

Definition at line 1694 of file FullyDistSpVec.cpp.

◆ DelElement()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::DelElement ( IT  indx)

Definition at line 541 of file FullyDistSpVec.cpp.

◆ FilterByVal()

template<class IT , class NT >
template<typename _UnaryOperation >
void FullyDistSpVec< IT, NT >::FilterByVal ( FullyDistSpVec< IT, IT >  Selector,
_UnaryOperation  __unop,
bool  filterByIndex 
)

Definition at line 2517 of file FullyDistSpVec.cpp.

◆ FindInds()

template<class IT , class NT >
template<typename _Predicate >
FullyDistVec< IT, IT > FullyDistSpVec< IT, NT >::FindInds ( _Predicate  pred) const

Returns a dense vector of nonzero global indices for which the predicate is satisfied on values

Definition at line 394 of file FullyDistSpVec.cpp.

◆ FindVals()

template<class IT , class NT >
template<typename _Predicate >
FullyDistVec< IT, NT > FullyDistSpVec< IT, NT >::FindVals ( _Predicate  pred) const

Returns a dense vector of nonzero values for which the predicate is satisfied on values

Definition at line 330 of file FullyDistSpVec.cpp.

◆ getcommgrid()

template<class IT, class NT>
shared_ptr<CommGrid> FullyDistSpVec< IT, NT >::getcommgrid ( ) const
inline

Definition at line 267 of file FullyDistSpVec.h.

◆ GetLocalElement()

template<class IT , class NT >
NT FullyDistSpVec< IT, NT >::GetLocalElement ( IT  indx)

Definition at line 491 of file FullyDistSpVec.cpp.

◆ GetLocalInd()

template<class IT, class NT>
vector<IT> FullyDistSpVec< IT, NT >::GetLocalInd ( )
inline

Definition at line 272 of file FullyDistSpVec.h.

◆ GetLocalNum()

template<class IT, class NT>
vector<NT> FullyDistSpVec< IT, NT >::GetLocalNum ( )
inline

Definition at line 273 of file FullyDistSpVec.h.

◆ getlocnnz()

template<class IT, class NT>
IT FullyDistSpVec< IT, NT >::getlocnnz ( ) const
inline

Definition at line 202 of file FullyDistSpVec.h.

◆ getnnz()

template<class IT, class NT>
IT FullyDistSpVec< IT, NT >::getnnz ( ) const
inline

Definition at line 206 of file FullyDistSpVec.h.

◆ Invert() [1/2]

template<class IT , class NT >
FullyDistSpVec< IT, NT > FullyDistSpVec< IT, NT >::Invert ( IT  globallen)

Definition at line 1901 of file FullyDistSpVec.cpp.

◆ Invert() [2/2]

template<class IT , class NT >
template<typename _BinaryOperationIdx , typename _BinaryOperationVal , typename _BinaryOperationDuplicate >
FullyDistSpVec< IT, NT > FullyDistSpVec< IT, NT >::Invert ( IT  globallen,
_BinaryOperationIdx  __binopIdx,
_BinaryOperationVal  __binopVal,
_BinaryOperationDuplicate  __binopDuplicate 
)

Definition at line 2027 of file FullyDistSpVec.cpp.

◆ InvertRMA()

template<class IT , class NT >
template<typename _BinaryOperationIdx , typename _BinaryOperationVal >
FullyDistSpVec< IT, NT > FullyDistSpVec< IT, NT >::InvertRMA ( IT  globallen,
_BinaryOperationIdx  __binopIdx,
_BinaryOperationVal  __binopVal 
)

Definition at line 2172 of file FullyDistSpVec.cpp.

◆ iota()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::iota ( IT  globalsize,
NT  first 
)

Definition at line 676 of file FullyDistSpVec.cpp.

◆ NnzUntil()

template<class IT , class NT >
IT FullyDistSpVec< IT, NT >::NnzUntil ( ) const

Returns the number of nonzeros until this processor.

Definition at line 696 of file FullyDistSpVec.cpp.

◆ nziota()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::nziota ( NT  first)

iota over existing nonzero entries

Definition at line 689 of file FullyDistSpVec.cpp.

◆ operator FullyDistSpVec< IT, NNT >()

template<class IT, class NT>
template<typename NNT >
FullyDistSpVec< IT, NT >::operator FullyDistSpVec< IT, NNT > ( ) const
inline

< Type conversion operator

Definition at line 165 of file FullyDistSpVec.h.

◆ operator()()

template<class IT , class NT >
FullyDistVec< IT, NT > FullyDistSpVec< IT, NT >::operator() ( const FullyDistVec< IT, IT > &  ri) const

SpRef (expects ri to be 0-based)

The distribution and length are inherited from ri Its zero is inherited from *this (because ri is of type IT) Example: This is [{1,n1},{4,n4},{7,n7},{8,n8},{9,n9}] with P_00 owning {1,4} and P_11 rest Assume ri = [4,1,5,7] is distributed as two elements per processor Then result has length 4, distrubuted two element per processor, even though 5 and 7 doesn't exist This is because we are returning a "dense" output, so the absent elements will be padded with 0

Definition at line 565 of file FullyDistSpVec.cpp.

◆ operator+=()

template<class IT , class NT >
FullyDistSpVec< IT, NT > & FullyDistSpVec< IT, NT >::operator+= ( const FullyDistSpVec< IT, NT > &  rhs)

Definition at line 1035 of file FullyDistSpVec.cpp.

◆ operator-=()

template<class IT , class NT >
FullyDistSpVec< IT, NT > & FullyDistSpVec< IT, NT >::operator-= ( const FullyDistSpVec< IT, NT > &  rhs)

Definition at line 1094 of file FullyDistSpVec.cpp.

◆ operator=() [1/3]

template<class IT , class NT >
FullyDistSpVec< IT, NT > & FullyDistSpVec< IT, NT >::operator= ( const FullyDistSpVec< IT, NT > &  rhs)

Definition at line 70 of file FullyDistSpVec.cpp.

◆ operator=() [2/3]

template<class IT , class NT >
FullyDistSpVec< IT, NT > & FullyDistSpVec< IT, NT >::operator= ( const FullyDistVec< IT, NT > &  rhs)

Definition at line 183 of file FullyDistSpVec.cpp.

◆ operator=() [3/3]

template<class IT, class NT>
FullyDistSpVec<IT,NT>& FullyDistSpVec< IT, NT >::operator= ( NT  fixedval)
inline

Definition at line 114 of file FullyDistSpVec.h.

◆ operator==()

template<class IT, class NT>
bool FullyDistSpVec< IT, NT >::operator== ( const FullyDistSpVec< IT, NT > &  rhs) const
inline

Definition at line 174 of file FullyDistSpVec.h.

◆ operator[]()

template<class IT , class NT >
NT FullyDistSpVec< IT, NT >::operator[] ( IT  indx)

Definition at line 464 of file FullyDistSpVec.cpp.

◆ ParallelRead()

template<class IT , class NT >
template<typename _BinaryOperation >
void FullyDistSpVec< IT, NT >::ParallelRead ( const string &  filename,
bool  onebased,
_BinaryOperation  BinOp 
)

Definition at line 1209 of file FullyDistSpVec.cpp.

◆ ParallelWrite() [1/2]

template<class IT , class NT >
template<class HANDLER >
void FullyDistSpVec< IT, NT >::ParallelWrite ( const string &  filename,
bool  onebased,
HANDLER  handler,
bool  includeindices = true,
bool  includeheader = false 
)

Definition at line 1310 of file FullyDistSpVec.cpp.

◆ ParallelWrite() [2/2]

template<class IT, class NT>
void FullyDistSpVec< IT, NT >::ParallelWrite ( const string &  filename,
bool  onebased,
bool  includeindices = true 
)
inline

Definition at line 148 of file FullyDistSpVec.h.

◆ PrintInfo()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::PrintInfo ( string  vecname) const

Definition at line 1686 of file FullyDistSpVec.cpp.

◆ ReadDistribute() [1/2]

template<class IT , class NT >
template<class HANDLER >
ifstream & FullyDistSpVec< IT, NT >::ReadDistribute ( ifstream &  infile,
int  master,
HANDLER  handler 
)

Totally obsolete version that only accepts an ifstream object and ascii files.

Called on an existing object ABAB: Obsolete, will be deleted once moved to Github (and becomes independent of KDT)

Definition at line 1397 of file FullyDistSpVec.cpp.

◆ ReadDistribute() [2/2]

template<class IT, class NT>
ifstream& FullyDistSpVec< IT, NT >::ReadDistribute ( ifstream &  infile,
int  master 
)
inline

Definition at line 158 of file FullyDistSpVec.h.

◆ Reduce() [1/2]

template<class IT , class NT >
template<typename _BinaryOperation >
NT FullyDistSpVec< IT, NT >::Reduce ( _BinaryOperation  __binary_op,
NT  init 
) const

Definition at line 1650 of file FullyDistSpVec.cpp.

◆ Reduce() [2/2]

template<class IT , class NT >
template<typename OUT , typename _BinaryOperation , typename _UnaryOperation >
OUT FullyDistSpVec< IT, NT >::Reduce ( _BinaryOperation  __binary_op,
OUT  default_val,
_UnaryOperation  __unary_op 
) const

Definition at line 1663 of file FullyDistSpVec.cpp.

◆ Reset()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::Reset ( )

Definition at line 1775 of file FullyDistSpVec.cpp.

◆ SaveGathered() [1/2]

template<class IT , class NT >
template<class HANDLER >
void FullyDistSpVec< IT, NT >::SaveGathered ( ofstream &  outfile,
int  master,
HANDLER  handler,
bool  printProcSplits = false 
)

Definition at line 1529 of file FullyDistSpVec.cpp.

◆ SaveGathered() [2/2]

template<class IT, class NT>
void FullyDistSpVec< IT, NT >::SaveGathered ( ofstream &  outfile,
int  master 
)
inline

Definition at line 162 of file FullyDistSpVec.h.

◆ Select()

template<typename IT , typename NT >
template<typename NT1 , typename _UnaryOperation >
void FullyDistSpVec< IT, NT >::Select ( const FullyDistVec< IT, NT1 > &  denseVec,
_UnaryOperation  unop 
)

Definition at line 2358 of file FullyDistSpVec.cpp.

◆ SelectApply()

template<typename IT , typename NT >
template<typename NT1 , typename _UnaryOperation , typename _BinaryOperation >
void FullyDistSpVec< IT, NT >::SelectApply ( const FullyDistVec< IT, NT1 > &  denseVec,
_UnaryOperation  __unop,
_BinaryOperation  __binop 
)

Definition at line 2454 of file FullyDistSpVec.cpp.

◆ SetElement()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::SetElement ( IT  indx,
NT  numx 
)

Indexing is performed 0-based.

Definition at line 511 of file FullyDistSpVec.cpp.

◆ Setminus()

template<typename IT , typename NT >
template<typename NT1 >
void FullyDistSpVec< IT, NT >::Setminus ( const FullyDistSpVec< IT, NT1 > &  other)

Definition at line 2400 of file FullyDistSpVec.cpp.

◆ setNumToInd()

template<class IT, class NT>
void FullyDistSpVec< IT, NT >::setNumToInd ( )
inline

Definition at line 220 of file FullyDistSpVec.h.

◆ sort()

template<class IT , class NT >
FullyDistSpVec< IT, IT > FullyDistSpVec< IT, NT >::sort ( )

sort the vector itself, return the permutation vector (0-based)

Definition at line 769 of file FullyDistSpVec.cpp.

◆ stealFrom()

template<class IT , class NT >
void FullyDistSpVec< IT, NT >::stealFrom ( FullyDistSpVec< IT, NT > &  victim)

like operator=, but instead of making a deep copy it just steals the contents. Useful for places where the "victim" will be distroyed immediately after the call.

Definition at line 456 of file FullyDistSpVec.cpp.

◆ Uniq()

template<class IT , class NT >
template<typename _BinaryOperation >
FullyDistSpVec< IT, NT > FullyDistSpVec< IT, NT >::Uniq ( _BinaryOperation  __binary_op,
MPI_Op  mympiop 
)

Definition at line 1029 of file FullyDistSpVec.cpp.

◆ WasFound()

template<class IT, class NT>
bool FullyDistSpVec< IT, NT >::WasFound ( ) const
inline

Definition at line 188 of file FullyDistSpVec.h.

Friends And Related Function Documentation

◆ EWiseApply [1/2]

template<class IT, class NT>
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
FullyDistSpVec<IU,RET> EWiseApply ( const FullyDistSpVec< IU, NU1 > &  V,
const FullyDistVec< IU, NU2 > &  W,
_BinaryOperation  _binary_op,
_BinaryPredicate  _doOp,
bool  allowVNulls,
NU1  Vzero,
const bool  useExtendedBinOp 
)
friend

Performs an arbitrary binary operation _binary_op on the corresponding elements of two vectors with the result stored in a return vector ret. The binary operatiation is only performed if the binary predicate _doOp returns true for those elements. Otherwise the binary operation is not performed and ret does not contain an element at that position. More formally the operation is defined as: if (_doOp(V[i], W[i])) ret[i] = _binary_op(V[i], W[i]) else // ret[i] is not set Hence _doOp can be used to implement a filter on either of the vectors.

The above is only defined if both V[i] and W[i] exist (i.e. an intersection). To allow a union operation (ex. when V[i] doesn't exist but W[i] does) the allowVNulls flag is set to true and the Vzero argument is used as the missing V[i] value.

The type of each element of ret must not necessarily be related to the types of V or W, so the return type must be explicitly specified as a template parameter: FullyDistSpVec<int, double> r = EWiseApply<double>(V, W, plus, retTrue, false, 0)

Definition at line 2020 of file ParFriends.h.

◆ EWiseApply [2/2]

template<class IT, class NT>
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
FullyDistSpVec<IU,RET> EWiseApply ( const FullyDistSpVec< IU, NU1 > &  V,
const FullyDistSpVec< IU, NU2 > &  W,
_BinaryOperation  _binary_op,
_BinaryPredicate  _doOp,
bool  allowVNulls,
bool  allowWNulls,
NU1  Vzero,
NU2  Wzero,
const bool  allowIntersect,
const bool  useExtendedBinOp 
)
friend

Performs an arbitrary binary operation _binary_op on the corresponding elements of two vectors with the result stored in a return vector ret. The binary operatiation is only performed if the binary predicate _doOp returns true for those elements. Otherwise the binary operation is not performed and ret does not contain an element at that position. More formally the operation is defined as: if (_doOp(V[i], W[i])) ret[i] = _binary_op(V[i], W[i]) else // ret[i] is not set Hence _doOp can be used to implement a filter on either of the vectors.

The above is only defined if both V[i] and W[i] exist (i.e. an intersection). To allow a union operation (ex. when V[i] doesn't exist but W[i] does) the allowVNulls flag is set to true and the Vzero argument is used as the missing V[i] value. !allowVNulls && !allowWNulls => intersection !allowVNulls && allowWNulls => operate on all elements of V allowVNulls && !allowWNulls => operate on all elements of W allowVNulls && allowWNulls => union

The type of each element of ret must not necessarily be related to the types of V or W, so the return type must be explicitly specified as a template parameter: FullyDistSpVec<int, double> r = EWiseApply<double>(V, W, plus, ...) For intersection, Vzero and Wzero are irrelevant ABAB:

Todo:
: Should allowIntersect be "false" for all SetDifference uses?

Definition at line 2121 of file ParFriends.h.

◆ EWiseApply_threaded

template<class IT, class NT>
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate >
FullyDistSpVec<IU,RET> EWiseApply_threaded ( const FullyDistSpVec< IU, NU1 > &  V,
const FullyDistVec< IU, NU2 > &  W,
_BinaryOperation  _binary_op,
_BinaryPredicate  _doOp,
bool  allowVNulls,
NU1  Vzero,
const bool  useExtendedBinOp 
)
friend

Threaded EWiseApply. Only called internally from EWiseApply.

Definition at line 1874 of file ParFriends.h.

◆ EWiseMult

template<class IT, class NT>
template<typename IU , typename NU1 , typename NU2 >
FullyDistSpVec<IU,typename promote_trait<NU1,NU2>::T_promote> EWiseMult ( const FullyDistSpVec< IU, NU1 > &  V,
const FullyDistVec< IU, NU2 > &  W,
bool  exclude,
NU2  zero 
)
friend

if exclude is true, then we prune all entries W[i] != zero from V if exclude is false, then we perform a proper elementwise multiplication

Definition at line 1785 of file ParFriends.h.

◆ FullyDistSpVec

template<class IT, class NT>
template<class IU , class NU >
friend class FullyDistSpVec
friend

Definition at line 305 of file FullyDistSpVec.h.

◆ FullyDistVec

template<class IT, class NT>
template<class IU , class NU >
friend class FullyDistVec
friend

Definition at line 308 of file FullyDistSpVec.h.

◆ MergeContributions

template<class IT, class NT>
template<typename IU , typename VT >
void MergeContributions ( FullyDistSpVec< IU, VT > &  y,
int *&  recvcnt,
int *&  rdispls,
int32_t *&  recvindbuf,
VT *&  recvnumbuf,
int  rowneighs 
)
friend

Helper functions for sparse matrix X sparse vector.

Definition at line 223 of file BFSFriends.h.

◆ PermMat1

template<class IT, class NT>
template<class IU , class NU , class DER , typename _UnaryOperation >
SpParMat<IU, bool, DER> PermMat1 ( const FullyDistSpVec< IU, NU > &  ri,
const IU  ncol,
_UnaryOperation  __unop 
)
friend

◆ RandPerm

template<class IT, class NT>
template<typename IU >
void RandPerm ( FullyDistSpVec< IU, IU > &  V)
friend

◆ RenameVertices

template<class IT, class NT>
template<typename IU >
void RenameVertices ( DistEdgeList< IU > &  DEL)
friend

Rename vertices globally. You first need to do create a random permutation distributed on all processors. Then the p round robin algorithm will do the renaming: For all processors P(i,i) Broadcast local_p to all p processors For j= i*N/p to min((i+1)*N/p, N) Rename the all j's with local_p(j) inside the edgelist (and mark them "renamed" so that yeach vertex id is renamed only once)

Definition at line 363 of file DistEdgeList.cpp.

◆ SparseVectorLocalIterator

template<class IT, class NT>
template<class IU , class NU >
friend class SparseVectorLocalIterator
friend

Definition at line 314 of file FullyDistSpVec.h.

◆ SpMV [1/5]

template<class IT, class NT>
template<typename SR , typename IU , typename NUM , typename NUV , typename UDER >
FullyDistSpVec<IU,typename promote_trait<NUM,NUV>::T_promote> SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, NUV > &  x 
)
friend

: Old version that is no longer considered optimal Kept for legacy purposes To be removed when other functionals are fully tested.

Definition at line 1568 of file ParFriends.h.

◆ SpMV [2/5]

template<class IT, class NT>
template<typename SR , typename IU , typename NUM , typename UDER >
FullyDistSpVec<IU,typename promote_trait<NUM,IU>::T_promote> SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, IU > &  x,
bool  indexisvalue 
)
friend

Definition at line 938 of file ParFriends.h.

◆ SpMV [3/5]

template<class IT, class NT>
template<typename VT , typename IU , typename UDER >
FullyDistSpVec<IU,VT> SpMV ( const SpParMat< IU, bool, UDER > &  A,
const FullyDistSpVec< IU, VT > &  x,
OptBuf< int32_t, VT > &  optbuf 
)
friend

◆ SpMV [4/5]

template<class IT, class NT>
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, IVT > &  x,
FullyDistSpVec< IU, OVT > &  y,
bool  indexisvalue,
OptBuf< int32_t, OVT > &  optbuf 
)
friend

Definition at line 1462 of file ParFriends.h.

◆ SpMV [5/5]

template<class IT, class NT>
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, IVT > &  x,
FullyDistSpVec< IU, OVT > &  y,
bool  indexisvalue,
OptBuf< int32_t, OVT > &  optbuf,
PreAllocatedSPA< OVT > &  SPA 
)
friend

This version is the most flexible sparse matrix X sparse vector [Used in KDT] It accepts different types for the matrix (NUM), the input vector (IVT) and the output vector (OVT) without relying on automatic type promotion Input (x) and output (y) vectors can be ALIASED because y is not written until the algorithm is done with x.

Definition at line 1288 of file ParFriends.h.

◆ SpParMat

template<class IT, class NT>
template<class IU , class NU , class UDER >
friend class SpParMat
friend

Definition at line 311 of file FullyDistSpVec.h.

◆ TransposeVector

template<class IT, class NT>
template<typename IU , typename NV >
void TransposeVector ( MPI_Comm &  World,
const FullyDistSpVec< IU, NV > &  x,
int32_t &  trxlocnz,
IU &  lenuntil,
int32_t *&  trxinds,
NV *&  trxnums,
bool  indexisvalue 
)
friend

Step 1 of the sparse SpMV algorithm

Parameters
[in,out]trxlocnz,lenuntil,trxinds,trxnums{ set or allocated }
[in]indexisvalue

Definition at line 951 of file ParFriends.h.


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