libgenua
Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Private Attributes | List of all members
SparsityCounter Class Reference

Detailed Description

Sparsity pattern counter based on hash table.

Sparsity Counter can be used to assemble the nonzero pattern of a sparse matrix from irregular input data, for instance when the sparsity pattern is determined by a numerical criterion instead of a purely topological relationship. The sparsity pattern is stored in an boost::unordered_set, which is most likely rather inefficient for access in numerical algorithms. Therefore, this object is normally only used in the construction phase of the sparse matrix nonzero pattern, which is then stored efficiently in a ConnectMap.

Todo:
Evaluate whether the use of ordered (std::set) containers is more efficient, as it eliminates the need for the sorting step in ConnectMap::assign().
See Also
ConnectMap

#include <sparsitycounter.h>

Public Member Functions

 SparsityCounter ()
 empty counter
 
size_t size () const
 number of entries registered
 
const_iterator begin () const
 access stored coordinates
 
const_iterator end () const
 access stored coordinates
 
void append (uint row, uint col)
 append coordinate value to set
 
void append (uint row, uint n, const uint cols[])
 append multiple values for the same row
 
void append (const ConnectMap &map)
 append a full map
 
void merge (const SparsityCounter &a)
 merge with another counter
 
void clear ()
 remove contents
 

Private Attributes

CoordSet coord
 unique storage for coordinates
 

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