COMBINATORIAL_BLAS  1.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
SpTuples< IU, NU > Class Template Reference

#include <Friends.h>

Inheritance diagram for SpTuples< IU, NU >:
SpMat< IT, NT, SpTuples< IT, NT > >

Public Member Functions

 SpTuples (int64_t size, IT nRow, IT nCol)
 
 SpTuples (int64_t size, IT nRow, IT nCol, tuple< IT, IT, NT > *mytuples, bool sorted=false)
 
 SpTuples (int64_t maxnnz, IT nRow, IT nCol, vector< IT > &edges, bool removeloops=true)
 
 SpTuples (int64_t size, IT nRow, IT nCol, StackEntry< NT, pair< IT, IT > > *&multstack)
 
 SpTuples (const SpTuples< IT, NT > &rhs)
 
 SpTuples (const SpDCCols< IT, NT > &rhs)
 Constructor for converting SpDCCols matrix -> SpTuples. More...
 
 ~SpTuples ()
 
SpTuples< IT, NT > & operator= (const SpTuples< IT, NT > &rhs)
 
IT & rowindex (IT i)
 
IT & colindex (IT i)
 
NT & numvalue (IT i)
 
IT rowindex (IT i) const
 
IT colindex (IT i) const
 
NT numvalue (IT i) const
 
template<typename BINFUNC >
void RemoveDuplicates (BINFUNC BinOp)
 
void SortRowBased ()
 
void SortColBased ()
 
IT RemoveLoops ()
 
pair< IT, IT > RowLimits ()
 
pair< IT, IT > ColLimits ()
 
tuple< IT, IT, NT > front ()
 
tuple< IT, IT, NT > back ()
 
ofstream & putstream (ofstream &outfile) const
 
ofstream & put (ofstream &outfile) const
 
ifstream & getstream (ifstream &infile)
 
ifstream & get (ifstream &infile)
 
bool isZero () const
 
IT getnrow () const
 
IT getncol () const
 
int64_t getnnz () const
 
void PrintInfo ()
 
- Public Member Functions inherited from SpMat< IT, NT, SpTuples< IT, NT > >
void Create (const vector< IT > &essentials)
 
void Create (IT size, IT nRow, IT nCol, tuple< IT, IT, NT > *mytuples)
 
SpMat< IT, NT, SpTuples< IT, NT > > operator() (const vector< IT > &ri, const vector< IT > &ci) const
 
void SpGEMM (SpMat< IT, NT, SpTuples< IT, NT > > &A, SpMat< IT, NT, SpTuples< IT, NT > > &B, bool isAT, bool isBT)
 
void Split (SpMat< IT, NT, SpTuples< IT, NT > > &partA, SpMat< IT, NT, SpTuples< IT, NT > > &partB)
 
void Merge (SpMat< IT, NT, SpTuples< IT, NT > > &partA, SpMat< IT, NT, SpTuples< IT, NT > > &partB)
 
Arr< IT, NT > GetArrays () const
 
vector< IT > GetEssentials () const
 
auto GetInternal () const
 
auto GetInternal (int i) const
 
int getnsplit () const
 
void Transpose ()
 
bool operator== (const SpMat< IT, NT, SpTuples< IT, NT > > &rhs) const
 
ofstream & put (ofstream &outfile) const
 
ifstream & get (ifstream &infile)
 
bool isZero () const
 
IT getnrow () const
 
IT getncol () const
 
IT getnnz () const
 

Public Attributes

tuple< IT, IT, NT > * tuples
 

Friends

template<class IU , class NU >
class SpDCCols
 
template<typename SR , typename IU , typename NU >
SpTuples< IU, NU > MergeAll (const vector< SpTuples< IU, NU > * > &ArrSpTups, IU mstar, IU nstar, bool delarrs)
 
template<typename SR , typename IU , typename NU >
SpTuples< IU, NU > * MergeAllRec (const vector< SpTuples< IU, NU > * > &ArrSpTups, IU mstar, IU nstar)
 

Detailed Description

template<class IU, class NU>
class SpTuples< IU, NU >

Triplets are represented using the boost::tuple class of the Boost library Number of entries are 64-bit addressible, but each entry is only <class it>=""> addressible Therefore, size is int64_t but nrows/ncols (representing range of first two entries in tuple) is of type IT

Remarks
Indices start from 0 in this class
Sorted with respect to columns (Column-sorted triples)

Definition at line 46 of file Friends.h.

Constructor & Destructor Documentation

template<class IT , class NT >
SpTuples< IT, NT >::SpTuples ( int64_t  size,
IT  nRow,
IT  nCol 
)

Definition at line 35 of file SpTuples.cpp.

template<class IT , class NT >
SpTuples< IT, NT >::SpTuples ( int64_t  size,
IT  nRow,
IT  nCol,
tuple< IT, IT, NT > *  mytuples,
bool  sorted = false 
)

Definition at line 49 of file SpTuples.cpp.

template<class IT , class NT >
SpTuples< IT, NT >::SpTuples ( int64_t  maxnnz,
IT  nRow,
IT  nCol,
vector< IT > &  edges,
bool  removeloops = true 
)

Generate a SpTuples object from an edge list

Parameters
[in,out]edgesedge list that might contain duplicate edges. freed upon return Semantics differ depending on the object created: NT=bool: duplicates are ignored NT='countable' (such as short,int): duplicated as summed to keep count

Definition at line 67 of file SpTuples.cpp.

template<class IT , class NT >
SpTuples< IT, NT >::SpTuples ( int64_t  size,
IT  nRow,
IT  nCol,
StackEntry< NT, pair< IT, IT > > *&  multstack 
)

Generate a SpTuples object from StackEntry array, then delete that array

Parameters
[in]multstack{value-key pairs where keys are pair<col_ind, row_ind> sorted lexicographically}
Remarks
Since input is column sorted, the tuples are automatically generated in that way too

Definition at line 127 of file SpTuples.cpp.

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

Hint1: copy constructor (constructs a new object. i.e. this is NEVER called on an existing object) Hint2: Base's default constructor is called under the covers Normally Base's copy constructor should be invoked but it doesn't matter here as Base has no data members

Definition at line 160 of file SpTuples.cpp.

template<class IT , class NT >
SpTuples< IT, NT >::SpTuples ( const SpDCCols< IT, NT > &  rhs)

Constructor for converting SpDCCols matrix -> SpTuples.

Definition at line 171 of file SpTuples.cpp.

template<class IT , class NT >
SpTuples< IT, NT >::~SpTuples ( )

Definition at line 145 of file SpTuples.cpp.

Member Function Documentation

template<class IU, class NU>
tuple<IT, IT, NT> SpTuples< IU, NU >::back ( )
inline

Definition at line 152 of file SpTuples.h.

template<class IU, class NU>
IT& SpTuples< IU, NU >::colindex ( IT  i)
inline

Definition at line 73 of file SpTuples.h.

template<class IU, class NU>
IT SpTuples< IU, NU >::colindex ( IT  i) const
inline

Definition at line 77 of file SpTuples.h.

template<class IU, class NU>
pair<IT,IT> SpTuples< IU, NU >::ColLimits ( )
inline

Definition at line 139 of file SpTuples.h.

template<class IU, class NU>
tuple<IT, IT, NT> SpTuples< IU, NU >::front ( )
inline

Definition at line 151 of file SpTuples.h.

template<class IU, class NU>
ifstream& SpTuples< IU, NU >::get ( ifstream &  infile)
inline

Definition at line 166 of file SpTuples.h.

template<class IU, class NU>
IT SpTuples< IU, NU >::getncol ( ) const
inline

Definition at line 171 of file SpTuples.h.

template<class IU, class NU>
int64_t SpTuples< IU, NU >::getnnz ( ) const
inline

Definition at line 172 of file SpTuples.h.

template<class IU, class NU>
IT SpTuples< IU, NU >::getnrow ( ) const
inline

Definition at line 170 of file SpTuples.h.

template<class IT , class NT >
ifstream & SpTuples< IT, NT >::getstream ( ifstream &  infile)

Loads a triplet matrix from infile

Remarks
Assumes matlab type indexing for the input (i.e. indices start from 1)

Definition at line 261 of file SpTuples.cpp.

template<class IU, class NU>
bool SpTuples< IU, NU >::isZero ( ) const
inline

Definition at line 169 of file SpTuples.h.

template<class IU, class NU>
NT& SpTuples< IU, NU >::numvalue ( IT  i)
inline

Definition at line 74 of file SpTuples.h.

template<class IU, class NU>
NT SpTuples< IU, NU >::numvalue ( IT  i) const
inline

Definition at line 78 of file SpTuples.h.

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

Definition at line 201 of file SpTuples.cpp.

template<class IT , class NT >
void SpTuples< IT, NT >::PrintInfo ( )

Definition at line 304 of file SpTuples.cpp.

template<class IU, class NU>
ofstream& SpTuples< IU, NU >::put ( ofstream &  outfile) const
inline

Definition at line 162 of file SpTuples.h.

template<class IT , class NT >
ofstream & SpTuples< IT, NT >::putstream ( ofstream &  outfile) const

Output to a triplets file

Remarks
Uses matlab type indexing for the output (i.e. indices start from 1)

Definition at line 292 of file SpTuples.cpp.

template<class IT , class NT >
template<typename BINFUNC >
void SpTuples< IT, NT >::RemoveDuplicates ( BINFUNC  BinOp)
Precondition
{The object is either column-sorted or row-sorted, either way the identical entries will be consecutive}

Definition at line 232 of file SpTuples.cpp.

template<class IU, class NU>
IT SpTuples< IU, NU >::RemoveLoops ( )
inline
Precondition
{should only be called on diagonal processors (others will remove non-loop nonzeros)}

Definition at line 104 of file SpTuples.h.

template<class IU, class NU>
IT& SpTuples< IU, NU >::rowindex ( IT  i)
inline

Definition at line 72 of file SpTuples.h.

template<class IU, class NU>
IT SpTuples< IU, NU >::rowindex ( IT  i) const
inline

Definition at line 76 of file SpTuples.h.

template<class IU, class NU>
pair<IT,IT> SpTuples< IU, NU >::RowLimits ( )
inline

Definition at line 127 of file SpTuples.h.

template<class IU, class NU>
void SpTuples< IU, NU >::SortColBased ( )
inline

Definition at line 94 of file SpTuples.h.

template<class IU, class NU>
void SpTuples< IU, NU >::SortRowBased ( )
inline

Definition at line 84 of file SpTuples.h.

Friends And Related Function Documentation

template<class IU, class NU>
template<typename SR , typename IU , typename NU >
SpTuples<IU,NU> MergeAll ( const vector< SpTuples< IU, NU > * > &  ArrSpTups,
IU  mstar = 0,
IU  nstar = 0,
bool  delarrs = false 
)
friend

Definition at line 552 of file Friends.h.

template<class IU, class NU>
template<typename SR , typename IU , typename NU >
SpTuples<IU,NU>* MergeAllRec ( const vector< SpTuples< IU, NU > * > &  ArrSpTups,
IU  mstar,
IU  nstar 
)
friend
template<class IU, class NU>
template<class IU , class NU >
friend class SpDCCols
friend

Definition at line 188 of file SpTuples.h.

Member Data Documentation

template<class IU, class NU>
tuple<IT, IT, NT>* SpTuples< IU, NU >::tuples

Definition at line 175 of file SpTuples.h.


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