COMBINATORIAL_BLAS  1.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Friends | List of all members
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< IT, NT > Invert (IT globallen)
 
template<typename _BinaryOperationIdx , typename _BinaryOperationVal >
FullyDistSpVec< IT, NT > Invert (IT globallen, _BinaryOperationIdx __binopIdx, _BinaryOperationVal __binopVal)
 
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 NT1 , typename _UnaryOperation1 , typename _UnaryOperation2 >
FullyDistSpVec< IT, NT1 > SelectNew (const FullyDistVec< IT, NT1 > &denseVec, _UnaryOperation1 __unop1, _UnaryOperation2 __unop2)
 
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)
 
template<typename NT1 , typename _UnaryOperation , typename _BinaryOperation >
FullyDistSpVec< IT, NT > SelectApplyNew (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 ReadDistribute (const string &filename, int master, HANDLER handler, bool pario)
 New (2014) version that can handle parallel IO and binary files. More...
 
void ReadDistribute (const string &filename, int master, bool pario)
 
template<class HANDLER >
ifstream & ReadDistribute (ifstream &infile, int master, HANDLER handler)
 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)
 
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 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 SR , typename IU , typename OVT >
void MergeContributions (FullyDistSpVec< IU, OVT > &y, int *&recvcnt, int *&rdispls, int32_t *&recvindbuf, OVT *&recvnumbuf, int rowneighs)
 Helper functions for sparse matrix X sparse vector. More...
 
template<typename IU , typename VT >
void MergeContributions (FullyDistSpVec< IU, VT > &y, int *&recvcnt, int *&rdispls, int32_t *&recvindbuf, VT *&recvnumbuf, int rowneighs)
 
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 70 of file FullyDistSpVec.h.

Constructor & Destructor Documentation

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

Definition at line 54 of file FullyDistSpVec.cpp.

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

Definition at line 59 of file FullyDistSpVec.cpp.

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

Definition at line 44 of file FullyDistSpVec.cpp.

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

Definition at line 49 of file FullyDistSpVec.cpp.

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

Definition at line 86 of file FullyDistSpVec.cpp.

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

Definition at line 77 of file FullyDistSpVec.cpp.

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 135 of file FullyDistSpVec.cpp.

Member Function Documentation

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

Definition at line 230 of file FullyDistSpVec.h.

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

Definition at line 242 of file FullyDistSpVec.h.

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

Definition at line 1957 of file FullyDistSpVec.cpp.

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 1813 of file FullyDistSpVec.cpp.

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

Definition at line 1868 of file FullyDistSpVec.cpp.

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

Definition at line 467 of file FullyDistSpVec.cpp.

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

Definition at line 2779 of file FullyDistSpVec.cpp.

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 320 of file FullyDistSpVec.cpp.

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 256 of file FullyDistSpVec.cpp.

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

Definition at line 262 of file FullyDistSpVec.h.

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

Definition at line 417 of file FullyDistSpVec.cpp.

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

Definition at line 267 of file FullyDistSpVec.h.

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

Definition at line 268 of file FullyDistSpVec.h.

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

Definition at line 197 of file FullyDistSpVec.h.

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

Definition at line 201 of file FullyDistSpVec.h.

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

Definition at line 2075 of file FullyDistSpVec.cpp.

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

Definition at line 2200 of file FullyDistSpVec.cpp.

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 2338 of file FullyDistSpVec.cpp.

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

Definition at line 602 of file FullyDistSpVec.cpp.

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

< Type conversion operator

Definition at line 161 of file FullyDistSpVec.h.

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 491 of file FullyDistSpVec.cpp.

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

Definition at line 933 of file FullyDistSpVec.cpp.

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

Definition at line 992 of file FullyDistSpVec.cpp.

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

Definition at line 65 of file FullyDistSpVec.cpp.

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

Definition at line 109 of file FullyDistSpVec.cpp.

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

Definition at line 113 of file FullyDistSpVec.h.

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

Definition at line 170 of file FullyDistSpVec.h.

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

Definition at line 390 of file FullyDistSpVec.cpp.

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

Definition at line 1860 of file FullyDistSpVec.cpp.

template<class IT , class NT >
template<class HANDLER >
void FullyDistSpVec< IT, NT >::ReadDistribute ( const string &  filename,
int  master,
HANDLER  handler,
bool  pario 
)

New (2014) version that can handle parallel IO and binary files.

Called on an existing object New generalized (parallel/binary/etc) version as of 2014

Definition at line 1258 of file FullyDistSpVec.cpp.

template<class IT, class NT>
void FullyDistSpVec< IT, NT >::ReadDistribute ( const string &  filename,
int  master,
bool  pario 
)
inline

Definition at line 148 of file FullyDistSpVec.h.

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

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 1571 of file FullyDistSpVec.cpp.

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

Definition at line 154 of file FullyDistSpVec.h.

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

Definition at line 1824 of file FullyDistSpVec.cpp.

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 1837 of file FullyDistSpVec.cpp.

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

Definition at line 1949 of file FullyDistSpVec.cpp.

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 1703 of file FullyDistSpVec.cpp.

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

Definition at line 158 of file FullyDistSpVec.h.

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 2524 of file FullyDistSpVec.cpp.

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 2671 of file FullyDistSpVec.cpp.

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

Definition at line 2714 of file FullyDistSpVec.cpp.

template<typename IT , typename NT >
template<typename NT1 , typename _UnaryOperation1 , typename _UnaryOperation2 >
FullyDistSpVec< IT, NT1 > FullyDistSpVec< IT, NT >::SelectNew ( const FullyDistVec< IT, NT1 > &  denseVec,
_UnaryOperation1  __unop1,
_UnaryOperation2  __unop2 
)

Definition at line 2623 of file FullyDistSpVec.cpp.

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

Indexing is performed 0-based.

Definition at line 437 of file FullyDistSpVec.cpp.

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

Definition at line 2566 of file FullyDistSpVec.cpp.

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

Definition at line 215 of file FullyDistSpVec.h.

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 618 of file FullyDistSpVec.cpp.

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 382 of file FullyDistSpVec.cpp.

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

Definition at line 913 of file FullyDistSpVec.cpp.

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

Definition at line 183 of file FullyDistSpVec.h.

Friends And Related Function Documentation

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 1458 of file ParFriends.h.

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 1553 of file ParFriends.h.

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

Definition at line 1324 of file ParFriends.h.

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 1235 of file ParFriends.h.

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

Definition at line 315 of file FullyDistSpVec.h.

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

Definition at line 318 of file FullyDistSpVec.h.

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

Helper functions for sparse matrix X sparse vector.

Definition at line 660 of file ParFriends.h.

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

Definition at line 220 of file BFSFriends.h.

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
template<class IT, class NT>
template<typename IU >
void RandPerm ( FullyDistSpVec< IU, IU > &  V)
friend
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.

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

Definition at line 324 of file FullyDistSpVec.h.

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 966 of file ParFriends.h.

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 490 of file ParFriends.h.

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
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

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 757 of file ParFriends.h.

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

Definition at line 321 of file FullyDistSpVec.h.

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 503 of file ParFriends.h.


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