16 #ifndef dealii_dynamic_sparsity_pattern_h 17 #define dealii_dynamic_sparsity_pattern_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/subscriptor.h> 22 #include <deal.II/base/utilities.h> 23 #include <deal.II/lac/exceptions.h> 24 #include <deal.II/base/index_set.h> 30 DEAL_II_NAMESPACE_OPEN
72 const unsigned int index_within_row);
180 const unsigned int index_within_row);
402 template <
typename ForwardIterator>
404 ForwardIterator
begin,
406 const bool indices_are_unique_and_sorted =
false);
427 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
429 const SparsityPatternTypeRight &right);
436 void print (std::ostream &out)
const;
617 template <
typename ForwardIterator>
620 const bool indices_are_sorted);
648 const unsigned int index_within_row)
650 sparsity_pattern(sparsity_pattern),
652 current_entry(((sparsity_pattern->rowset.size()==0)
654 sparsity_pattern->lines[current_row].entries.begin()
656 sparsity_pattern->lines[sparsity_pattern->rowset.index_within_set(current_row)].entries.begin())
659 end_of_row((sparsity_pattern->rowset.size()==0)
661 sparsity_pattern->lines[current_row].entries.end()
663 sparsity_pattern->lines[sparsity_pattern->rowset.index_within_set(current_row)].entries.end())
669 ExcMessage (
"You can't create an iterator into a " 670 "DynamicSparsityPattern's row that is not " 671 "actually stored by that sparsity pattern " 672 "based on the IndexSet argument to it."));
686 sparsity_pattern(sparsity_pattern),
687 current_row(
numbers::invalid_size_type),
698 Assert (current_row < sparsity_pattern->n_rows(),
709 Assert (current_row < sparsity_pattern->n_rows(),
720 Assert (current_row < sparsity_pattern->n_rows(),
761 Assert (current_row < sparsity_pattern->n_rows(),
782 Assert (current_row < sparsity_pattern->n_rows(),
811 const unsigned int index_within_row)
813 accessor(sparsity_pattern, row, index_within_row)
821 accessor(sparsity_pattern)
877 return ! (*
this == other);
915 std::vector<size_type>::iterator
964 lines[rowindex].add (j);
969 template <
typename ForwardIterator>
973 ForwardIterator
begin,
975 const bool indices_are_sorted)
987 lines[rowindex].add_entries (
begin,
end, indices_are_sorted);
1006 return lines[rowindex].entries.size();
1021 ExcIndexRangeType<size_type> (index, 0,
lines[local_row].entries.size()));
1022 return lines[local_row].entries[index];
1074 &&
lines[rowindex].entries.size()==0)
1091 while (row<
n_rows() &&
lines[row].entries.size()==0)
1110 unsigned int row = r+1;
1136 DEAL_II_NAMESPACE_CLOSE
Iterator lower_bound(Iterator first, Iterator last, const T &val)
types::global_dof_index size_type
const types::global_dof_index invalid_size_type
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_unique_and_sorted=false)
std::vector< size_type >::const_iterator end_of_row
DynamicSparsityPatternIterators::Iterator const_iterator
const DynamicSparsityPattern * sparsity_pattern
ElementIterator end() const
std::vector< Line > lines
std::vector< size_type > entries
DynamicSparsityPatternIterators::Iterator iterator
int operator-(const Iterator &p) const
const Accessor & operator*() const
Iterator(const DynamicSparsityPattern *sp, const size_type row, const unsigned int index_within_row)
size_type column_number(const size_type row, const size_type index) const
Accessor(const DynamicSparsityPattern *sparsity_pattern, const size_type row, const unsigned int index_within_row)
void add(const size_type i, const size_type j)
size_type max_entries_per_row() const
#define AssertIndexRange(index, range)
bool operator<(const Iterator &) const
types::global_dof_index size_type
size_type memory_consumption() const
bool operator==(const Iterator &) const
static ::ExceptionBase & ExcMessage(std::string arg1)
unsigned int global_dof_index
#define Assert(cond, exc)
void add_entries(ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted)
void reinit(const size_type m, const size_type n, const IndexSet &rowset=IndexSet())
size_type index_within_set(const size_type global_index) const
bool operator<(const Accessor &) const
const IndexSet & row_index_set() const
void print_gnuplot(std::ostream &out) const
static bool stores_only_added_elements()
void compute_mmult_pattern(const SparsityPatternTypeLeft &left, const SparsityPatternTypeRight &right)
size_type memory_consumption() const
const Accessor * operator->() const
size_type n_nonzero_elements() const
std::vector< size_type >::const_iterator current_entry
size_type row_length(const size_type row) const
bool operator==(const Accessor &) const
DynamicSparsityPattern & operator=(const DynamicSparsityPattern &)
bool operator!=(const Iterator &) const
void print(std::ostream &out) const
static ::ExceptionBase & ExcNotImplemented()
bool is_element(const size_type index) const
void add(const size_type col_num)
size_type bandwidth() const
ElementIterator at(const size_type global_index) const
bool exists(const size_type i, const size_type j) const
static ::ExceptionBase & ExcInternalError()