15#ifndef dealii_dynamic_sparsity_pattern_h
16#define dealii_dynamic_sparsity_pattern_h
74 const unsigned int index_within_row);
124 "The instance of this class was initialized"
125 " without DynamicSparsityPattern object, which"
126 " means that it is a dummy accessor that can"
127 " not do any operations.");
199 const unsigned int index_within_row);
435 template <
typename ForwardIterator>
438 ForwardIterator
begin,
440 const bool indices_are_unique_and_sorted =
false);
445 const bool indices_are_sorted =
false)
override;
478 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
481 const SparsityPatternTypeRight &right);
487 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
490 const SparsityPatternTypeRight &right);
498 print(std::ostream &out)
const;
703 template <
typename ForwardIterator>
707 const bool indices_are_sorted);
734 const unsigned int index_within_row)
735 : sparsity_pattern(sparsity_pattern)
738 ((sparsity_pattern->rowset.
size() == 0) ?
739 sparsity_pattern->lines[current_row].entries.begin() :
741 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
745 (sparsity_pattern->rowset.
size() == 0) ?
746 sparsity_pattern->lines[current_row].entries.end() :
748 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
754 ExcMessage(
"You can't create an iterator into a "
755 "DynamicSparsityPattern's row that is not "
756 "actually stored by that sparsity pattern "
757 "based on the IndexSet argument to it."));
769 : sparsity_pattern(sparsity_pattern)
770 , current_row(
numbers::invalid_size_type)
778 : sparsity_pattern(nullptr)
779 , current_row(
numbers::invalid_size_type)
895 const unsigned int index_within_row)
896 : accessor(sparsity_pattern, row, index_within_row)
902 : accessor(sparsity_pattern)
952 return !(*
this == other);
987 std::vector<size_type>::iterator it =
1014 lines[rowindex].add(j);
1019template <
typename ForwardIterator>
1022 ForwardIterator
begin,
1023 ForwardIterator
end,
1024 const bool indices_are_sorted)
1036 lines[rowindex].add_entries(
begin,
end, indices_are_sorted);
1054 return lines[rowindex].entries.size();
1069 return lines[local_row].entries[index];
1129 return {
this, *it, 0};
1137 while (row <
n_rows() &&
lines[row].entries.empty())
1145 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
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & DummyAccessor()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define DEAL_II_NOT_IMPLEMENTED()
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)