Reference documentation for deal.II version 8.1.0
sparsity_pattern.h
1 // ---------------------------------------------------------------------
2 // @f$Id: sparsity_pattern.h 31227 2013-10-14 13:23:43Z bangerth @f$
3 //
4 // Copyright (C) 2000 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__sparsity_pattern_h
18 #define __deal2__sparsity_pattern_h
19 
20 
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/subscriptor.h>
24 #include <boost/serialization/array.hpp>
25 #include <boost/serialization/split_member.hpp>
26 
27 #include <vector>
28 #include <iostream>
29 
31 
32 class SparsityPattern;
34 template <typename number> class FullMatrix;
35 template <typename number> class SparseMatrix;
36 template <typename number> class SparseLUDecomposition;
37 template <typename number> class SparseILU;
38 template <class VECTOR> class VectorSlice;
39 
43 
44 
46 {
47  class Accessor;
48 }
49 
50 
55 namespace internals
56 {
57  namespace SparsityPatternTools
58  {
63 
69  size_type
70  get_column_index_from_iterator (const size_type i);
71 
77  template <typename value>
78  size_type
79  get_column_index_from_iterator (const std::pair<size_type, value> &i);
80 
86  template <typename value>
87  size_type
88  get_column_index_from_iterator (const std::pair<const size_type, value> &i);
89 
90  }
91 }
92 
93 
98 {
99  // forward declaration
100  class Iterator;
101 
106 
120  class Accessor
121  {
122  public:
129  Accessor (const SparsityPattern *matrix,
130  const size_type row,
131  const size_type index) DEAL_II_DEPRECATED;
132 
136  Accessor (const SparsityPattern *matrix,
137  const std::size_t index_within_sparsity);
138 
142  Accessor (const SparsityPattern *matrix);
143 
148  size_type row () const;
149 
154  size_type index () const;
155 
160  size_type column () const;
161 
171  bool is_valid_entry () const;
172 
176  bool operator == (const Accessor &) const;
177 
185  bool operator < (const Accessor &) const;
186 
187  protected:
192 
201 
205  void advance ();
206 
210  friend class Iterator;
211 
216  };
217 
218 
219 
244  class Iterator
245  {
246  public:
254  Iterator (const SparsityPattern *sp,
255  const size_type row,
256  const size_type index) DEAL_II_DEPRECATED;
257 
263  Iterator (const SparsityPattern *sp,
264  const std::size_t index_within_sparsity);
265 
269  Iterator &operator++ ();
270 
274  Iterator operator++ (int);
275 
279  const Accessor &operator* () const;
280 
284  const Accessor *operator-> () const;
285 
289  bool operator == (const Iterator &) const;
290 
294  bool operator != (const Iterator &) const;
295 
303  bool operator < (const Iterator &) const;
304 
311  int operator - (const Iterator &p) const;
312 
313  private:
318  };
319 }
320 
321 
322 
351 {
352 public:
357 
362  typedef
365 
372  typedef
373  const size_type *row_iterator;
374 
382  typedef
385 
386 
401  static const size_type invalid_entry = numbers::invalid_size_type;
402 
407 // @{
413  SparsityPattern ();
414 
431 
443  SparsityPattern (const size_type m,
444  const size_type n,
445  const unsigned int max_per_row,
446  const bool optimize_diagonal) DEAL_II_DEPRECATED;
447 
455  SparsityPattern (const size_type m,
456  const size_type n,
457  const unsigned int max_per_row);
458 
471  SparsityPattern (const size_type m,
472  const size_type n,
473  const std::vector<unsigned int> &row_lengths,
474  const bool optimize_diagonal) DEAL_II_DEPRECATED;
475 
484  SparsityPattern (const size_type m,
485  const size_type n,
486  const std::vector<unsigned int> &row_lengths);
487 
496  SparsityPattern (const size_type n,
497  const unsigned int max_per_row);
498 
510  SparsityPattern (const size_type m,
511  const std::vector<unsigned int> &row_lengths,
512  const bool optimize_diagonal) DEAL_II_DEPRECATED;
513 
521  SparsityPattern (const size_type m,
522  const std::vector<unsigned int> &row_lengths);
523 
546  SparsityPattern (const SparsityPattern &original,
547  const unsigned int max_per_row,
548  const size_type extra_off_diagonals);
549 
553  ~SparsityPattern ();
554 
560  SparsityPattern &operator = (const SparsityPattern &);
561 
573  void reinit (const size_type m,
574  const size_type n,
575  const unsigned int max_per_row,
576  const bool optimize_diagonal) DEAL_II_DEPRECATED;
577 
586  void reinit (const size_type m,
587  const size_type n,
588  const unsigned int max_per_row);
589 
607  void reinit (const size_type m,
608  const size_type n,
609  const std::vector<unsigned int> &row_lengths,
610  const bool optimize_diagonal) DEAL_II_DEPRECATED;
611 
626  void reinit (const size_type m,
627  const size_type n,
628  const std::vector<unsigned int> &row_lengths);
629 
636  void reinit (const size_type m,
637  const size_type n,
638  const VectorSlice<const std::vector<unsigned int> > &row_lengths,
639  const bool optimize_diagonal) DEAL_II_DEPRECATED;
640 
644  void reinit (const size_type m,
645  const size_type n,
646  const VectorSlice<const std::vector<unsigned int> > &row_lengths);
647 
660  void compress ();
661 
741  template <typename ForwardIterator>
742  void copy_from (const size_type n_rows,
743  const size_type n_cols,
744  const ForwardIterator begin,
745  const ForwardIterator end,
746  const bool optimize_diagonal) DEAL_II_DEPRECATED;
747 
824  template <typename ForwardIterator>
825  void copy_from (const size_type n_rows,
826  const size_type n_cols,
827  const ForwardIterator begin,
828  const ForwardIterator end);
829 
839  template <typename CompressedSparsityType>
840  void copy_from (const CompressedSparsityType &csp,
841  const bool optimize_diagonal) DEAL_II_DEPRECATED;
842 
851  template <typename CompressedSparsityType>
852  void copy_from (const CompressedSparsityType &csp);
853 
864  template <typename number>
865  void copy_from (const FullMatrix<number> &matrix,
866  const bool optimize_diagonal) DEAL_II_DEPRECATED;
867 
875  template <typename number>
876  void copy_from (const FullMatrix<number> &matrix);
877 
885  void symmetrize ();
886 
893  void add (const size_type i,
894  const size_type j);
895 
902  template <typename ForwardIterator>
903  void add_entries (const size_type row,
904  ForwardIterator begin,
905  ForwardIterator end,
906  const bool indices_are_sorted = false);
907 
908 // @}
912 // @{
913 
922  iterator begin () const;
923 
927  iterator end () const;
928 
940  iterator begin (const size_type r) const;
941 
950  iterator end (const size_type r) const;
951 
963  row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
964 
976  row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
977 
978 // @}
982 // @{
986  bool operator == (const SparsityPattern &) const;
987 
992  bool empty () const;
993 
999  size_type max_entries_per_row () const;
1000 
1007  size_type bandwidth () const;
1008 
1017  size_type n_nonzero_elements () const;
1018 
1022  bool is_compressed () const;
1023 
1028  size_type n_rows () const;
1029 
1034  size_type n_cols () const;
1035 
1039  unsigned int row_length (const size_type row) const;
1040 
1048  bool optimize_diagonal () const DEAL_II_DEPRECATED;
1049 
1062  bool stores_only_added_elements () const;
1063 
1068  std::size_t memory_consumption () const;
1069 
1070 // @}
1074 // @{
1097  size_type operator() (const size_type i,
1098  const size_type j) const;
1099 
1111  std::pair<size_type, size_type>
1112  matrix_position (const size_type global_index) const;
1113 
1117  bool exists (const size_type i,
1118  const size_type j) const;
1119 
1127  size_type row_position(const size_type i,
1128  const size_type j) const;
1129 
1141  size_type column_number (const size_type row,
1142  const unsigned int index) const;
1143 
1144 
1145 // @}
1149 // @{
1160  void block_write (std::ostream &out) const;
1161 
1175  void block_read (std::istream &in);
1176 
1182  void print (std::ostream &out) const;
1183 
1197  void print_gnuplot (std::ostream &out) const;
1198 
1203  template <class Archive>
1204  void save (Archive &ar, const unsigned int version) const;
1205 
1210  template <class Archive>
1211  void load (Archive &ar, const unsigned int version);
1212 
1213 // @}
1217 // @{
1253  void partition (const unsigned int n_partitions,
1254  std::vector<unsigned int> &partition_indices) const DEAL_II_DEPRECATED;
1255 
1256 
1275  const std::size_t *get_rowstart_indices () const DEAL_II_DEPRECATED;
1276 
1294  const size_type *get_column_numbers () const DEAL_II_DEPRECATED;
1295 
1296  BOOST_SERIALIZATION_SPLIT_MEMBER()
1303  DeclException2 (ExcNotEnoughSpace,
1304  int, int,
1305  << "Upon entering a new entry to row " << arg1
1306  << ": there was no free entry any more. " << std::endl
1307  << "(Maximum number of entries for this row: "
1308  << arg2 << "; maybe the matrix is already compressed?)");
1313  DeclException0 (ExcNotCompressed);
1318  DeclException0 (ExcMatrixIsCompressed);
1328  DeclException0 (ExcDiagonalNotOptimized);
1332  DeclException2 (ExcIteratorRange,
1333  int, int,
1334  << "The iterators denote a range of " << arg1
1335  << " elements, but the given number of rows was " << arg2);
1339  DeclException1 (ExcInvalidNumberOfPartitions,
1340  int,
1341  << "The number of partitions you gave is " << arg1
1342  << ", but must be greater than zero.");
1344 private:
1352  size_type max_dim;
1353 
1357  size_type rows;
1358 
1362  size_type cols;
1363 
1369  size_type max_vec_len;
1370 
1378  unsigned int max_row_length;
1379 
1393  std::size_t *rowstart;
1394 
1417  size_type *colnums;
1418 
1422  bool compressed;
1423 
1427  bool store_diagonal_first_in_row;
1428 
1432  template <typename number> friend class SparseMatrix;
1433  template <typename number> friend class SparseLUDecomposition;
1434  template <typename number> friend class SparseILU;
1435  template <typename number> friend class ChunkSparseMatrix;
1436 
1437  friend class ChunkSparsityPattern;
1438 
1443  friend class SparsityPatternIterators::Iterator;
1444  friend class SparsityPatternIterators::Accessor;
1445  friend class ChunkSparsityPatternIterators::Accessor;
1446 };
1447 
1448 
1450 /*---------------------- Inline functions -----------------------------------*/
1451 
1452 #ifndef DOXYGEN
1453 
1454 
1455 namespace SparsityPatternIterators
1456 {
1457  inline
1458  Accessor::
1459  Accessor (const SparsityPattern *sparsity_pattern,
1460  const size_type r,
1461  const size_type i)
1462  :
1463  sparsity_pattern(sparsity_pattern),
1464  index_within_sparsity(sparsity_pattern->rowstart[r]+i)
1465  {}
1466 
1467 
1468  inline
1469  Accessor::
1470  Accessor (const SparsityPattern *sparsity_pattern,
1471  const std::size_t i)
1472  :
1473  sparsity_pattern(sparsity_pattern),
1474  index_within_sparsity(i)
1475  {}
1476 
1477 
1478  inline
1479  Accessor::
1480  Accessor (const SparsityPattern *sparsity_pattern)
1481  :
1482  sparsity_pattern(sparsity_pattern),
1483  index_within_sparsity(sparsity_pattern->rowstart[sparsity_pattern->rows])
1484  {}
1485 
1486 
1487  inline
1488  bool
1489  Accessor::is_valid_entry () const
1490  {
1491  return (index_within_sparsity < sparsity_pattern->rowstart[sparsity_pattern->rows]
1492  &&
1493  sparsity_pattern->colnums[index_within_sparsity]
1495  }
1496 
1497 
1498  inline
1499  size_type
1500  Accessor::row() const
1501  {
1502  Assert (is_valid_entry() == true, ExcInvalidIterator());
1503 
1504  const std::size_t *insert_point =
1505  std::upper_bound(sparsity_pattern->rowstart,
1506  sparsity_pattern->rowstart + sparsity_pattern->rows + 1,
1507  index_within_sparsity);
1508  return insert_point - sparsity_pattern->rowstart - 1;
1509  }
1510 
1511 
1512  inline
1513  size_type
1514  Accessor::column() const
1515  {
1516  Assert (is_valid_entry() == true, ExcInvalidIterator());
1517 
1518  return (sparsity_pattern->colnums[index_within_sparsity]);
1519  }
1520 
1521 
1522  inline
1523  size_type
1524  Accessor::index() const
1525  {
1526  Assert (is_valid_entry() == true, ExcInvalidIterator());
1527 
1528  return index_within_sparsity - sparsity_pattern->rowstart[row()];
1529  }
1530 
1531 
1532 
1533 
1534  inline
1535  bool
1536  Accessor::operator == (const Accessor &other) const
1537  {
1538  return (sparsity_pattern == other.sparsity_pattern &&
1539  index_within_sparsity == other.index_within_sparsity);
1540  }
1541 
1542 
1543 
1544  inline
1545  bool
1546  Accessor::operator < (const Accessor &other) const
1547  {
1548  Assert (sparsity_pattern == other.sparsity_pattern,
1549  ExcInternalError());
1550 
1551  return index_within_sparsity < other.index_within_sparsity;
1552  }
1553 
1554 
1555  inline
1556  void
1558  {
1559  Assert (index_within_sparsity < sparsity_pattern->rowstart[sparsity_pattern->rows],
1560  ExcIteratorPastEnd());
1561  ++index_within_sparsity;
1562  }
1563 
1564 
1565 
1566  inline
1567  Iterator::Iterator (const SparsityPattern *sparsity_pattern,
1568  const size_type r,
1569  const size_type i)
1570  :
1571  accessor(sparsity_pattern, sparsity_pattern->rowstart[r]+i)
1572  {}
1573 
1574 
1575 
1576  inline
1577  Iterator::Iterator (const SparsityPattern *sparsity_pattern,
1578  const std::size_t i)
1579  :
1580  accessor(sparsity_pattern, i)
1581  {}
1582 
1583 
1584 
1585  inline
1586  Iterator &
1588  {
1589  accessor.advance ();
1590  return *this;
1591  }
1592 
1593 
1594 
1595  inline
1596  Iterator
1598  {
1599  const Iterator iter = *this;
1600  accessor.advance ();
1601  return iter;
1602  }
1603 
1604 
1605 
1606  inline
1607  const Accessor &
1608  Iterator::operator* () const
1609  {
1610  return accessor;
1611  }
1612 
1613 
1614 
1615  inline
1616  const Accessor *
1617  Iterator::operator-> () const
1618  {
1619  return &accessor;
1620  }
1621 
1622 
1623  inline
1624  bool
1625  Iterator::operator == (const Iterator &other) const
1626  {
1627  return (accessor == other.accessor);
1628  }
1629 
1630 
1631 
1632  inline
1633  bool
1634  Iterator::operator != (const Iterator &other) const
1635  {
1636  return ! (*this == other);
1637  }
1638 
1639 
1640  inline
1641  bool
1642  Iterator::operator < (const Iterator &other) const
1643  {
1644  return accessor < other.accessor;
1645  }
1646 
1647 
1648  inline
1649  int
1650  Iterator::operator - (const Iterator &other) const
1651  {
1652  Assert (accessor.sparsity_pattern == other.accessor.sparsity_pattern,
1653  ExcInternalError());
1654 
1655  return (*this)->index_within_sparsity - other->index_within_sparsity;
1656  }
1657 }
1658 
1659 
1660 
1661 inline
1663 SparsityPattern::begin () const
1664 {
1665  return iterator(this, rowstart[0]);
1666 }
1667 
1668 
1669 inline
1671 SparsityPattern::end () const
1672 {
1673  return iterator(this, rowstart[rows]);
1674 }
1675 
1676 
1677 
1678 inline
1680 SparsityPattern::begin (const size_type r) const
1681 {
1682  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
1683 
1684  return iterator(this, rowstart[r]);
1685 }
1686 
1687 
1688 
1689 inline
1691 SparsityPattern::end (const size_type r) const
1692 {
1693  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
1694 
1695  return iterator(this, rowstart[r+1]);
1696 }
1697 
1698 
1699 
1700 inline
1702 SparsityPattern::row_begin (const size_type r) const
1703 {
1704  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
1705  return &colnums[rowstart[r]];
1706 }
1707 
1708 
1709 
1710 inline
1712 SparsityPattern::row_end (const size_type r) const
1713 {
1714  Assert (r<n_rows(), ExcIndexRangeType<size_type>(r,0,n_rows()));
1715  return &colnums[rowstart[r+1]];
1716 }
1717 
1718 
1719 
1720 inline
1722 SparsityPattern::n_rows () const
1723 {
1724  return rows;
1725 }
1726 
1727 
1728 inline
1730 SparsityPattern::n_cols () const
1731 {
1732  return cols;
1733 }
1734 
1735 
1736 inline
1737 bool
1739 {
1740  return compressed;
1741 }
1742 
1743 
1744 inline
1745 bool
1747 {
1748  return store_diagonal_first_in_row;
1749 }
1750 
1751 
1752 inline
1753 bool
1755 {
1756  return (store_diagonal_first_in_row == false);
1757 }
1758 
1759 
1760 inline
1761 const std::size_t *
1763 {
1764  return rowstart;
1765 }
1766 
1767 
1768 inline
1771 {
1772  return colnums;
1773 }
1774 
1775 
1776 
1777 inline
1778 unsigned int
1779 SparsityPattern::row_length (const size_type row) const
1780 {
1781  Assert(row<rows, ExcIndexRangeType<size_type>(row,0,rows));
1782  return rowstart[row+1]-rowstart[row];
1783 }
1784 
1785 
1786 
1787 inline
1789 SparsityPattern::column_number (const size_type row,
1790  const unsigned int index) const
1791 {
1792  Assert(row<rows, ExcIndexRangeType<size_type>(row,0,rows));
1793  Assert(index<row_length(row), ExcIndexRange(index,0,row_length(row)));
1794 
1795  return colnums[rowstart[row]+index];
1796 }
1797 
1798 
1799 inline
1802 {
1803  Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
1804  Assert (compressed, ExcNotCompressed());
1805  return rowstart[rows]-rowstart[0];
1806 }
1807 
1808 
1809 
1810 template <class Archive>
1811 inline
1812 void
1813 SparsityPattern::save (Archive &ar, const unsigned int) const
1814 {
1815  // forward to serialization function in the base class.
1816  ar &static_cast<const Subscriptor &>(*this);
1817 
1818  ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed &store_diagonal_first_in_row;
1819 
1820  ar &boost::serialization::make_array(rowstart, max_dim + 1);
1821  ar &boost::serialization::make_array(colnums, max_vec_len);
1822 }
1823 
1824 
1825 
1826 template <class Archive>
1827 inline
1828 void
1829 SparsityPattern::load (Archive &ar, const unsigned int)
1830 {
1831  // forward to serialization function in the base class.
1832  ar &static_cast<Subscriptor &>(*this);
1833 
1834  ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed &store_diagonal_first_in_row;
1835 
1836  rowstart = new std::size_t [max_dim + 1];
1837  colnums = new size_type [max_vec_len];
1838 
1839  ar &boost::serialization::make_array(rowstart, max_dim + 1);
1840  ar &boost::serialization::make_array(colnums, max_vec_len);
1841 }
1842 
1843 
1844 
1845 inline
1846 bool
1848 {
1849  // it isn't quite necessary to compare *all* member variables. by only
1850  // comparing the essential ones, we can say that two sparsity patterns are
1851  // equal even if one is compressed and the other is not (in which case some
1852  // of the member variables are not yet set correctly)
1853  if (rows != sp2.rows ||
1854  cols != sp2.cols ||
1855  compressed != sp2.compressed ||
1856  store_diagonal_first_in_row != sp2.store_diagonal_first_in_row)
1857  return false;
1858 
1859  for (size_type i = 0; i < rows+1; ++i)
1860  if (rowstart[i] != sp2.rowstart[i])
1861  return false;
1862 
1863  for (size_type i = 0; i < rowstart[rows]; ++i)
1864  if (colnums[i] != sp2.colnums[i])
1865  return false;
1866 
1867  return true;
1868 }
1869 
1870 
1871 
1872 namespace internal
1873 {
1874  namespace SparsityPatternTools
1875  {
1879  typedef types::global_dof_index size_type;
1880 
1881  inline
1882  size_type
1883  get_column_index_from_iterator (const size_type i)
1884  {
1885  return i;
1886  }
1887 
1888 
1889 
1890  template <typename value>
1891  inline
1892  size_type
1893  get_column_index_from_iterator (const std::pair<size_type, value> &i)
1894  {
1895  return i.first;
1896  }
1897 
1898 
1899 
1900  template <typename value>
1901  inline
1902  size_type
1903  get_column_index_from_iterator (const std::pair<const size_type, value> &i)
1904  {
1905  return i.first;
1906  }
1907  }
1908 }
1909 
1910 
1911 
1912 template <typename ForwardIterator>
1913 void
1914 SparsityPattern::copy_from (const size_type n_rows,
1915  const size_type n_cols,
1916  const ForwardIterator begin,
1917  const ForwardIterator end,
1918  const bool)
1919 {
1920  copy_from (n_rows, n_cols, begin, end);
1921 }
1922 
1923 
1924 
1925 template <typename ForwardIterator>
1926 void
1927 SparsityPattern::copy_from (const size_type n_rows,
1928  const size_type n_cols,
1929  const ForwardIterator begin,
1930  const ForwardIterator end)
1931 {
1932  Assert (static_cast<size_type>(std::distance (begin, end)) == n_rows,
1933  ExcIteratorRange (std::distance (begin, end), n_rows));
1934 
1935  // first determine row lengths for each row. if the matrix is quadratic,
1936  // then we might have to add an additional entry for the diagonal, if that
1937  // is not yet present. as we have to call compress anyway later on, don't
1938  // bother to check whether that diagonal entry is in a certain row or not
1939  const bool is_square = (n_rows == n_cols);
1940  std::vector<unsigned int> row_lengths;
1941  row_lengths.reserve(n_rows);
1942  for (ForwardIterator i=begin; i!=end; ++i)
1943  row_lengths.push_back (std::distance (i->begin(), i->end())
1944  +
1945  (is_square ? 1 : 0));
1946  reinit (n_rows, n_cols, row_lengths);
1947 
1948  // now enter all the elements into the matrix. note that if the matrix is
1949  // quadratic, then we already have the diagonal element preallocated
1950  //
1951  // for use in the inner loop, we define a typedef to the type of the inner
1952  // iterators
1953  size_type row = 0;
1954  typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
1955  for (ForwardIterator i=begin; i!=end; ++i, ++row)
1956  {
1957  size_type *cols = &colnums[rowstart[row]] + (is_square ? 1 : 0);
1958  const inner_iterator end_of_row = i->end();
1959  for (inner_iterator j=i->begin(); j!=end_of_row; ++j)
1960  {
1961  const size_type col
1962  = internal::SparsityPatternTools::get_column_index_from_iterator(*j);
1963  Assert (col < n_cols, ExcIndexRange(col,0,n_cols));
1964 
1965  if ((col!=row) || !is_square)
1966  *cols++ = col;
1967  }
1968  }
1969 
1970  // finally compress everything. this also sorts the entries within each row
1971  compress ();
1972 }
1973 
1974 
1975 #endif // DOXYGEN
1976 
1977 DEAL_II_NAMESPACE_CLOSE
1978 
1979 #endif
const types::global_dof_index invalid_size_type
Definition: types.h:211
SparsityPatternIterators::Iterator iterator
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:525
Iterator(const ChunkSparsityPattern *sp, const unsigned int row)
const size_type * row_iterator
types::global_dof_index size_type
void save(Archive &ar, const unsigned int version) const
iterator begin() const
bool operator==(const Accessor &) const
const size_type * get_column_numbers() const DEAL_II_DEPRECATED
STL namespace.
size_type n_nonzero_elements() const
const Accessor * operator->() const
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:515
unsigned int global_dof_index
Definition: types.h:100
#define Assert(cond, exc)
Definition: exceptions.h:299
::ExceptionBase & ExcEmptyObject()
bool operator<(const Accessor &) const
size_type n_cols() const
#define DeclException0(Exception0)
Definition: exceptions.h:505
unsigned int row_length(const size_type row) const
size_type column_number(const size_type row, const unsigned int index) const
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
::ExceptionBase & ExcInvalidConstructorCall()
bool stores_only_added_elements() const
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
iterator end() const
void load(Archive &ar, const unsigned int version)
bool operator<(const Iterator &) const
SparsityPatternIterators::Iterator const_iterator
row_iterator row_begin(const size_type r) const DEAL_II_DEPRECATED
std::size_t * rowstart
Accessor(const ChunkSparsityPattern *matrix, const unsigned int row)
::ExceptionBase & ExcIteratorPastEnd()
void copy_from(const size_type n_rows, const size_type n_cols, const ForwardIterator begin, const ForwardIterator end, const bool optimize_diagonal) DEAL_II_DEPRECATED
types::global_dof_index size_type
bool operator==(const Iterator &) const
const SparsityPattern * sparsity_pattern
size_type n_rows() const
bool operator==(const SparsityPattern &) const
::ExceptionBase & ExcInvalidIterator()
bool operator!=(const Iterator &) const
row_iterator row_end(const size_type r) const DEAL_II_DEPRECATED
const std::size_t * get_rowstart_indices() const DEAL_II_DEPRECATED
::ExceptionBase & ExcInternalError()
bool is_compressed() const
const Accessor & operator*() const
bool optimize_diagonal() const DEAL_II_DEPRECATED
static const size_type invalid_entry