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);
432 template <
typename ForwardIterator>
435 ForwardIterator
begin,
437 const bool indices_are_unique_and_sorted =
false);
468 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
471 const SparsityPatternTypeRight &right);
477 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
480 const SparsityPatternTypeRight &right);
488 print(std::ostream &out)
const;
714 template <
typename ForwardIterator>
718 const bool indices_are_sorted);
745 const unsigned int index_within_row)
746 : sparsity_pattern(sparsity_pattern)
749 ((sparsity_pattern->rowset.size() == 0) ?
750 sparsity_pattern->lines[current_row].entries.
begin() :
752 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
756 (sparsity_pattern->rowset.size() == 0) ?
757 sparsity_pattern->lines[current_row].entries.
end() :
759 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
765 ExcMessage(
"You can't create an iterator into a "
766 "DynamicSparsityPattern's row that is not "
767 "actually stored by that sparsity pattern "
768 "based on the IndexSet argument to it."));
780 : sparsity_pattern(sparsity_pattern)
789 : sparsity_pattern(nullptr)
906 const unsigned int index_within_row)
907 : accessor(sparsity_pattern, row, index_within_row)
913 : accessor(sparsity_pattern)
961 return !(*
this == other);
996 std::vector<size_type>::iterator it =
1039 lines[rowindex].add(j);
1044template <
typename ForwardIterator>
1047 ForwardIterator
begin,
1048 ForwardIterator
end,
1049 const bool indices_are_sorted)
1061 lines[rowindex].add_entries(
begin,
end, indices_are_sorted);
1079 return lines[rowindex].entries.size();
1094 return lines[local_row].entries[index];
1145 while (it !=
rowset.
end() &&
lines[rowindex].entries.size() == 0)
1154 return {
this, *it, 0};
1162 while (row <
n_rows() &&
lines[row].entries.size() == 0)
1170 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
VectorType::value_type * end(VectorType &V)
VectorType::value_type * begin(VectorType &V)
Iterator lower_bound(Iterator first, Iterator last, const T &val)
const types::global_dof_index invalid_size_type
unsigned int global_dof_index