COMBINATORIAL_BLAS  1.6
combblas::Dcsc< IT, NT > Class Template Reference

#include <dcsc.h>

Public Types

typedef NT value_type
 
typedef IT index_type
 

Public Member Functions

 Dcsc ()
 
 Dcsc (IT nnz, IT nzcol)
 
 Dcsc (IT nnz, const std::vector< IT > &indices, bool isRow)
 Create a logical matrix from (row/column) indices vector. More...
 
 Dcsc (StackEntry< NT, std::pair< IT, IT > > *multstack, IT mdim, IT ndim, IT nnz)
 
 Dcsc (const Dcsc< IT, NT > &rhs)
 
Dcsc< IT, NT > & operator= (const Dcsc< IT, NT > &rhs)
 
Dcsc< IT, NT > & operator+= (const Dcsc< IT, NT > &rhs)
 
 ~Dcsc ()
 
bool operator== (const Dcsc< IT, NT > &rhs)
 
template<typename NNT >
 operator Dcsc< IT, NNT > () const
 
template<typename NIT , typename NNT >
 operator Dcsc< NIT, NNT > () const
 
void EWiseMult (const Dcsc< IT, NT > &rhs, bool exclude)
 
void EWiseScale (NT **scaler)
 
template<typename _UnaryOperation >
void Apply (_UnaryOperation __unary_op)
 
template<typename _UnaryOperation , typename GlobalIT >
Dcsc< IT, NT > * PruneI (_UnaryOperation __unary_op, bool inPlace, GlobalIT rowOffset, GlobalIT colOffset)
 
template<typename _UnaryOperation >
Dcsc< IT, NT > * Prune (_UnaryOperation __unary_op, bool inPlace)
 
template<typename _BinaryOperation >
Dcsc< IT, NT > * PruneColumn (NT *pvals, _BinaryOperation __binary_op, bool inPlace)
 
template<typename _BinaryOperation >
Dcsc< IT, NT > * PruneColumn (IT *pinds, NT *pvals, _BinaryOperation __binary_op, bool inPlace)
 
IT AuxIndex (const IT colind, bool &found, IT *aux, IT csize) const
 
void RowSplit (int numsplits)
 
void ColSplit (std::vector< Dcsc< IT, NT > * > &parts, std::vector< IT > &cuts)
 
void ColConcatenate (std::vector< Dcsc< IT, NT > * > &parts, std::vector< IT > &offsets)
 
void Split (Dcsc< IT, NT > *&A, Dcsc< IT, NT > *&B, IT cut)
 
void Merge (const Dcsc< IT, NT > *Adcsc, const Dcsc< IT, NT > *B, IT cut)
 
IT ConstructAux (IT ndim, IT *&aux) const
 
void Resize (IT nzcnew, IT nznew)
 
template<class VT >
void FillColInds (const VT *colnums, IT nind, std::vector< std::pair< IT, IT > > &colinds, IT *aux, IT csize) const
 
Dcsc< IT, NT > & AddAndAssign (StackEntry< NT, std::pair< IT, IT > > *multstack, IT mdim, IT ndim, IT nnz)
 
template<typename _BinaryOperation >
void UpdateDense (NT **array, _BinaryOperation __binary_op) const
 
 Dcsc (IT *_cp, IT *_jc, IT *_ir, NT *_numx, IT _nz, IT _nzc, bool _memowned=true)
 wrap object around pre-allocated arrays (possibly RDMA registered) More...
 

Public Attributes

IT * cp
 The master array, size nzc+1 (keeps column pointers) More...
 
IT * jc
 col indices, size nzc More...
 
IT * ir
 row indices, size nz More...
 
NT * numx
 generic values, size nz More...
 
IT nz
 
IT nzc
 number of columns with at least one non-zero in them More...
 
bool memowned
 

Friends

template<typename IU , typename NU1 , typename NU2 >
Dcsc< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseMult (const Dcsc< IU, NU1 > &A, const Dcsc< IU, NU2 > *B, bool exclude)
 

Detailed Description

template<class IT, class NT>
class combblas::Dcsc< IT, NT >

Definition at line 47 of file dcsc.h.

Member Typedef Documentation

◆ index_type

template<class IT, class NT>
typedef IT combblas::Dcsc< IT, NT >::index_type

Definition at line 51 of file dcsc.h.

◆ value_type

template<class IT, class NT>
typedef NT combblas::Dcsc< IT, NT >::value_type

Definition at line 50 of file dcsc.h.

Constructor & Destructor Documentation

◆ Dcsc() [1/6]

template<class IT , class NT >
combblas::Dcsc< IT, NT >::Dcsc ( )

Definition at line 40 of file dcsc.cpp.

◆ Dcsc() [2/6]

template<class IT , class NT >
combblas::Dcsc< IT, NT >::Dcsc ( IT  nnz,
IT  nzcol 
)

Definition at line 43 of file dcsc.cpp.

◆ Dcsc() [3/6]

template<class IT , class NT >
combblas::Dcsc< IT, NT >::Dcsc ( IT  nnz,
const std::vector< IT > &  indices,
bool  isRow 
)

Create a logical matrix from (row/column) indices vector.

Create a logical matrix from (row/column) indices array

Remarks
This function should only be used for indexing
For these temporary matrices nz = nzc (which are both equal to nnz)

Definition at line 238 of file dcsc.cpp.

◆ Dcsc() [4/6]

template<class IT , class NT >
combblas::Dcsc< IT, NT >::Dcsc ( StackEntry< NT, std::pair< IT, IT > > *  multstack,
IT  mdim,
IT  ndim,
IT  nnz 
)

Creates DCSC structure from an array of StackEntry's

Remarks
Complexity: O(nnz)

Definition at line 195 of file dcsc.cpp.

◆ Dcsc() [5/6]

template<class IT , class NT >
combblas::Dcsc< IT, NT >::Dcsc ( const Dcsc< IT, NT > &  rhs)

Definition at line 296 of file dcsc.cpp.

◆ ~Dcsc()

template<class IT , class NT >
combblas::Dcsc< IT, NT >::~Dcsc ( )

Definition at line 1275 of file dcsc.cpp.

◆ Dcsc() [6/6]

template<class IT, class NT>
combblas::Dcsc< IT, NT >::Dcsc ( IT *  _cp,
IT *  _jc,
IT *  _ir,
NT *  _numx,
IT  _nz,
IT  _nzc,
bool  _memowned = true 
)
inline

wrap object around pre-allocated arrays (possibly RDMA registered)

Definition at line 116 of file dcsc.h.

Member Function Documentation

◆ AddAndAssign()

template<class IT , class NT >
Dcsc< IT, NT > & combblas::Dcsc< IT, NT >::AddAndAssign ( StackEntry< NT, std::pair< IT, IT > > *  multstack,
IT  mdim,
IT  ndim,
IT  nnz 
)

Definition at line 71 of file dcsc.cpp.

◆ Apply()

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

Definition at line 74 of file dcsc.h.

◆ AuxIndex()

template<class IT , class NT >
IT combblas::Dcsc< IT, NT >::AuxIndex ( const IT  colind,
bool &  found,
IT *  aux,
IT  csize 
) const

The first part of the indexing algorithm described in the IPDPS'08 paper

Parameters

Definition at line 1013 of file dcsc.cpp.

◆ ColConcatenate()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::ColConcatenate ( std::vector< Dcsc< IT, NT > * > &  parts,
std::vector< IT > &  offsets 
)
Precondition
{no member of "parts" is empty}
{there are at least 2 members} offsets arrays is "parallel to" parts array it shows the starts of column numbers

Definition at line 1168 of file dcsc.cpp.

◆ ColSplit()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::ColSplit ( std::vector< Dcsc< IT, NT > * > &  parts,
std::vector< IT > &  cuts 
)

Split along the cut(s) in terms of column indices Should work even when one of the splits have no nonzeros at all vector<IT> cuts is of length "size(parts)-1"

Precondition
{ size(parts) >= 2}

Definition at line 1070 of file dcsc.cpp.

◆ ConstructAux()

template<class IT , class NT >
IT combblas::Dcsc< IT, NT >::ConstructAux ( IT  ndim,
IT *&  aux 
) const
Todo:
{special case of ColConcatenate, to be deprecated...}

Construct an index array called aux Return the size of the contructed array Complexity O(nzc)

Definition at line 912 of file dcsc.cpp.

◆ EWiseMult()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::EWiseMult ( const Dcsc< IT, NT > &  rhs,
bool  exclude 
)
Parameters
[in]excludeif false,
then operation is A = A .* B
else operation is A = A .* not(B)

Definition at line 513 of file dcsc.cpp.

◆ EWiseScale()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::EWiseScale ( NT **  scaler)

Definition at line 874 of file dcsc.cpp.

◆ FillColInds()

template<class IT , class NT >
template<class VT >
void combblas::Dcsc< IT, NT >::FillColInds ( const VT *  colnums,
IT  nind,
std::vector< std::pair< IT, IT > > &  colinds,
IT *  aux,
IT  csize 
) const

param[in] nind { length(colsums), gives number of columns of A that contributes to C(:,i) } Vector type VT is allowed to be different than matrix type (IT) However, VT should be up-castable to IT (example: VT=int32_t, IT=int64_t)

Definition at line 1211 of file dcsc.cpp.

◆ Merge()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::Merge ( const Dcsc< IT, NT > *  Adcsc,
const Dcsc< IT, NT > *  B,
IT  cut 
)
Todo:
{special case of ColSplit, to be deprecated...}

Definition at line 1134 of file dcsc.cpp.

◆ operator Dcsc< IT, NNT >()

template<class IT , class NT >
template<typename NNT >
combblas::Dcsc< IT, NT >::operator Dcsc< IT, NNT > ( ) const

Definition at line 264 of file dcsc.cpp.

◆ operator Dcsc< NIT, NNT >()

template<class IT , class NT >
template<typename NIT , typename NNT >
combblas::Dcsc< IT, NT >::operator Dcsc< NIT, NNT > ( ) const

Definition at line 280 of file dcsc.cpp.

◆ operator+=()

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

Definition at line 374 of file dcsc.cpp.

◆ operator=()

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

Assignment operator (called on an existing object)

Definition at line 328 of file dcsc.cpp.

◆ operator==()

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

Definition at line 472 of file dcsc.cpp.

◆ Prune()

template<class IT , class NT >
template<typename _UnaryOperation >
Dcsc< IT, NT > * combblas::Dcsc< IT, NT >::Prune ( _UnaryOperation  __unary_op,
bool  inPlace 
)

Definition at line 604 of file dcsc.cpp.

◆ PruneColumn() [1/2]

template<class IT , class NT >
template<typename _BinaryOperation >
Dcsc< IT, NT > * combblas::Dcsc< IT, NT >::PruneColumn ( NT *  pvals,
_BinaryOperation  __binary_op,
bool  inPlace 
)

Definition at line 686 of file dcsc.cpp.

◆ PruneColumn() [2/2]

template<class IT , class NT >
template<typename _BinaryOperation >
Dcsc< IT, NT > * combblas::Dcsc< IT, NT >::PruneColumn ( IT *  pinds,
NT *  pvals,
_BinaryOperation  __binary_op,
bool  inPlace 
)

Definition at line 770 of file dcsc.cpp.

◆ PruneI()

template<class IT , class NT >
template<typename _UnaryOperation , typename GlobalIT >
Dcsc< IT, NT > * combblas::Dcsc< IT, NT >::PruneI ( _UnaryOperation  __unary_op,
bool  inPlace,
GlobalIT  rowOffset,
GlobalIT  colOffset 
)

Definition at line 523 of file dcsc.cpp.

◆ Resize()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::Resize ( IT  nzcnew,
IT  nznew 
)

Resizes cp & jc arrays to nzcnew, ir & numx arrays to nznew Zero overhead in case sizes stay the same

Definition at line 946 of file dcsc.cpp.

◆ RowSplit()

template<class IT, class NT>
void combblas::Dcsc< IT, NT >::RowSplit ( int  numsplits)

◆ Split()

template<class IT , class NT >
void combblas::Dcsc< IT, NT >::Split ( Dcsc< IT, NT > *&  A,
Dcsc< IT, NT > *&  B,
IT  cut 
)

Split along the cut (a column index) Should work even when one of the splits have no nonzeros at all

Definition at line 1030 of file dcsc.cpp.

◆ UpdateDense()

template<class IT , class NT >
template<typename _BinaryOperation >
void combblas::Dcsc< IT, NT >::UpdateDense ( NT **  array,
_BinaryOperation  __binary_op 
) const

Updates entries of 2D dense array using __binary_op and entries of "this"

Precondition
{ __binary_op is a commutative operation}

Definition at line 893 of file dcsc.cpp.

Friends And Related Function Documentation

◆ EWiseMult

template<class IT, class NT>
template<typename IU , typename NU1 , typename NU2 >
Dcsc<IU, typename promote_trait<NU1,NU2>::T_promote> EWiseMult ( const Dcsc< IU, NU1 > &  A,
const Dcsc< IU, NU2 > *  B,
bool  exclude 
)
friend
Parameters
[in]excludeif false,
then operation is A = A .* B
else operation is A = A .* not(B)

Definition at line 694 of file Friends.h.

Member Data Documentation

◆ cp

template<class IT, class NT>
IT* combblas::Dcsc< IT, NT >::cp

The master array, size nzc+1 (keeps column pointers)

Definition at line 117 of file dcsc.h.

◆ ir

template<class IT, class NT>
IT* combblas::Dcsc< IT, NT >::ir

row indices, size nz

Definition at line 121 of file dcsc.h.

◆ jc

template<class IT, class NT>
IT* combblas::Dcsc< IT, NT >::jc

col indices, size nzc

Definition at line 120 of file dcsc.h.

◆ memowned

template<class IT, class NT>
bool combblas::Dcsc< IT, NT >::memowned

Definition at line 126 of file dcsc.h.

◆ numx

template<class IT, class NT>
NT* combblas::Dcsc< IT, NT >::numx

generic values, size nz

Definition at line 122 of file dcsc.h.

◆ nz

template<class IT, class NT>
IT combblas::Dcsc< IT, NT >::nz

Definition at line 124 of file dcsc.h.

◆ nzc

template<class IT, class NT>
IT combblas::Dcsc< IT, NT >::nzc

number of columns with at least one non-zero in them

Definition at line 125 of file dcsc.h.


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