#include <Friends.h>
Classes | |
class | SpColIter |
Iterate over (sparse) columns of the sparse matrix. More... | |
Public Types | |
typedef IT | LocalIT |
typedef NT | LocalNT |
Public Member Functions | |
SpDCCols () | |
SpDCCols (IT size, IT nRow, IT nCol, IT nzc) | |
SpDCCols (const SpTuples< IT, NT > &rhs, bool transpose) | |
SpDCCols (IT nRow, IT nCol, IT nnz1, const std::tuple< IT, IT, NT > *rhs, bool transpose) | |
SpDCCols (const SpDCCols< IT, NT > &rhs) | |
~SpDCCols () | |
template<typename NNT > | |
operator SpDCCols< IT, NNT > () const | |
NNT: New numeric type. More... | |
template<typename NIT , typename NNT > | |
operator SpDCCols< NIT, NNT > () const | |
NNT: New numeric type, NIT: New index type. More... | |
SpDCCols< IT, NT > & | operator= (const SpDCCols< IT, NT > &rhs) |
SpDCCols< IT, NT > & | operator+= (const SpDCCols< IT, NT > &rhs) |
SpDCCols< IT, NT > | operator() (IT ri, IT ci) const |
SpDCCols< IT, NT > | operator() (const std::vector< IT > &ri, const std::vector< IT > &ci) const |
bool | operator== (const SpDCCols< IT, NT > &rhs) const |
SpColIter | begcol () |
SpColIter | begcol (int i) |
SpColIter | endcol () |
SpColIter | endcol (int i) |
SpColIter::NzIter | begnz (const SpColIter &ccol) |
SpColIter::NzIter | endnz (const SpColIter &ccol) |
SpColIter::NzIter | begnz (const SpColIter &ccol, int i) |
SpColIter::NzIter | endnz (const SpColIter &ccol, int i) |
template<typename _UnaryOperation > | |
void | Apply (_UnaryOperation __unary_op) |
template<typename _UnaryOperation , typename GlobalIT > | |
SpDCCols< IT, NT > * | PruneI (_UnaryOperation __unary_op, bool inPlace, GlobalIT rowOffset, GlobalIT colOffset) |
template<typename _UnaryOperation > | |
SpDCCols< IT, NT > * | Prune (_UnaryOperation __unary_op, bool inPlace) |
template<typename _BinaryOperation > | |
SpDCCols< IT, NT > * | PruneColumn (NT *pvals, _BinaryOperation __binary_op, bool inPlace) |
template<typename _BinaryOperation > | |
SpDCCols< IT, NT > * | PruneColumn (IT *pinds, NT *pvals, _BinaryOperation __binary_op, bool inPlace) |
template<typename _BinaryOperation > | |
void | UpdateDense (NT **array, _BinaryOperation __binary_op) const |
void | EWiseScale (NT **scaler, IT m_scaler, IT n_scaler) |
void | EWiseMult (const SpDCCols< IT, NT > &rhs, bool exclude) |
void | Transpose () |
Mutator version, replaces the calling object. More... | |
SpDCCols< IT, NT > | TransposeConst () const |
Const version, doesn't touch the existing object. More... | |
SpDCCols< IT, NT > * | TransposeConstPtr () const |
void | RowSplit (int numsplits) |
void | ColSplit (int parts, std::vector< SpDCCols< IT, NT > > &matrices) |
void | ColConcatenate (std::vector< SpDCCols< IT, NT > > &matrices) |
void | Split (SpDCCols< IT, NT > &partA, SpDCCols< IT, NT > &partB) |
void | Merge (SpDCCols< IT, NT > &partA, SpDCCols< IT, NT > &partB) |
void | CreateImpl (const std::vector< IT > &essentials) |
void | CreateImpl (IT size, IT nRow, IT nCol, std::tuple< IT, IT, NT > *mytuples) |
void | CreateImpl (IT *_cp, IT *_jc, IT *_ir, NT *_numx, IT _nz, IT _nzc, IT _m, IT _n) |
Arr< IT, NT > | GetArrays () const |
std::vector< IT > | GetEssentials () const |
bool | isZero () const |
IT | getnrow () const |
IT | getncol () const |
IT | getnnz () const |
IT | getnzc () const |
int | getnsplit () const |
std::ofstream & | put (std::ofstream &outfile) const |
std::ifstream & | get (std::ifstream &infile) |
void | PrintInfo () const |
void | PrintInfo (std::ofstream &out) const |
template<typename SR > | |
int | PlusEq_AtXBt (const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B) |
template<typename SR > | |
int | PlusEq_AtXBn (const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B) |
template<typename SR > | |
int | PlusEq_AnXBt (const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B) |
template<typename SR > | |
int | PlusEq_AnXBn (const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B) |
Dcsc< IT, NT > * | GetDCSC () const |
Dcsc< IT, NT > * | GetDCSC (int i) const |
auto | GetInternal () const |
auto | GetInternal (int i) const |
Public Member Functions inherited from combblas::SpMat< IT, NT, SpDCCols< IT, NT > > | |
void | Create (const std::vector< IT > &essentials) |
void | Create (IT size, IT nRow, IT nCol, std::tuple< IT, IT, NT > *mytuples) |
SpMat< IT, NT, SpDCCols< IT, NT > > | operator() (const std::vector< IT > &ri, const std::vector< IT > &ci) const |
void | SpGEMM (SpMat< IT, NT, SpDCCols< IT, NT > > &A, SpMat< IT, NT, SpDCCols< IT, NT > > &B, bool isAT, bool isBT) |
void | Split (SpMat< IT, NT, SpDCCols< IT, NT > > &partA, SpMat< IT, NT, SpDCCols< IT, NT > > &partB) |
void | Merge (SpMat< IT, NT, SpDCCols< IT, NT > > &partA, SpMat< IT, NT, SpDCCols< IT, NT > > &partB) |
Arr< IT, NT > | GetArrays () const |
std::vector< IT > | GetEssentials () const |
auto | GetInternal () const |
auto | GetInternal (int i) const |
int | getnsplit () const |
void | Transpose () |
auto | begcol () |
auto | begcol (int i) |
auto | endcol () |
auto | endcol (int i) |
auto | begnz (const typename X::SpColIter &ccol) |
auto | begnz (const typename X::SpColIter &ccol, int i) |
auto | endnz (const typename X::SpColIter &ccol) |
auto | endnz (const typename X::SpColIter &ccol, int i) |
bool | operator== (const SpMat< IT, NT, SpDCCols< IT, NT > > &rhs) const |
std::ofstream & | put (std::ofstream &outfile) const |
std::ifstream & | get (std::ifstream &infile) |
bool | isZero () const |
IT | getnrow () const |
IT | getncol () const |
IT | getnnz () const |
Static Public Attributes | |
static const IT | esscount = static_cast<IT>(4) |
Friends | |
template<class IU , class NU > | |
class | SpDCCols |
template<class IU , class NU > | |
class | SpTuples |
template<typename IU > | |
void | BooleanRowSplit (SpDCCols< IU, bool > &A, int numsplits) |
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 > | |
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) |
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, bool clearB) |
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, bool clearB) |
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, bool clearB) |
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, bool clearB) |
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) |
typedef IT combblas::SpDCCols< IT, NT >::LocalIT |
Definition at line 54 of file SpDCCols.h.
typedef NT combblas::SpDCCols< IT, NT >::LocalNT |
Definition at line 55 of file SpDCCols.h.
combblas::SpDCCols< IT, NT >::SpDCCols | ( | ) |
Definition at line 50 of file SpDCCols.cpp.
combblas::SpDCCols< IT, NT >::SpDCCols | ( | IT | size, |
IT | nRow, | ||
IT | nCol, | ||
IT | nzc | ||
) |
Definition at line 55 of file SpDCCols.cpp.
combblas::SpDCCols< IT, NT >::SpDCCols | ( | const SpTuples< IT, NT > & | rhs, |
bool | transpose | ||
) |
combblas::SpDCCols< IT, NT >::SpDCCols | ( | IT | nRow, |
IT | nCol, | ||
IT | nTuples, | ||
const std::tuple< IT, IT, NT > * | tuples, | ||
bool | transpose | ||
) |
Multithreaded Constructor for converting tuples matrix -> SpDCCols
[in] | rhs | if transpose=true, then tuples is assumed to be a row sorted list of tuple objects else tuples is assumed to be a column sorted list of tuple objects |
Definition at line 198 of file SpDCCols.cpp.
combblas::SpDCCols< IT, NT >::SpDCCols | ( | const SpDCCols< IT, NT > & | rhs | ) |
Definition at line 88 of file SpDCCols.cpp.
combblas::SpDCCols< IT, NT >::~SpDCCols | ( | ) |
Definition at line 65 of file SpDCCols.cpp.
|
inline |
Definition at line 249 of file SpDCCols.h.
|
inline |
Definition at line 197 of file SpDCCols.h.
|
inline |
Definition at line 204 of file SpDCCols.h.
|
inline |
ccol | Return the beginning iterator for the nonzeros of the current column |
Definition at line 228 of file SpDCCols.h.
|
inline |
i | multithreaded version |
Definition at line 238 of file SpDCCols.h.
void combblas::SpDCCols< IT, NT >::ColConcatenate | ( | std::vector< SpDCCols< IT, NT > > & | matrices | ) |
Concatenates (merges) multiple matrices (cut along the columns) into 1 piece ColSplit() method should have been executed on the object beforehand
Definition at line 939 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::ColSplit | ( | int | parts, |
std::vector< SpDCCols< IT, NT > > & | matrices | ||
) |
Splits the matrix into "parts", simply by cutting along the columns Simple algorithm that doesn't intend to split perfectly, but it should do a pretty good job Practically destructs the calling object also (frees most of its memory)
Definition at line 897 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::CreateImpl | ( | const std::vector< IT > & | essentials | ) |
Definition at line 695 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::CreateImpl | ( | IT | size, |
IT | nRow, | ||
IT | nCol, | ||
std::tuple< IT, IT, NT > * | mytuples | ||
) |
Definition at line 709 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::CreateImpl | ( | IT * | _cp, |
IT * | _jc, | ||
IT * | _ir, | ||
NT * | _numx, | ||
IT | _nz, | ||
IT | _nzc, | ||
IT | _m, | ||
IT | _n | ||
) |
Definition at line 682 of file SpDCCols.cpp.
|
inline |
Definition at line 212 of file SpDCCols.h.
|
inline |
Definition at line 220 of file SpDCCols.h.
|
inline |
ccol | Return the ending iterator for the nonzeros of the current column |
Definition at line 233 of file SpDCCols.h.
|
inline |
i | multithreaded version |
Definition at line 243 of file SpDCCols.h.
void combblas::SpDCCols< IT, NT >::EWiseMult | ( | const SpDCCols< IT, NT > & | rhs, |
bool | exclude | ||
) |
Definition at line 623 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::EWiseScale | ( | NT ** | scaler, |
IT | m_scaler, | ||
IT | n_scaler | ||
) |
{scaler should NOT contain any zero entries}
Definition at line 663 of file SpDCCols.cpp.
std::ifstream & combblas::SpDCCols< IT, NT >::get | ( | std::ifstream & | infile | ) |
Definition at line 1195 of file SpDCCols.cpp.
Arr< IT, NT > combblas::SpDCCols< IT, NT >::GetArrays | ( | ) | const |
Definition at line 787 of file SpDCCols.cpp.
|
inline |
Definition at line 322 of file SpDCCols.h.
|
inline |
Definition at line 327 of file SpDCCols.h.
std::vector< IT > combblas::SpDCCols< IT, NT >::GetEssentials | ( | ) | const |
Definition at line 748 of file SpDCCols.cpp.
|
inline |
Definition at line 332 of file SpDCCols.h.
|
inline |
Definition at line 333 of file SpDCCols.h.
|
inline |
Definition at line 300 of file SpDCCols.h.
|
inline |
Definition at line 301 of file SpDCCols.h.
|
inline |
Definition at line 299 of file SpDCCols.h.
|
inline |
Definition at line 303 of file SpDCCols.h.
|
inline |
Definition at line 302 of file SpDCCols.h.
|
inline |
Definition at line 298 of file SpDCCols.h.
void combblas::SpDCCols< IT, NT >::Merge | ( | SpDCCols< IT, NT > & | partA, |
SpDCCols< IT, NT > & | partB | ||
) |
Merges two matrices (cut along the columns) into 1 piece Split method should have been executed on the object beforehand
Definition at line 990 of file SpDCCols.cpp.
combblas::SpDCCols< IT, NT >::operator SpDCCols< IT, NNT > | ( | ) | const |
NNT: New numeric type.
Definition at line 760 of file SpDCCols.cpp.
combblas::SpDCCols< IT, NT >::operator SpDCCols< NIT, NNT > | ( | ) | const |
NNT: New numeric type, NIT: New index type.
Definition at line 774 of file SpDCCols.cpp.
SpDCCols< IT, NT > combblas::SpDCCols< IT, NT >::operator() | ( | IT | ri, |
IT | ci | ||
) | const |
Definition at line 1115 of file SpDCCols.cpp.
SpDCCols< IT, NT > combblas::SpDCCols< IT, NT >::operator() | ( | const std::vector< IT > & | ri, |
const std::vector< IT > & | ci | ||
) | const |
The almighty indexing polyalgorithm Calls different subroutines depending the sparseness of ri/ci
Definition at line 1150 of file SpDCCols.cpp.
SpDCCols< IT, NT > & combblas::SpDCCols< IT, NT >::operator+= | ( | const SpDCCols< IT, NT > & | rhs | ) |
Definition at line 394 of file SpDCCols.cpp.
SpDCCols< IT, NT > & combblas::SpDCCols< IT, NT >::operator= | ( | const SpDCCols< IT, NT > & | rhs | ) |
The assignment operator operates on an existing object The assignment operator is the only operator that is not inherited. But there is no need to call base's assigment operator as it has no data members
Definition at line 365 of file SpDCCols.cpp.
|
inline |
Definition at line 74 of file SpDCCols.h.
int combblas::SpDCCols< IT, NT >::PlusEq_AnXBn | ( | const SpDCCols< IT, NT > & | A, |
const SpDCCols< IT, NT > & | B | ||
) |
C += A*B (Using ColByCol Algorithm) This version is currently limited to multiplication of matrices with the same precision (e.g. it can't multiply double-precision matrices with booleans) The multiplication is on the specified semiring (passed as parameter)
Definition at line 1071 of file SpDCCols.cpp.
int combblas::SpDCCols< IT, NT >::PlusEq_AnXBt | ( | const SpDCCols< IT, NT > & | A, |
const SpDCCols< IT, NT > & | B | ||
) |
C += A*B' (Using OuterProduct Algorithm) This version is currently limited to multiplication of matrices with the same precision (e.g. it can't multiply double-precision matrices with booleans) The multiplication is on the specified semiring (passed as parameter)
Definition at line 1027 of file SpDCCols.cpp.
int combblas::SpDCCols< IT, NT >::PlusEq_AtXBn | ( | const SpDCCols< IT, NT > & | A, |
const SpDCCols< IT, NT > & | B | ||
) |
Definition at line 1099 of file SpDCCols.cpp.
int combblas::SpDCCols< IT, NT >::PlusEq_AtXBt | ( | const SpDCCols< IT, NT > & | A, |
const SpDCCols< IT, NT > & | B | ||
) |
Definition at line 1107 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::PrintInfo | ( | ) | const |
Definition at line 1235 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::PrintInfo | ( | std::ofstream & | out | ) | const |
Definition at line 1211 of file SpDCCols.cpp.
SpDCCols< IT, NT > * combblas::SpDCCols< IT, NT >::Prune | ( | _UnaryOperation | __unary_op, |
bool | inPlace | ||
) |
Definition at line 478 of file SpDCCols.cpp.
SpDCCols< IT, NT > * combblas::SpDCCols< IT, NT >::PruneColumn | ( | NT * | pvals, |
_BinaryOperation | __binary_op, | ||
bool | inPlace | ||
) |
Definition at line 527 of file SpDCCols.cpp.
SpDCCols< IT, NT > * combblas::SpDCCols< IT, NT >::PruneColumn | ( | IT * | pinds, |
NT * | pvals, | ||
_BinaryOperation | __binary_op, | ||
bool | inPlace | ||
) |
Definition at line 575 of file SpDCCols.cpp.
SpDCCols< IT, NT > * combblas::SpDCCols< IT, NT >::PruneI | ( | _UnaryOperation | __unary_op, |
bool | inPlace, | ||
GlobalIT | rowOffset, | ||
GlobalIT | colOffset | ||
) |
Definition at line 431 of file SpDCCols.cpp.
std::ofstream & combblas::SpDCCols< IT, NT >::put | ( | std::ofstream & | outfile | ) | const |
Definition at line 1181 of file SpDCCols.cpp.
|
inline |
Definition at line 278 of file SpDCCols.h.
void combblas::SpDCCols< IT, NT >::Split | ( | SpDCCols< IT, NT > & | partA, |
SpDCCols< IT, NT > & | partB | ||
) |
Splits the matrix into two parts, simply by cutting along the columns Simple algorithm that doesn't intend to split perfectly, but it should do a pretty good job Practically destructs the calling object also (frees most of its memory)
Definition at line 867 of file SpDCCols.cpp.
void combblas::SpDCCols< IT, NT >::Transpose | ( | ) |
Mutator version, replaces the calling object.
O(nnz log(nnz)) time Transpose function
Definition at line 815 of file SpDCCols.cpp.
SpDCCols< IT, NT > combblas::SpDCCols< IT, NT >::TransposeConst | ( | ) | const |
Const version, doesn't touch the existing object.
O(nnz log(nnz)) time Transpose function
Definition at line 838 of file SpDCCols.cpp.
SpDCCols< IT, NT > * combblas::SpDCCols< IT, NT >::TransposeConstPtr | ( | ) | const |
O(nnz log(nnz)) time Transpose function
Definition at line 852 of file SpDCCols.cpp.
|
inline |
Definition at line 265 of file SpDCCols.h.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 362 of file SpDCCols.h.
Definition at line 365 of file SpDCCols.h.
Dcsc<IT, NT>* combblas::SpDCCols< IT, NT >::dcsc |
Definition at line 351 of file SpDCCols.h.
Dcsc<IT, NT>** combblas::SpDCCols< IT, NT >::dcscarr |
Definition at line 352 of file SpDCCols.h.
|
static |
Definition at line 296 of file SpDCCols.h.