39 , store_diagonal_first_in_row(
false)
56 "This constructor can only be called if the provided argument "
57 "is the sparsity pattern for an empty matrix. This constructor can "
58 "not be used to copy-construct a non-empty sparsity pattern."));
137 (row > extra_off_diagonals ?
140 row - extra_off_diagonals) :
144 (row <
rows - extra_off_diagonals - 1 ?
147 row + extra_off_diagonals) :
188 "This operator can only be called if the provided argument "
189 "is the sparsity pattern for an empty matrix. This operator can "
190 "not be used to copy a non-empty sparsity pattern."));
193 ExcMessage(
"This operator can only be called if the current object is "
210 if ((m == 0) || (n == 0))
486 const auto &row_index_set =
dsp.row_index_set();
490 if (row_index_set.size() == 0)
503 if (row_index_set.is_element(i))
526 for (
unsigned int index = 0; index <
row_length; ++index)
542template <
typename number>
552 for (
size_type row = 0; row < matrix.m(); ++row)
554 for (
size_type col = 0; col < matrix.n(); ++col)
555 if (matrix(row, col) != 0)
568 std::vector<size_type> column_indices;
569 column_indices.reserve(
573 for (
size_type row = 0; row < matrix.m(); ++row)
578 for (
size_type col = 0; col < matrix.n(); ++col)
579 if (matrix(row, col) != 0)
598 add_entries(row, column_indices.begin(), column_indices.end(),
true);
648std::pair<SparsityPattern::size_type, SparsityPattern::size_type>
667 return std::make_pair(row, col);
778template <
typename ForwardIterator>
905 out <<
']' << std::endl;
926 out <<
colnums[
j] <<
" " << -
static_cast<signed int>(i) << std::endl;
936 const unsigned int m = this->
n_rows();
937 const unsigned int n = this->
n_cols();
939 <<
"<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 "
940 << n + 2 <<
" " << m + 2
942 "<style type=\"text/css\" >\n"
950 << n + 2 <<
"\" height=\"" << m + 2
951 <<
"\" fill=\"rgb(128, 128, 128)\"/>\n"
952 " <rect x=\"1\" y=\"1\" width=\""
953 << n + 0.1 <<
"\" height=\"" << m + 0.1
954 <<
"\" fill=\"rgb(255, 255, 255)\"/>\n\n";
956 for (
const auto &entry : *
this)
958 out <<
" <rect class=\"pixel\" x=\"" << entry.column() + 1 <<
"\" y=\""
959 << entry.row() + 1 <<
"\" width=\".9\" height=\".9\"/>\n";
961 out <<
"</svg>" << std::endl;
976 out.write(
reinterpret_cast<const char *
>(
rowstart.get()),
978 reinterpret_cast<const char *
>(
rowstart.get()));
980 out.write(
reinterpret_cast<const char *
>(
colnums.get()),
982 reinterpret_cast<const char *
>(
colnums.get()));
1013 in.read(
reinterpret_cast<char *
>(
rowstart.get()),
1015 reinterpret_cast<char *
>(
rowstart.get()));
1020 in.read(
reinterpret_cast<char *
>(
colnums.get()),
1022 reinterpret_cast<char *
>(
colnums.get()));
1046SparsityPattern::add_entries<const SparsityPattern::size_type *>(
1051# ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER
1054 std::vector<SparsityPattern::size_type>::const_iterator>(
1056 std::vector<size_type>::const_iterator,
1057 std::vector<size_type>::const_iterator,
1061SparsityPattern::add_entries<std::vector<SparsityPattern::size_type>::iterator>(
1063 std::vector<size_type>::iterator,
1064 std::vector<size_type>::iterator,
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
virtual void resize(const size_type rows, const size_type cols)
std::pair< size_type, size_type > matrix_position(const std::size_t global_index) const
void block_write(std::ostream &out) const
void reinit(const size_type m, const size_type n, const ArrayView< const unsigned int > &row_lengths)
void print_svg(std::ostream &out) const
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
size_type bandwidth() const
void print_gnuplot(std::ostream &out) const
virtual void add_row_entries(const size_type &row, const ArrayView< const size_type > &columns, const bool indices_are_sorted=false) override
SparsityPattern & operator=(const SparsityPattern &)
std::size_t n_nonzero_elements() const
bool exists(const size_type i, const size_type j) const
std::unique_ptr< size_type[]> colnums
void copy_from(const size_type n_rows, const size_type n_cols, const ForwardIterator begin, const ForwardIterator end)
static constexpr size_type invalid_entry
size_type row_position(const size_type i, const size_type j) const
std::unique_ptr< std::size_t[]> rowstart
void print(std::ostream &out) const
void add(const size_type i, const size_type j)
bool store_diagonal_first_in_row
size_type max_entries_per_row() const
unsigned int max_row_length
size_type operator()(const size_type i, const size_type j) const
unsigned int row_length(const size_type row) const
std::size_t memory_consumption() const
void block_read(std::istream &in)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcEmptyObject()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotEnoughSpace(int arg1, int arg2)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMatrixIsCompressed()
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNotQuadratic()
static ::ExceptionBase & ExcNotCompressed()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
Iterator lower_bound(Iterator first, Iterator last, const T &val)
const types::global_dof_index invalid_size_type
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)