16 #ifndef dealii_dynamic_sparsity_pattern_h 17 #define dealii_dynamic_sparsity_pattern_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/index_set.h> 23 #include <deal.II/base/subscriptor.h> 24 #include <deal.II/base/utilities.h> 26 #include <deal.II/lac/exceptions.h> 32 DEAL_II_NAMESPACE_OPEN
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.");
200 const unsigned int index_within_row);
436 template <
typename ForwardIterator>
439 ForwardIterator
begin,
441 const bool indices_are_unique_and_sorted =
false);
472 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
475 const SparsityPatternTypeRight &right);
481 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
484 const SparsityPatternTypeRight &right);
492 print(std::ostream &out)
const;
718 template <
typename ForwardIterator>
722 const bool indices_are_sorted);
749 const unsigned int index_within_row)
750 : sparsity_pattern(sparsity_pattern)
753 ((sparsity_pattern->rowset.size() == 0) ?
754 sparsity_pattern->lines[current_row].entries.begin() :
756 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
760 (sparsity_pattern->rowset.size() == 0) ?
761 sparsity_pattern->lines[current_row].entries.end() :
763 ->lines[sparsity_pattern->rowset.index_within_set(current_row)]
769 ExcMessage(
"You can't create an iterator into a " 770 "DynamicSparsityPattern's row that is not " 771 "actually stored by that sparsity pattern " 772 "based on the IndexSet argument to it."));
784 : sparsity_pattern(sparsity_pattern)
785 , current_row(
numbers::invalid_size_type)
793 : sparsity_pattern(nullptr)
794 , current_row(
numbers::invalid_size_type)
910 const unsigned int index_within_row)
911 : accessor(sparsity_pattern, row, index_within_row)
917 : accessor(sparsity_pattern)
965 return !(*
this == other);
1000 std::vector<size_type>::iterator it =
1043 lines[rowindex].add(j);
1048 template <
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 ExcIndexRangeType<size_type>(index,
1100 lines[local_row].entries.size()));
1101 return lines[local_row].entries[index];
1152 while (it !=
rowset.
end() &&
lines[rowindex].entries.size() == 0)
1161 return {
this, *it, 0};
1169 while (row <
n_rows() &&
lines[row].entries.size() == 0)
1177 return {
this, row, 0};
1187 unsigned int row = r + 1;
1211 DEAL_II_NAMESPACE_CLOSE
Iterator lower_bound(Iterator first, Iterator last, const T &val)
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
const DynamicSparsityPattern * sparsity_pattern
ElementIterator end() const
std::vector< Line > lines
std::vector< size_type > entries
int operator-(const Iterator &p) const
const Accessor & operator*() const
void clear_row(const size_type row)
size_type column_number(const size_type row, const size_type index) const
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
size_type memory_consumption() const
bool operator==(const Iterator &) const
static ::ExceptionBase & ExcMessage(std::string arg1)
void compute_Tmmult_pattern(const SparsityPatternTypeLeft &left, const SparsityPatternTypeRight &right)
static ::ExceptionBase & DummyAccessor()
DynamicSparsityPattern get_view(const IndexSet &rows) const
#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
#define DeclExceptionMsg(Exception, defaulttext)
const IndexSet & row_index_set() const
void print_gnuplot(std::ostream &out) const
static bool stores_only_added_elements()
types::global_dof_index size_type
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
unsigned int global_dof_index
types::global_dof_index size_type
size_type row_length(const size_type row) const
bool operator==(const Accessor &) const
DynamicSparsityPattern & operator=(const DynamicSparsityPattern &)
bool operator!=(const Iterator &) const
IndexSet nonempty_rows() 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
size_type column_index(const size_type row, const size_type col) const
IndexSet nonempty_cols() const
static ::ExceptionBase & ExcInternalError()