Feel++
0.91.4
|
Graph representation of the Compressed Sparse Row format. More...
#include <graphcsr.hpp>
Public Types | |
Typedefs | |
typedef GraphCSR | self_type |
typedef boost::shared_ptr < self_type > | self_ptrtype |
typedef std::vector< size_type > | nz_type |
typedef boost::shared_ptr < nz_type > | nz_ptrtype |
typedef boost::tuple < size_type, size_type, std::set< size_type > > | row_type |
typedef std::map< size_type, row_type > | storage_type |
typedef boost::shared_ptr < storage_type > | storage_ptrtype |
typedef storage_type::iterator | iterator |
typedef storage_type::const_iterator | const_iterator |
Public Member Functions | |
Constructors, destructor | |
GraphCSR (size_type n=0, size_type first_row_entry_on_proc=0, size_type last_row_entry_on_proc=0, size_type first_col_entry_on_proc=0, size_type last_col_entry_on_proc=0, WorldComm const &worldcomm=WorldComm()) | |
GraphCSR (GraphCSR const &g) | |
~GraphCSR () | |
Operator overloads | |
GraphCSR & | operator= (GraphCSR const &g) |
Accessors | |
size_type | nRows () const |
size_type | nCols () const |
size_type | firstRowEntryOnProc () const |
size_type | lastRowEntryOnProc () const |
size_type | firstColEntryOnProc () const |
size_type | lastColEntryOnProc () const |
size_type | size () const |
bool | empty () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
row_type & | row (size_type i) |
row_type const & | row (size_type i) const |
storage_type const & | storage () const |
size_type | maxNnz () const |
std::vector< size_type > const & | nNz () const |
std::vector< size_type > const & | nNzOnProc () const |
std::vector< size_type > const & | nNzOffProc () const |
WorldComm const & | worldComm () const |
nz_type const & | ia () const |
nz_type const & | ja () const |
std::vector< double > const & | a () const |
std::vector< double > & | a () |
Mutators | |
void | setFirstRowEntryOnProc (size_type entry) |
void | setFirstColEntryOnProc (size_type entry) |
void | setLastRowEntryOnProc (size_type entry) |
void | setLastColEntryOnProc (size_type entry) |
Methods | |
void | zero () |
void | close () |
self_ptrtype | transpose () |
void | addMissingZeroEntriesDiagonal () |
void | showMe (std::ostream &__out=std::cout) const |
void | printPython (std::string const &nameFile) const |
Graph representation of the Compressed Sparse Row format.
Feel::GraphCSR::GraphCSR | ( | size_type | n = 0 , |
size_type | first_row_entry_on_proc = 0 , |
||
size_type | last_row_entry_on_proc = 0 , |
||
size_type | first_col_entry_on_proc = 0 , |
||
size_type | last_col_entry_on_proc = 0 , |
||
WorldComm const & | worldcomm = WorldComm() |
||
) |
default constructor
n | number of rows in the graph |
Feel::GraphCSR::GraphCSR | ( | GraphCSR const & | g | ) |
copy constructor
destructor
add missing zero entries diagonal
References end(), firstColEntryOnProc(), firstRowEntryOnProc(), lastColEntryOnProc(), lastRowEntryOnProc(), row(), storage(), and worldComm().
iterator Feel::GraphCSR::begin | ( | ) | [inline] |
Referenced by close().
const_iterator Feel::GraphCSR::begin | ( | ) | const [inline] |
void Feel::GraphCSR::close | ( | ) |
close the graph: compute some information per row (ie number of non-zero entries per row )
References begin(), end(), firstColEntryOnProc(), firstRowEntryOnProc(), lastColEntryOnProc(), lastRowEntryOnProc(), row(), size(), and worldComm().
Referenced by transpose().
bool Feel::GraphCSR::empty | ( | ) | const [inline] |
iterator Feel::GraphCSR::end | ( | ) | [inline] |
Referenced by addMissingZeroEntriesDiagonal(), close(), showMe(), and transpose().
const_iterator Feel::GraphCSR::end | ( | ) | const [inline] |
size_type Feel::GraphCSR::firstColEntryOnProc | ( | ) | const [inline] |
Referenced by addMissingZeroEntriesDiagonal(), and close().
size_type Feel::GraphCSR::firstRowEntryOnProc | ( | ) | const [inline] |
Referenced by addMissingZeroEntriesDiagonal(), and close().
size_type Feel::GraphCSR::lastColEntryOnProc | ( | ) | const [inline] |
Referenced by addMissingZeroEntriesDiagonal(), and close().
size_type Feel::GraphCSR::lastRowEntryOnProc | ( | ) | const [inline] |
Referenced by addMissingZeroEntriesDiagonal(), and close().
size_type Feel::GraphCSR::maxNnz | ( | ) | const [inline] |
std::vector<size_type> const& Feel::GraphCSR::nNz | ( | ) | const [inline] |
std::vector<size_type> const& Feel::GraphCSR::nNzOffProc | ( | ) | const [inline] |
std::vector<size_type> const& Feel::GraphCSR::nNzOnProc | ( | ) | const [inline] |
row_type& Feel::GraphCSR::row | ( | size_type | i | ) | [inline] |
get the i-th row
Referenced by addMissingZeroEntriesDiagonal(), close(), showMe(), transpose(), and zero().
row_type const& Feel::GraphCSR::row | ( | size_type | i | ) | const [inline] |
get the i-th row (const)
void Feel::GraphCSR::showMe | ( | std::ostream & | __out = std::cout | ) | const |
showMe
References end(), row(), and worldComm().
size_type Feel::GraphCSR::size | ( | ) | const [inline] |
Referenced by close().
storage_type const& Feel::GraphCSR::storage | ( | ) | const [inline] |
return storage
Referenced by addMissingZeroEntriesDiagonal().
GraphCSR::self_ptrtype Feel::GraphCSR::transpose | ( | ) |
transpose graph
References close(), end(), row(), and worldComm().
WorldComm const& Feel::GraphCSR::worldComm | ( | ) | const [inline] |
Referenced by addMissingZeroEntriesDiagonal(), close(), showMe(), transpose(), and zero().
void Feel::GraphCSR::zero | ( | ) |
graph has not entries
References row(), and worldComm().