COMBINATORIAL_BLAS  1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends
SpTuples< IT, NT > Class Template Reference

#include <SpTuples.h>

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

List of all members.

Public Member Functions

 SpTuples (int64_t size, IT nRow, IT nCol)
 SpTuples (int64_t size, IT nRow, IT nCol, tuple< IT, IT, NT > *mytuples)
 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.
 ~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
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
ifstream & getstream (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
void Transpose ()
bool operator== (const SpMat< IT, NT, SpTuples< IT, NT > > &rhs) const
ofstream & put (ofstream &outfile) const
ifstream & get (ifstream &infile)

Friends

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 IT, class NT>
class SpTuples< IT, NT >

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 37 of file SpTuples.h.


Constructor & Destructor Documentation

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

Definition at line 14 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 
)

Definition at line 28 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]edges,:edge 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 42 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 109 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 141 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 152 of file SpTuples.cpp.

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

Definition at line 127 of file SpTuples.cpp.


Member Function Documentation

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

Definition at line 127 of file SpTuples.h.

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

Definition at line 52 of file SpTuples.h.

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

Definition at line 56 of file SpTuples.h.

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

Definition at line 114 of file SpTuples.h.

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

Definition at line 126 of file SpTuples.h.

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

Reimplemented from SpMat< IT, NT, SpTuples< IT, NT > >.

Definition at line 141 of file SpTuples.h.

template<class IT, class NT>
int64_t SpTuples< IT, NT >::getnnz ( ) const
inline

Reimplemented from SpMat< IT, NT, SpTuples< IT, NT > >.

Definition at line 142 of file SpTuples.h.

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

Reimplemented from SpMat< IT, NT, SpTuples< IT, NT > >.

Definition at line 140 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 212 of file SpTuples.cpp.

template<class IT, class NT>
bool SpTuples< IT, NT >::isZero ( ) const
inline

Reimplemented from SpMat< IT, NT, SpTuples< IT, NT > >.

Definition at line 139 of file SpTuples.h.

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

Definition at line 53 of file SpTuples.h.

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

Definition at line 57 of file SpTuples.h.

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

Definition at line 182 of file SpTuples.cpp.

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

Definition at line 255 of file SpTuples.cpp.

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 243 of file SpTuples.cpp.

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

Definition at line 79 of file SpTuples.h.

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

Definition at line 51 of file SpTuples.h.

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

Definition at line 55 of file SpTuples.h.

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

Definition at line 102 of file SpTuples.h.

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

Definition at line 69 of file SpTuples.h.

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

Definition at line 59 of file SpTuples.h.


Friends And Related Function Documentation

template<class IT, class NT>
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 IT, class NT>
template<typename SR , typename IU , typename NU >
SpTuples<IU,NU>* MergeAllRec ( const vector< SpTuples< IU, NU > * > &  ArrSpTups,
IU  mstar,
IU  nstar 
)
friend
template<class IT, class NT>
friend class SpDCCols
friend

Definition at line 164 of file SpTuples.h.


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