16#ifndef dealii_dynamic_sparsity_pattern_h
17#define dealii_dynamic_sparsity_pattern_h
75 const unsigned int index_within_row);
125 "The instance of this class was initialized"
126 " without DynamicSparsityPattern object, which"
127 " means that it is a dummy accessor that can"
128 " not do any operations.");
200 const unsigned int index_within_row);
436 template <
typename ForwardIterator>
439 ForwardIterator
begin,
441 const bool indices_are_unique_and_sorted =
false);
446 const bool indices_are_sorted =
false)
override;
479 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
482 const SparsityPatternTypeRight &right);
488 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
491 const SparsityPatternTypeRight &right);
499 print(std::ostream &out)
const;
704 template <
typename ForwardIterator>
708 const bool indices_are_sorted);
735 const unsigned int index_within_row)
736 : sparsity_pattern(sparsity_pattern)
739 ((sparsity_pattern->rowset.size() == 0) ?
740 sparsity_pattern->lines[current_row].entries.begin() :
742 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
746 (sparsity_pattern->rowset.size() == 0) ?
747 sparsity_pattern->lines[current_row].entries.end() :
749 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
755 ExcMessage(
"You can't create an iterator into a "
756 "DynamicSparsityPattern's row that is not "
757 "actually stored by that sparsity pattern "
758 "based on the IndexSet argument to it."));
770 : sparsity_pattern(sparsity_pattern)
771 , current_row(
numbers::invalid_size_type)
779 : sparsity_pattern(nullptr)
780 , current_row(
numbers::invalid_size_type)
896 const unsigned int index_within_row)
897 : accessor(sparsity_pattern, row, index_within_row)
903 : accessor(sparsity_pattern)
953 return !(*
this == other);
988 std::vector<size_type>::iterator it =
1015 lines[rowindex].add(j);
1020template <
typename ForwardIterator>
1023 ForwardIterator
begin,
1024 ForwardIterator
end,
1025 const bool indices_are_sorted)
1037 lines[rowindex].add_entries(
begin,
end, indices_are_sorted);
1055 return lines[rowindex].entries.size();
1070 return lines[local_row].entries[index];
1121 while (it !=
rowset.
end() &&
lines[rowindex].entries.size() == 0)
1130 return {
this, *it, 0};
1138 while (row <
n_rows() &&
lines[row].entries.size() == 0)
1146 return {
this, row, 0};
std::vector< size_type >::const_iterator end_of_row
bool operator==(const Accessor &) const
const DynamicSparsityPattern * sparsity_pattern
bool operator<(const Accessor &) const
std::vector< size_type >::const_iterator current_entry
bool operator==(const Iterator &) const
bool operator!=(const Iterator &) const
const Accessor & operator*() const
const Accessor * operator->() const
bool operator<(const Iterator &) const
int operator-(const Iterator &p) const
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_unique_and_sorted=false)
IndexSet nonempty_cols() const
DynamicSparsityPattern get_view(const IndexSet &rows) const
size_type memory_consumption() const
const IndexSet & row_index_set() const
void compute_mmult_pattern(const SparsityPatternTypeLeft &left, const SparsityPatternTypeRight &right)
size_type row_length(const size_type row) const
virtual void add_row_entries(const size_type &row, const ArrayView< const size_type > &columns, const bool indices_are_sorted=false) override
size_type column_index(const size_type row, const size_type col) const
DynamicSparsityPattern & operator=(const DynamicSparsityPattern &)
std::vector< Line > lines
size_type column_number(const size_type row, const size_type index) const
void print(std::ostream &out) const
void reinit(const size_type m, const size_type n, const IndexSet &rowset=IndexSet())
static bool stores_only_added_elements()
void clear_row(const size_type row)
size_type max_entries_per_row() const
void print_gnuplot(std::ostream &out) const
size_type bandwidth() const
void compute_Tmmult_pattern(const SparsityPatternTypeLeft &left, const SparsityPatternTypeRight &right)
size_type n_nonzero_elements() const
bool exists(const size_type i, const size_type j) const
void add(const size_type i, const size_type j)
IndexSet nonempty_rows() const
ElementIterator at(const size_type global_index) const
size_type index_within_set(const size_type global_index) const
bool is_element(const size_type index) const
ElementIterator end() const
virtual void add_entries(const ArrayView< const std::pair< size_type, size_type > > &entries)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & DummyAccessor()
static ::ExceptionBase & ExcMessage(std::string arg1)
Iterator lower_bound(Iterator first, Iterator last, const T &val)
const types::global_dof_index invalid_size_type
unsigned int global_dof_index
void add_entries(ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted)
std::vector< size_type > entries
size_type memory_consumption() const
void add(const size_type col_num)