16#ifndef dealii_dynamic_sparsity_pattern_h
17#define dealii_dynamic_sparsity_pattern_h
73 const unsigned int index_within_row);
123 "The instance of this class was initialized"
124 " without DynamicSparsityPattern object, which"
125 " means that it is a dummy accessor that can"
126 " not do any operations.");
198 const unsigned int index_within_row);
434 template <
typename ForwardIterator>
437 ForwardIterator
begin,
439 const bool indices_are_unique_and_sorted =
false);
470 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
473 const SparsityPatternTypeRight &right);
479 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
482 const SparsityPatternTypeRight &right);
490 print(std::ostream &out)
const;
716 template <
typename ForwardIterator>
720 const bool indices_are_sorted);
747 const unsigned int index_within_row)
748 : sparsity_pattern(sparsity_pattern)
751 ((sparsity_pattern->rowset.size() == 0) ?
752 sparsity_pattern->lines[current_row].entries.begin() :
754 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
758 (sparsity_pattern->rowset.size() == 0) ?
759 sparsity_pattern->lines[current_row].entries.end() :
761 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
767 ExcMessage(
"You can't create an iterator into a "
768 "DynamicSparsityPattern's row that is not "
769 "actually stored by that sparsity pattern "
770 "based on the IndexSet argument to it."));
782 : sparsity_pattern(sparsity_pattern)
783 , current_row(
numbers::invalid_size_type)
791 : sparsity_pattern(nullptr)
792 , current_row(
numbers::invalid_size_type)
908 const unsigned int index_within_row)
909 : accessor(sparsity_pattern, row, index_within_row)
915 : accessor(sparsity_pattern)
965 return !(*
this == other);
1000 std::vector<size_type>::iterator it =
1043 lines[rowindex].add(j);
1048template <
typename ForwardIterator>
1051 ForwardIterator
begin,
1052 ForwardIterator
end,
1053 const bool indices_are_sorted)
1065 lines[rowindex].add_entries(
begin,
end, indices_are_sorted);
1083 return lines[rowindex].entries.size();
1098 return lines[local_row].entries[index];
1149 while (it !=
rowset.
end() &&
lines[rowindex].entries.size() == 0)
1158 return {
this, *it, 0};
1166 while (row <
n_rows() &&
lines[row].entries.size() == 0)
1174 return {
this, row, 0};
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
#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)
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
void add_entries(ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted)
types::global_dof_index size_type
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
std::vector< size_type > entries
bool operator==(const Iterator &) const
bool operator!=(const Iterator &) const
size_type column_index(const size_type row, const size_type col) const
const Accessor & operator*() const
const Accessor * operator->() const
DynamicSparsityPattern & operator=(const DynamicSparsityPattern &)
std::vector< Line > lines
size_type memory_consumption() const
size_type column_number(const size_type row, const size_type index) const
void print(std::ostream &out) const
void add(const size_type col_num)
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)
std::vector< size_type >::const_iterator end_of_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 operator==(const Accessor &) const
const DynamicSparsityPattern * sparsity_pattern
bool operator<(const Iterator &) const
bool exists(const size_type i, const size_type j) const
bool operator<(const Accessor &) const
int operator-(const Iterator &p) const
void add(const size_type i, const size_type j)
IndexSet nonempty_rows() const
std::vector< size_type >::const_iterator current_entry
Iterator lower_bound(Iterator first, Iterator last, const T &val)
const types::global_dof_index invalid_size_type
unsigned int global_dof_index