40 , store_diagonal_first_in_row(
false)
57 "This constructor can only be called if the provided argument "
58 "is the sparsity pattern for an empty matrix. This constructor can "
59 "not be used to copy-construct a non-empty sparsity pattern."));
138 (row > extra_off_diagonals ?
141 row - extra_off_diagonals) :
145 (row <
rows - extra_off_diagonals - 1 ?
148 row + extra_off_diagonals) :
189 "This operator can only be called if the provided argument "
190 "is the sparsity pattern for an empty matrix. This operator can "
191 "not be used to copy a non-empty sparsity pattern."));
194 ExcMessage(
"This operator can only be called if the current object is "
211 if ((m == 0) || (n == 0))
487 const auto &row_index_set =
dsp.row_index_set();
491 if (row_index_set.size() == 0)
504 if (row_index_set.is_element(i))
527 for (
unsigned int index = 0; index <
row_length; ++index)
543template <
typename number>
553 for (
size_type row = 0; row < matrix.m(); ++row)
555 for (
size_type col = 0; col < matrix.n(); ++col)
556 if (matrix(row, col) != 0)
569 std::vector<size_type> column_indices;
570 column_indices.reserve(
574 for (
size_type row = 0; row < matrix.m(); ++row)
579 for (
size_type col = 0; col < matrix.n(); ++col)
580 if (matrix(row, col) != 0)
649std::pair<SparsityPattern::size_type, SparsityPattern::size_type>
668 return std::make_pair(row, col);
779template <
typename ForwardIterator>
906 out <<
']' << std::endl;
927 out <<
colnums[
j] <<
" " << -
static_cast<signed int>(i) << std::endl;
937 const unsigned int m = this->
n_rows();
938 const unsigned int n = this->
n_cols();
940 <<
"<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 "
941 << n + 2 <<
" " << m + 2
943 "<style type=\"text/css\" >\n"
951 << n + 2 <<
"\" height=\"" << m + 2
952 <<
"\" fill=\"rgb(128, 128, 128)\"/>\n"
953 " <rect x=\"1\" y=\"1\" width=\""
954 << n + 0.1 <<
"\" height=\"" << m + 0.1
955 <<
"\" fill=\"rgb(255, 255, 255)\"/>\n\n";
957 for (
const auto &entry : *
this)
959 out <<
" <rect class=\"pixel\" x=\"" << entry.column() + 1 <<
"\" y=\""
960 << entry.row() + 1 <<
"\" width=\".9\" height=\".9\"/>\n";
962 out <<
"</svg>" << std::endl;
977 out.write(
reinterpret_cast<const char *
>(
rowstart.get()),
979 reinterpret_cast<const char *
>(
rowstart.get()));
981 out.write(
reinterpret_cast<const char *
>(
colnums.get()),
983 reinterpret_cast<const char *
>(
colnums.get()));
1014 in.read(
reinterpret_cast<char *
>(
rowstart.get()),
1016 reinterpret_cast<char *
>(
rowstart.get()));
1021 in.read(
reinterpret_cast<char *
>(
colnums.get()),
1023 reinterpret_cast<char *
>(
colnums.get()));
1047SparsityPattern::add_entries<const SparsityPattern::size_type *>(
1052# ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER
1055 std::vector<SparsityPattern::size_type>::const_iterator>(
1057 std::vector<size_type>::const_iterator,
1058 std::vector<size_type>::const_iterator,
1062SparsityPattern::add_entries<std::vector<SparsityPattern::size_type>::iterator>(
1064 std::vector<size_type>::iterator,
1065 std::vector<size_type>::iterator,
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, 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 > &)