16 #ifndef dealii_dynamic_sparsity_pattern_h 17 #define dealii_dynamic_sparsity_pattern_h 76 const unsigned int index_within_row);
126 "The instance of this class was initialized" 127 " without DynamicSparsityPattern object, which" 128 " means that it is a dummy accessor that can" 129 " not do any operations.");
201 const unsigned int index_within_row);
425 max_entries_per_row()
const;
437 template <
typename ForwardIterator>
440 ForwardIterator
begin,
442 const bool indices_are_unique_and_sorted =
false);
457 get_view(
const IndexSet &rows)
const;
473 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
475 compute_mmult_pattern(
const SparsityPatternTypeLeft & left,
476 const SparsityPatternTypeRight &right);
482 template <
typename SparsityPatternTypeLeft,
typename SparsityPatternTypeRight>
484 compute_Tmmult_pattern(
const SparsityPatternTypeLeft & left,
485 const SparsityPatternTypeRight &right);
493 print(std::ostream &out)
const;
509 print_gnuplot(std::ostream &out)
const;
624 n_nonzero_elements()
const;
632 row_index_set()
const;
641 nonempty_cols()
const;
650 nonempty_rows()
const;
663 stores_only_added_elements();
719 template <
typename ForwardIterator>
721 add_entries(ForwardIterator
begin,
723 const bool indices_are_sorted);
750 const unsigned int index_within_row)
751 : sparsity_pattern(sparsity_pattern)
754 ((sparsity_pattern->rowset.size() == 0) ?
757 ->lines[sparsity_pattern->rowset.index_within_set(
current_row)]
761 (sparsity_pattern->rowset.size() == 0) ?
764 ->lines[sparsity_pattern->rowset.index_within_set(
current_row)]
770 ExcMessage(
"You can't create an iterator into a " 771 "DynamicSparsityPattern's row that is not " 772 "actually stored by that sparsity pattern " 773 "based on the IndexSet argument to it."));
785 : sparsity_pattern(sparsity_pattern)
911 const unsigned int index_within_row)
912 : accessor(sparsity_pattern, row, index_within_row)
966 return !(*
this == other);
994 if ((entries.size() == 0) || (entries.back() < j))
996 entries.push_back(j);
1001 std::vector<size_type>::iterator it =
1010 entries.insert(it, j);
1037 if (rowset.size() > 0 && !rowset.is_element(i))
1040 have_entries =
true;
1043 rowset.size() == 0 ? i : rowset.index_within_set(i);
1044 lines[rowindex].add(j);
1049 template <
typename ForwardIterator>
1052 ForwardIterator
begin,
1053 ForwardIterator
end,
1054 const bool indices_are_sorted)
1058 if (rowset.size() > 0 && !rowset.is_element(row))
1061 if (!have_entries && begin < end)
1062 have_entries =
true;
1065 rowset.size() == 0 ? row : rowset.index_within_set(row);
1066 lines[rowindex].add_entries(begin, end, indices_are_sorted);
1079 if (rowset.size() > 0 && !rowset.is_element(row))
1083 rowset.size() == 0 ? row : rowset.index_within_set(row);
1084 return lines[rowindex].entries.size();
1097 rowset.size() ? rowset.index_within_set(row) : row;
1099 return lines[local_row].entries[index];
1130 if (rowset.size() > 0)
1141 if (it == rowset.end())
1148 size_type rowindex = rowset.index_within_set(*it);
1150 while (it != rowset.end() && lines[rowindex].entries.size() == 0)
1156 if (it == rowset.end())
1159 return {
this, *it, 0};
1167 while (row < n_rows() && lines[row].entries.size() == 0)
1172 if (row == n_rows())
1175 return {
this, row, 0};
1185 unsigned int row = r + 1;
1186 if (row == n_rows())
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
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
const DynamicSparsityPattern * sparsity_pattern
std::vector< Line > lines
std::vector< size_type > entries
int operator-(const Iterator &p) const
constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
const Accessor & operator*() const
size_type column_number(const size_type row, const size_type index) const
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
void add(const size_type i, const size_type j)
#define AssertIndexRange(index, range)
bool operator<(const Iterator &) const
bool operator==(const Iterator &) const
static ::ExceptionBase & ExcMessage(std::string arg1)
std::string compress(const std::string &input)
static ::ExceptionBase & DummyAccessor()
#define Assert(cond, exc)
constexpr SymmetricTensor< rank_, dim, typename ProductType< Number, OtherNumber >::type > operator-(const SymmetricTensor< rank_, dim, Number > &left, const SymmetricTensor< rank_, dim, OtherNumber > &right)
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
#define DEAL_II_NAMESPACE_CLOSE
VectorType::value_type * end(VectorType &V)
static bool stores_only_added_elements()
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
const Accessor * operator->() const
std::vector< size_type >::const_iterator current_entry
unsigned int global_dof_index
MatrixTableIterators::Iterator< TransposeTable< T >, Constness, MatrixTableIterators::Storage::column_major > Iterator
size_type row_length(const size_type row) const
bool operator==(const Accessor &) const
bool operator!=(const Iterator &) const
#define DEAL_II_NAMESPACE_OPEN
VectorType::value_type * begin(VectorType &V)
static ::ExceptionBase & ExcNotImplemented()
bool is_element(const size_type index) const
void add(const size_type col_num)
std::enable_if< std::is_floating_point< T >::value &&std::is_floating_point< U >::value, typename ProductType< std::complex< T >, std::complex< U > >::type >::type operator*(const std::complex< T > &left, const std::complex< U > &right)
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()