Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::GraphCSR Class Reference

#include <graphcsr.hpp>

Detailed Description

Graph representation of the Compressed Sparse Row format.

Author
Christophe Prud'homme
See Also

Public Types

Typedefs
typedef GraphCSR self_type
 
typedef boost::shared_ptr
< self_type
self_ptrtype
 
typedef std::vector< size_typenz_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=Environment::worldComm())
 
 GraphCSR (boost::shared_ptr< DataMap > const &mapRow, boost::shared_ptr< DataMap > const &mapCol)
 
 GraphCSR (DataMap const &mapRow, DataMap const &mapCol)
 
 GraphCSR (vf::BlocksBase< self_ptrtype > const &blockSet, bool diagIsNonZero=true, bool close=true)
 
 GraphCSR (GraphCSR const &g)
 
 ~GraphCSR ()
 
Operator overloads
GraphCSRoperator= (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)
 
DataMap const & mapRow () const
 
DataMap const & mapCol () const
 
boost::shared_ptr< DataMap >
const & 
mapRowPtr () const
 
boost::shared_ptr< DataMap >
const & 
mapColPtr () const
 
boost::shared_ptr< DataMapmapRowPtr ()
 
boost::shared_ptr< DataMapmapColPtr ()
 
Methods
void zero ()
 
void close ()
 
self_ptrtype transpose (bool doClose=true)
 
void addMissingZeroEntriesDiagonal ()
 
void showMe (std::ostream &__out=std::cout) const
 
void printPython (std::string const &nameFile) const
 

Constructor & Destructor Documentation

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 = Environment::worldComm() 
)

default constructor

Parameters
nnumber of rows in the graph

References worldComm().

Feel::GraphCSR::GraphCSR ( GraphCSR const &  g)

copy constructor

Feel::GraphCSR::~GraphCSR ( )

destructor

Member Function Documentation

void Feel::GraphCSR::addMissingZeroEntriesDiagonal ( )
iterator Feel::GraphCSR::begin ( )
inline
Returns
begin (rw) iterator on graph
const_iterator Feel::GraphCSR::begin ( ) const
inline
Returns
begin (ro) iterator on graph
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(), storage(), and worldComm().

bool Feel::GraphCSR::empty ( ) const
inline
Returns
true if the graph is empty, false otherwise
iterator Feel::GraphCSR::end ( )
inline
Returns
end (rw) iterator on graph
const_iterator Feel::GraphCSR::end ( ) const
inline
Returns
end (ro) iterator on graph
size_type Feel::GraphCSR::firstColEntryOnProc ( ) const
inline
Returns
the first entry index on proc

References worldComm().

size_type Feel::GraphCSR::firstRowEntryOnProc ( ) const
inline
Returns
the first entry index on proc

References worldComm().

size_type Feel::GraphCSR::lastColEntryOnProc ( ) const
inline
Returns
the last entry index on proc

References worldComm().

size_type Feel::GraphCSR::lastRowEntryOnProc ( ) const
inline
Returns
the last entry index on proc

References worldComm().

size_type Feel::GraphCSR::maxNnz ( ) const
inline
Returns
the maximum number of non-zero entries per row
std::vector<size_type> const& Feel::GraphCSR::nNz ( ) const
inline
Returns
the array containing the number of non-zero entries per row that the current processor will deal with (rows that belong to the proc or not)
std::vector<size_type> const& Feel::GraphCSR::nNzOffProc ( ) const
inline
Returns
the array containing the number of non-zero entries per row on other processors
std::vector<size_type> const& Feel::GraphCSR::nNzOnProc ( ) const
inline
Returns
the array containing the number of non-zero entries per row on the current processor
GraphCSR & Feel::GraphCSR::operator= ( GraphCSR const &  g)

copy operator

row_type& Feel::GraphCSR::row ( size_type  i)
inline

get the i-th row

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
size_type Feel::GraphCSR::size ( ) const
inline
Returns
the number of rows in the pattern
storage_type const& Feel::GraphCSR::storage ( ) const
inline

return storage

GraphCSR::self_ptrtype Feel::GraphCSR::transpose ( bool  doClose = true)

transpose graph

References end().

WorldComm const& Feel::GraphCSR::worldComm ( ) const
inline
Returns
the communicator
void Feel::GraphCSR::zero ( )

graph has not entries

References close(), empty(), end(), firstRowEntryOnProc(), row(), storage(), and worldComm().


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

Generated on Fri Oct 25 2013 14:24:30 for Feel++ by doxygen 1.8.4