16 #include <deal.II/lac/dynamic_sparsity_pattern.h> 17 #include <deal.II/base/memory_consumption.h> 24 DEAL_II_NAMESPACE_OPEN
28 template <
typename ForwardIterator>
32 const bool indices_are_sorted)
40 if (indices_are_sorted ==
true && n_elements > 3)
48 for ( ; test1 !=
end; ++test, ++test1)
63 ForwardIterator my_it =
begin;
65 std::vector<size_type>::iterator it =
101 std::vector<size_type>::iterator it2 = it + (
end-my_it);
110 else if (*my_it == *it2)
137 ForwardIterator my_it =
begin;
141 if (stop_size >
entries.capacity())
145 std::vector<size_type>::iterator it, it2;
178 for ( ; my_it !=
end; ++my_it)
231 have_entries (false),
238 ExcMessage(
"This constructor can only be called if the provided argument " 239 "is the sparsity pattern for an empty matrix. This constructor can " 240 "not be used to copy-construct a non-empty sparsity pattern."));
250 have_entries (false),
261 have_entries (false),
272 have_entries (false),
287 ExcMessage(
"This operator can only be called if the provided argument " 288 "is the sparsity pattern for an empty matrix. This operator can " 289 "not be used to copy a non-empty sparsity pattern."));
292 ExcMessage(
"This operator can only be called if the current object is" 311 ExcMessage(
"The IndexSet argument to this function needs to either " 312 "be empty (indicating the complete set of rows), or have size " 313 "equal to the desired number of rows as specified by the " 314 "first argument to this function. (Of course, the number " 315 "of indices in this IndexSet may be less than the number " 316 "of rows, but the *size* of the IndexSet must be equal.)"));
319 lines.swap (new_lines);
347 m = std::max (m, static_cast<size_type>(
lines[i].entries.size()));
369 return std::binary_search (
lines[rowindex].entries.begin(),
370 lines[rowindex].entries.end(),
397 for (std::vector<size_type>::const_iterator
398 j=
lines[row].entries.begin();
399 j !=
lines[row].entries.end();
417 for (std::vector<size_type >::const_iterator
418 j=
lines[row].entries.begin();
419 j !=
lines[row].entries.end(); ++j)
422 out <<
']' << std::endl;
438 for (std::vector<size_type >::const_iterator
439 j=
lines[row].entries.begin();
440 j !=
lines[row].entries.end(); ++j)
447 << -static_cast<signed int>(rowindex)
466 for (std::vector<size_type>::const_iterator
467 j=
lines[row].entries.begin();
468 j !=
lines[row].entries.end(); ++j)
469 if (static_cast<size_type>(std::abs(static_cast<int>(rowindex-*j))) > b)
470 b = std::abs(static_cast<signed int>(rowindex-*j));
487 n +=
lines[i].entries.size();
515 #ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER 518 std::vector<size_type>::iterator,
522 DEAL_II_NAMESPACE_CLOSE
Iterator lower_bound(Iterator first, Iterator last, const T &val)
std::vector< Line > lines
std::vector< size_type > entries
size_type nth_index_in_set(const unsigned int local_index) const
static ::ExceptionBase & ExcIO()
void add(const size_type i, const size_type j)
size_type max_entries_per_row() const
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
types::global_dof_index size_type
size_type memory_consumption() const
static ::ExceptionBase & ExcMessage(std::string arg1)
#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
void print_gnuplot(std::ostream &out) const
size_type memory_consumption() const
size_type n_nonzero_elements() const
static ::ExceptionBase & ExcNotQuadratic()
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
DynamicSparsityPattern & operator=(const DynamicSparsityPattern &)
void print(std::ostream &out) const
bool is_element(const size_type index) const
size_type bandwidth() const
bool exists(const size_type i, const size_type j) const
size_type n_elements() const
static ::ExceptionBase & ExcInternalError()