50 template <
class IT,
class NT>
51 class SpDCCols:
public SpMat<IT, NT, SpDCCols<IT, NT> >
61 SpDCCols (IT nRow, IT nCol, IT nnz1,
const std::tuple<IT, IT, NT> * rhs,
bool transpose);
76 if(rhs.nnz == 0 && nnz == 0)
78 if(nnz != rhs.nnz || m != rhs.m || n != rhs.n)
80 return ((*
dcsc) == (*(rhs.dcsc)));
90 NzIter(IT * ir = NULL, NT * num = NULL) : rid(ir), val(num) {}
94 return(rid == other.rid);
98 return(rid != other.rid);
102 return(rid < other.rid);
142 SpColIter(IT * cp = NULL, IT * jc = NULL) : cptr(cp), cid(jc) {}
145 return(cptr == other.cptr);
149 return(cptr != other.cptr);
248 template <
typename _UnaryOperation>
249 void Apply(_UnaryOperation __unary_op)
252 dcsc->Apply(__unary_op);
255 template <
typename _UnaryOperation,
typename GlobalIT>
256 SpDCCols<IT,NT>*
PruneI(_UnaryOperation __unary_op,
bool inPlace, GlobalIT rowOffset, GlobalIT colOffset);
257 template <
typename _UnaryOperation>
259 template <
typename _BinaryOperation>
261 template <
typename _BinaryOperation>
264 template <
typename _BinaryOperation>
268 dcsc->UpdateDense(array, __binary_op);
271 void EWiseScale(NT ** scaler, IT m_scaler, IT n_scaler);
289 void CreateImpl(
const std::vector<IT> & essentials);
290 void CreateImpl(IT
size, IT nRow, IT nCol, std::tuple<IT, IT, NT> * mytuples);
291 void CreateImpl(IT * _cp, IT * _jc, IT * _ir, NT * _numx, IT _nz, IT _nzc, IT _m, IT _n);
305 std::ofstream&
put(std::ofstream & outfile)
const;
306 std::ifstream&
get(std::ifstream & infile);
308 void PrintInfo(std::ofstream & out)
const;
310 template <
typename SR>
313 template <
typename SR>
316 template <
typename SR>
319 template <
typename SR>
340 template <
typename SR,
typename NTR>
343 template <
typename SR,
typename NTR>
346 SpDCCols (IT size, IT nRow, IT nCol,
const std::vector<IT> & indices,
bool isRow);
361 template <
class IU,
class NU>
364 template <
class IU,
class NU>
372 template<
typename IU>
375 template<
typename IU,
typename NU1,
typename NU2>
378 template<
typename N_promote,
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation>
381 template <
typename RETT,
typename IU,
typename NU1,
typename NU2,
typename _BinaryOperation,
typename _BinaryPredicate>
382 friend 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);
384 template<
class SR,
class NUO,
class IU,
class NU1,
class NU2>
388 template<
class SR,
class NUO,
class IU,
class NU1,
class NU2>
392 template<
class SR,
class NUO,
class IU,
class NU1,
class NU2>
396 template<
class SR,
class NUO,
class IU,
class NU1,
class NU2>
400 template <
typename SR,
typename IU,
typename NU,
typename RHS,
typename LHS>
403 template <
typename SR,
typename IU,
typename NU,
typename RHS,
typename LHS>
406 template <
typename SR,
typename IU,
typename NUM,
typename DER,
typename IVT,
typename OVT>
408 int32_t * & sendindbuf, OVT * & sendnumbuf,
int * & sdispls,
int p_c);
452 template <
class DER,
class NIT,
class NNT>
461 template <
class NIT,
class NNT,
class OIT,
class ONT>
Dcsc< IT, NT > ** dcscarr
int PlusEq_AtXBn(const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B)
void RowSplit(int numsplits)
Iterate over (sparse) columns of the sparse matrix.
SpDCCols< IT, NT > * PruneI(_UnaryOperation __unary_op, bool inPlace, GlobalIT rowOffset, GlobalIT colOffset)
SpColIter operator+(IT inc)
void CreateImpl(const std::vector< IT > &essentials)
friend SpTuples< IU, NUO > * Tuples_AtXBn(const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA, bool clearB)
std::ofstream & put(std::ofstream &outfile) const
SpColIter operator++(int)
void EWiseScale(NT **scaler, IT m_scaler, IT n_scaler)
SpColIter::NzIter begnz(const SpColIter &ccol, int i)
SpColIter(IT *cp=NULL, IT *jc=NULL)
void ColConcatenate(std::vector< SpDCCols< IT, NT > > &matrices)
friend void BooleanRowSplit(SpDCCols< IU, bool > &A, int numsplits)
SpDCCols< IT, NT > * PruneColumn(NT *pvals, _BinaryOperation __binary_op, bool inPlace)
bool operator!=(const NzIter &other)
std::vector< IT > GetEssentials() const
SpColIter::NzIter endnz(const SpColIter &ccol)
SpColIter::NzIter begnz(const SpColIter &ccol)
friend 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)
int PlusEq_AnXBn(const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B)
IT rowid() const
< Return the "local" rowid of the current nonzero entry.
bool operator==(const NzIter &other)
friend SpTuples< IU, NUO > * Tuples_AnXBt(const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA, bool clearB)
void ColSplit(int parts, std::vector< SpDCCols< IT, NT > > &matrices)
friend SpTuples< IU, NUO > * Tuples_AtXBt(const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA, bool clearB)
NzIter(IT *ir=NULL, NT *num=NULL)
void UpdateDense(NT **array, _BinaryOperation __binary_op) const
int PlusEq_AnXBt(const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B)
SpDCCols< IT, NT > TransposeConst() const
Const version, doesn't touch the existing object.
Iterate over the nonzeros of the sparse column.
SpDCCols< NIT, NNT > T_inferred
bool operator!=(const SpColIter &other)
friend SpDCCols< IU, N_promote > EWiseApply(const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, _BinaryOperation __binary_op, bool notB, const NU2 &defaultBVal)
Arr< IT, NT > GetArrays() const
void Merge(SpDCCols< IT, NT > &partA, SpDCCols< IT, NT > &partB)
void EWiseMult(const SpDCCols< IT, NT > &rhs, bool exclude)
bool operator==(const SpColIter &other)
SpDCCols< IT, NT > operator()(IT ri, IT ci) const
bool operator<(const NzIter &other)
SpDCCols< IT, NT > * Prune(_UnaryOperation __unary_op, bool inPlace)
void Apply(_UnaryOperation __unary_op)
SpColIter::NzIter endnz(const SpColIter &ccol, int i)
SpDCCols< IT, NT > * TransposeConstPtr() const
friend void dcsc_gespmv(const SpDCCols< IU, NU > &A, const RHS *x, LHS *y)
SpMV with dense vector.
friend SpTuples< IU, NUO > * Tuples_AnXBn(const SpDCCols< IU, NU1 > &A, const SpDCCols< IU, NU2 > &B, bool clearA, bool clearB)
void Split(SpDCCols< IT, NT > &partA, SpDCCols< IT, NT > &partB)
SpColIter operator-(IT inc)
SpDCCols< IT, NT > & operator+=(const SpDCCols< IT, NT > &rhs)
auto GetInternal(int i) const
Dcsc< IT, NT > * GetDCSC(int i) const
bool operator==(const SpDCCols< IT, NT > &rhs) const
IT colid() const
< Return the "local" colid of the current column.
SpDCCols< IT, NT > & operator=(const SpDCCols< IT, NT > &rhs)
friend void dcsc_gespmv_threaded(const SpDCCols< IU, NU > &A, const RHS *x, LHS *y)
SpMV with dense vector (multithreaded version)
void Transpose()
Mutator version, replaces the calling object.
Dcsc< IT, NT > * GetDCSC() const
int PlusEq_AtXBt(const SpDCCols< IT, NT > &A, const SpDCCols< IT, NT > &B)