From: Denis Davydov Date: Sun, 13 May 2018 06:21:40 +0000 (+0200) Subject: add Accessor::global_index() X-Git-Tag: v9.1.0-rc1~1144^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8931f466e3f544214b4a55fb2ff7807786b380ca;p=dealii.git add Accessor::global_index() --- diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index 4d8c4f1b96..a8bd82b187 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -149,6 +149,13 @@ namespace SparsityPatternIterators */ size_type index () const; + /** + * Return global index in sparsity pattern. + * This function can only be called for entries for which is_valid_entry() + * is true. + */ + size_type global_index () const; + /** * Column number of the element represented by this object. This function * can only be called for entries for which is_valid_entry() is true. @@ -1138,6 +1145,7 @@ namespace SparsityPatternIterators {} + inline Accessor:: Accessor (const SparsityPattern *sparsity_pattern) @@ -1147,6 +1155,7 @@ namespace SparsityPatternIterators {} + inline bool Accessor::is_valid_entry () const @@ -1158,6 +1167,7 @@ namespace SparsityPatternIterators } + inline size_type Accessor::row() const @@ -1172,6 +1182,7 @@ namespace SparsityPatternIterators } + inline size_type Accessor::column() const @@ -1182,6 +1193,7 @@ namespace SparsityPatternIterators } + inline size_type Accessor::index() const @@ -1193,6 +1205,16 @@ namespace SparsityPatternIterators + inline + size_type + Accessor::global_index() const + { + Assert (is_valid_entry() == true, ExcInvalidIterator()); + + return index_within_sparsity; + } + + inline bool @@ -1290,6 +1312,7 @@ namespace SparsityPatternIterators } + inline bool Iterator::operator < (const Iterator &other) const @@ -1298,6 +1321,7 @@ namespace SparsityPatternIterators } + inline int Iterator::operator - (const Iterator &other) const @@ -1319,6 +1343,7 @@ SparsityPattern::begin () const } + inline SparsityPattern::iterator SparsityPattern::end () const @@ -1358,6 +1383,7 @@ SparsityPattern::n_rows () const } + inline SparsityPattern::size_type SparsityPattern::n_cols () const @@ -1366,6 +1392,7 @@ SparsityPattern::n_cols () const } + inline bool SparsityPattern::is_compressed () const @@ -1374,6 +1401,7 @@ SparsityPattern::is_compressed () const } + inline bool SparsityPattern::stores_only_added_elements () const @@ -1405,6 +1433,7 @@ SparsityPattern::column_number (const size_type row, } + inline std::size_t SparsityPattern::n_nonzero_elements () const