|
| FullyDistSpVec () |
|
| FullyDistSpVec (IT glen) |
|
| FullyDistSpVec (std::shared_ptr< CommGrid > grid) |
|
| FullyDistSpVec (std::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 (std::shared_ptr< CommGrid > grid, IT globallen, const std::vector< IT > &indvec, const std::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 std::string &filename, bool onebased, HANDLER handler, bool includeindices=true, bool includeheader=false) |
|
void | ParallelWrite (const std::string &filename, bool onebased, bool includeindices=true) |
|
template<typename _BinaryOperation > |
void | ParallelRead (const std::string &filename, bool onebased, _BinaryOperation BinOp) |
|
template<class HANDLER > |
std::ifstream & | ReadDistribute (std::ifstream &infile, int master, HANDLER handler) |
| Totally obsolete version that only accepts an ifstream object and ascii files. More...
|
|
std::ifstream & | ReadDistribute (std::ifstream &infile, int master) |
|
template<class HANDLER > |
void | SaveGathered (std::ofstream &outfile, int master, HANDLER handler, bool printProcSplits=false) |
|
void | SaveGathered (std::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 (std::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 () |
|
std::shared_ptr< CommGrid > | getcommgrid () const |
|
void | Reset () |
|
NT | GetLocalElement (IT indx) |
|
void | BulkSet (IT inds[], int count) |
|
std::vector< IT > | GetLocalInd () |
|
std::vector< NT > | GetLocalNum () |
|
template<typename _Predicate > |
FullyDistVec< IT, IT > | FindInds (_Predicate pred) const |
|
template<typename _Predicate > |
FullyDistVec< IT, NT > | FindVals (_Predicate pred) const |
|
|
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) |
|
template<class IT, class NT>
class combblas::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 73 of file FullyDistSpVec.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 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 2127 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 2228 of file ParFriends.h.