17 #ifndef __deal2__compressed_sparsity_pattern_h
18 #define __deal2__compressed_sparsity_pattern_h
21 #include <deal.II/base/config.h>
22 #include <deal.II/base/subscriptor.h>
23 #include <deal.II/lac/exceptions.h>
171 void reinit (
const size_type m,
207 void add (
const size_type i,
216 template <
typename ForwardIterator>
218 ForwardIterator begin,
220 const bool indices_are_unique_and_sorted =
false);
226 bool exists (
const size_type i,
227 const size_type j)
const;
251 void print (std::ostream &out)
const;
283 size_type
n_rows ()
const;
290 size_type
n_cols ()
const;
295 size_type
row_length (
const size_type row)
const;
303 const size_type index)
const;
311 row_iterator
row_begin (
const size_type row)
const;
316 row_iterator
row_end (
const size_type row)
const;
460 void add (
const size_type col_num);
466 template <
typename ForwardIterator>
469 const bool indices_are_sorted);
505 if (cache_entries ==
cache_size && cache_entries != 0)
545 template <
typename ForwardIterator>
549 ForwardIterator begin,
551 const bool indices_are_sorted)
555 lines[row].add_entries (begin, end, indices_are_sorted);
574 if (
lines[row].cache_entries != 0)
575 lines[row].flush_cache ();
576 return lines[row].entries.size();
588 ExcIndexRangeType<size_type> (index, 0,
lines[row].entries.size()));
590 if (
lines[row].cache_entries != 0)
591 lines[row].flush_cache ();
592 return lines[row].entries[index];
603 if (
lines[row].cache_entries != 0)
604 lines[row].flush_cache ();
605 return lines[row].entries.begin();
615 return lines[row].entries.end();
630 DEAL_II_NAMESPACE_CLOSE
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_unique_and_sorted=false)
size_type cache[cache_size]
size_type max_entries_per_row() const
size_type bandwidth() const
void add(const size_type col_num)
std::vector< Line > lines
void print_gnuplot(std::ostream &out) const
types::global_dof_index size_type
CompressedSparsityPattern()
unsigned int cache_entries
void add_entries(ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted)
static const unsigned int cache_size
bool exists(const size_type i, const size_type j) const
unsigned int global_dof_index
#define Assert(cond, exc)
CompressedSparsityPattern & operator=(const CompressedSparsityPattern &)
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
std::vector< size_type > entries
size_type row_length(const size_type row) const
void add(const size_type i, const size_type j)
static bool stores_only_added_elements()
size_type column_number(const size_type row, const size_type index) const
std::vector< size_type >::const_iterator row_iterator
size_type n_nonzero_elements() const
void reinit(const size_type m, const size_type n)
void print(std::ostream &out) const
row_iterator row_end(const size_type row) const
row_iterator row_begin(const size_type row) const