16 #ifndef dealii__block_matrix_base_h 17 #define dealii__block_matrix_base_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/table.h> 22 #include <deal.II/base/thread_management.h> 23 #include <deal.II/base/utilities.h> 24 #include <deal.II/base/smartpointer.h> 25 #include <deal.II/base/memory_consumption.h> 26 #include <deal.II/lac/block_indices.h> 27 #include <deal.II/lac/exceptions.h> 28 #include <deal.II/lac/full_matrix.h> 29 #include <deal.II/lac/matrix_iterator.h> 30 #include <deal.II/lac/vector.h> 34 DEAL_II_NAMESPACE_OPEN
56 template <
class BlockMatrixType>
108 template <
class BlockMatrixType,
bool Constness>
115 template <
class BlockMatrixType>
146 const size_type col);
151 size_type row()
const;
156 size_type column()
const;
161 value_type value()
const;
166 void set_value(value_type newval)
const;
187 bool operator == (
const Accessor &a)
const;
190 friend class Accessor<BlockMatrixType, true>;
197 template <
class BlockMatrixType>
228 const size_type col);
238 size_type row()
const;
243 size_type column()
const;
248 value_type value()
const;
268 bool operator == (
const Accessor &a)
const;
274 friend class ::MatrixIterator;
340 template <
typename MatrixType>
354 typedef value_type *pointer;
355 typedef const value_type *const_pointer;
356 typedef value_type &reference;
357 typedef const value_type &const_reference;
395 template <
class BlockMatrixType>
397 copy_from (
const BlockMatrixType &source);
403 block (
const unsigned int row,
404 const unsigned int column);
412 block (
const unsigned int row,
413 const unsigned int column)
const;
419 size_type m ()
const;
425 size_type n ()
const;
432 unsigned int n_block_rows ()
const;
438 unsigned int n_block_cols ()
const;
445 void set (
const size_type i,
447 const value_type value);
464 template <
typename number>
465 void set (
const std::vector<size_type> &indices,
467 const bool elide_zero_values =
false);
474 template <
typename number>
475 void set (
const std::vector<size_type> &row_indices,
476 const std::vector<size_type> &col_indices,
478 const bool elide_zero_values =
false);
490 template <
typename number>
491 void set (
const size_type row,
492 const std::vector<size_type> &col_indices,
493 const std::vector<number> &values,
494 const bool elide_zero_values =
false);
505 template <
typename number>
506 void set (
const size_type row,
507 const size_type n_cols,
508 const size_type *col_indices,
509 const number *values,
510 const bool elide_zero_values =
false);
517 void add (
const size_type i,
519 const value_type value);
535 template <
typename number>
536 void add (
const std::vector<size_type> &indices,
538 const bool elide_zero_values =
true);
545 template <
typename number>
546 void add (
const std::vector<size_type> &row_indices,
547 const std::vector<size_type> &col_indices,
549 const bool elide_zero_values =
true);
560 template <
typename number>
561 void add (
const size_type row,
562 const std::vector<size_type> &col_indices,
563 const std::vector<number> &values,
564 const bool elide_zero_values =
true);
575 template <
typename number>
576 void add (
const size_type row,
577 const size_type n_cols,
578 const size_type *col_indices,
579 const number *values,
580 const bool elide_zero_values =
true,
581 const bool col_indices_are_sorted =
false);
594 void add (
const value_type factor,
603 value_type operator () (
const size_type i,
604 const size_type j)
const;
614 value_type el (
const size_type i,
615 const size_type j)
const;
627 value_type diag_element (
const size_type i)
const;
637 void compress (::VectorOperation::values operation);
653 template <
class BlockVectorType>
654 void vmult_add (BlockVectorType &dst,
655 const BlockVectorType &src)
const;
662 template <
class BlockVectorType>
663 void Tvmult_add (BlockVectorType &dst,
664 const BlockVectorType &src)
const;
678 template <
class BlockVectorType>
680 matrix_norm_square (
const BlockVectorType &v)
const;
685 template <
class BlockVectorType>
687 matrix_scalar_product (
const BlockVectorType &u,
688 const BlockVectorType &v)
const;
693 template <
class BlockVectorType>
694 value_type residual (BlockVectorType &dst,
695 const BlockVectorType &x,
696 const BlockVectorType &b)
const;
704 void print (std::ostream &out,
705 const bool alternative_output =
false)
const;
720 iterator begin (
const size_type r);
725 iterator end (
const size_type r);
729 const_iterator begin ()
const;
734 const_iterator end ()
const;
739 const_iterator begin (
const size_type r)
const;
744 const_iterator end (
const size_type r)
const;
761 std::size_t memory_consumption ()
const;
773 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" 774 << arg3 <<
',' << arg4 <<
"] have differing row numbers.");
780 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" 781 << arg3 <<
',' << arg4 <<
"] have differing column numbers.");
827 void collect_sizes ();
839 template <
class BlockVectorType>
840 void vmult_block_block (BlockVectorType &dst,
841 const BlockVectorType &src)
const;
853 template <
class BlockVectorType,
855 void vmult_block_nonblock (BlockVectorType &dst,
856 const VectorType &src)
const;
868 template <
class BlockVectorType,
870 void vmult_nonblock_block (VectorType &dst,
871 const BlockVectorType &src)
const;
883 template <
class VectorType>
884 void vmult_nonblock_nonblock (VectorType &dst,
885 const VectorType &src)
const;
898 template <
class BlockVectorType>
899 void Tvmult_block_block (BlockVectorType &dst,
900 const BlockVectorType &src)
const;
912 template <
class BlockVectorType,
914 void Tvmult_block_nonblock (BlockVectorType &dst,
915 const VectorType &src)
const;
927 template <
class BlockVectorType,
929 void Tvmult_nonblock_block (VectorType &dst,
930 const BlockVectorType &src)
const;
942 template <
class VectorType>
943 void Tvmult_nonblock_nonblock (VectorType &dst,
944 const VectorType &src)
const;
955 void prepare_add_operation();
961 void prepare_set_operation();
1027 template <
typename,
bool>
1043 template <
class BlockMatrixType>
1052 template <
class BlockMatrixType>
1055 AccessorBase<BlockMatrixType>::block_row()
const 1058 ExcIteratorPastEnd());
1064 template <
class BlockMatrixType>
1067 AccessorBase<BlockMatrixType>::block_column()
const 1070 ExcIteratorPastEnd());
1076 template <
class BlockMatrixType>
1078 Accessor<BlockMatrixType, true>::Accessor (
1079 const BlockMatrixType *matrix,
1080 const size_type row,
1081 const size_type col)
1087 Assert(col==0, ExcNotImplemented());
1091 if (row < matrix->
m())
1093 const std::pair<unsigned int,size_type> indices
1094 = matrix->row_block_indices.global_to_local(row);
1098 for (
unsigned int bc=0; bc<matrix->n_block_cols(); ++bc)
1101 = matrix->block(indices.first, bc).begin(indices.second);
1102 if (base_iterator !=
1103 matrix->block(indices.first, bc).end(indices.second))
1105 this->row_block = indices.first;
1106 this->col_block = bc;
1117 *
this = Accessor (matrix, row+1, 0);
1141 template <
class BlockMatrixType>
1143 Accessor<BlockMatrixType, true>::Accessor (
const Accessor<BlockMatrixType, false> &other)
1145 matrix(other.matrix),
1146 base_iterator(other.base_iterator)
1148 this->row_block = other.row_block;
1149 this->col_block = other.col_block;
1153 template <
class BlockMatrixType>
1155 typename Accessor<BlockMatrixType, true>::size_type
1156 Accessor<BlockMatrixType, true>::row()
const 1159 ExcIteratorPastEnd());
1161 return (matrix->row_block_indices.local_to_global(this->row_block, 0) +
1162 base_iterator->row());
1166 template <
class BlockMatrixType>
1168 typename Accessor<BlockMatrixType, true>::size_type
1169 Accessor<BlockMatrixType, true>::column()
const 1172 ExcIteratorPastEnd());
1174 return (matrix->column_block_indices.local_to_global(this->col_block,0) +
1175 base_iterator->column());
1179 template <
class BlockMatrixType>
1181 typename Accessor<BlockMatrixType, true>::value_type
1182 Accessor<BlockMatrixType, true>::value ()
const 1185 ExcIteratorPastEnd());
1187 ExcIteratorPastEnd());
1189 return base_iterator->value();
1194 template <
class BlockMatrixType>
1197 Accessor<BlockMatrixType, true>::advance ()
1200 ExcIteratorPastEnd());
1202 ExcIteratorPastEnd());
1205 size_type local_row = base_iterator->row();
1216 while (base_iterator ==
1217 matrix->block(this->row_block, this->col_block).end(local_row))
1226 = matrix->block(this->row_block, this->col_block).begin(local_row);
1232 this->col_block = 0;
1241 if (local_row == matrix->block(this->row_block, this->col_block).m())
1245 if (this->row_block == matrix->n_block_rows())
1254 = matrix->block(this->row_block, this->col_block).begin(local_row);
1260 template <
class BlockMatrixType>
1263 Accessor<BlockMatrixType, true>::operator == (
const Accessor &a)
const 1265 if (matrix != a.matrix)
1268 if (this->row_block == a.row_block
1269 && this->col_block == a.col_block)
1278 (base_iterator == a.base_iterator));
1286 template <
class BlockMatrixType>
1288 Accessor<BlockMatrixType, false>::Accessor (
1289 BlockMatrixType *matrix,
1290 const size_type row,
1291 const size_type col)
1297 Assert(col==0, ExcNotImplemented());
1300 if (row < matrix->
m())
1302 const std::pair<unsigned int,size_type> indices
1303 = matrix->row_block_indices.global_to_local(row);
1307 for (size_type bc=0; bc<matrix->n_block_cols(); ++bc)
1310 = matrix->block(indices.first, bc).begin(indices.second);
1311 if (base_iterator !=
1312 matrix->block(indices.first, bc).end(indices.second))
1314 this->row_block = indices.first;
1315 this->col_block = bc;
1326 *
this = Accessor (matrix, row+1, 0);
1338 template <
class BlockMatrixType>
1340 typename Accessor<BlockMatrixType, false>::size_type
1341 Accessor<BlockMatrixType, false>::row()
const 1344 ExcIteratorPastEnd());
1346 return (matrix->row_block_indices.local_to_global(this->row_block, 0) +
1347 base_iterator->row());
1351 template <
class BlockMatrixType>
1353 typename Accessor<BlockMatrixType, false>::size_type
1354 Accessor<BlockMatrixType, false>::column()
const 1357 ExcIteratorPastEnd());
1359 return (matrix->column_block_indices.local_to_global(this->col_block,0) +
1360 base_iterator->column());
1364 template <
class BlockMatrixType>
1366 typename Accessor<BlockMatrixType, false>::value_type
1367 Accessor<BlockMatrixType, false>::value ()
const 1370 ExcIteratorPastEnd());
1372 ExcIteratorPastEnd());
1374 return base_iterator->value();
1379 template <
class BlockMatrixType>
1382 Accessor<BlockMatrixType, false>::set_value (
typename Accessor<BlockMatrixType, false>::value_type newval)
const 1385 ExcIteratorPastEnd());
1387 ExcIteratorPastEnd());
1389 base_iterator->value() = newval;
1394 template <
class BlockMatrixType>
1397 Accessor<BlockMatrixType, false>::advance ()
1400 ExcIteratorPastEnd());
1402 ExcIteratorPastEnd());
1405 size_type local_row = base_iterator->row();
1416 while (base_iterator ==
1417 matrix->block(this->row_block, this->col_block).end(local_row))
1426 = matrix->block(this->row_block, this->col_block).begin(local_row);
1432 this->col_block = 0;
1441 if (local_row == matrix->block(this->row_block, this->col_block).m())
1445 if (this->row_block == matrix->n_block_rows())
1454 = matrix->block(this->row_block, this->col_block).begin(local_row);
1461 template <
class BlockMatrixType>
1464 Accessor<BlockMatrixType, false>::operator == (
const Accessor &a)
const 1466 if (matrix != a.matrix)
1469 if (this->row_block == a.row_block
1470 && this->col_block == a.col_block)
1479 (base_iterator == a.base_iterator));
1489 template <
typename MatrixType>
1494 template <
typename MatrixType>
1502 template <
class MatrixType>
1503 template <
class BlockMatrixType>
1507 copy_from (
const BlockMatrixType &source)
1511 block(r,c).copy_from (source.block(r,c));
1517 template <
class MatrixType>
1542 template <
class MatrixType>
1562 template <
class MatrixType>
1566 const unsigned int column)
1578 template <
class MatrixType>
1582 const unsigned int column)
const 1593 template <
class MatrixType>
1595 typename BlockMatrixBase<MatrixType>::size_type
1603 template <
class MatrixType>
1605 typename BlockMatrixBase<MatrixType>::size_type
1613 template <
class MatrixType>
1618 return column_block_indices.
size();
1623 template <
class MatrixType>
1636 template <
class MatrixType>
1647 const std::pair<unsigned int,size_type>
1650 block(row_index.first,col_index.first).set (row_index.second,
1657 template <
class MatrixType>
1658 template <
typename number>
1662 const std::vector<size_type> &col_indices,
1664 const bool elide_zero_values)
1666 Assert (row_indices.size() == values.
m(),
1667 ExcDimensionMismatch(row_indices.size(), values.
m()));
1668 Assert (col_indices.size() == values.
n(),
1669 ExcDimensionMismatch(col_indices.size(), values.
n()));
1671 for (size_type i=0; i<row_indices.size(); ++i)
1672 set (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
1678 template <
class MatrixType>
1679 template <
typename number>
1684 const bool elide_zero_values)
1686 Assert (indices.size() == values.
m(),
1687 ExcDimensionMismatch(indices.size(), values.
m()));
1688 Assert (values.
n() == values.
m(), ExcNotQuadratic());
1690 for (size_type i=0; i<indices.size(); ++i)
1691 set (indices[i], indices.size(), &indices[0], &values(i,0),
1697 template <
class MatrixType>
1698 template <
typename number>
1702 const std::vector<size_type> &col_indices,
1703 const std::vector<number> &values,
1704 const bool elide_zero_values)
1706 Assert (col_indices.size() == values.size(),
1707 ExcDimensionMismatch(col_indices.size(), values.size()));
1709 set (row, col_indices.size(), &col_indices[0], &values[0],
1718 template <
class MatrixType>
1719 template <
typename number>
1723 const size_type n_cols,
1724 const size_type *col_indices,
1725 const number *values,
1726 const bool elide_zero_values)
1775 for (size_type j=0; j<n_cols; ++j)
1777 number value = values[j];
1779 if (value == number() && elide_zero_values ==
true)
1782 const std::pair<unsigned int, size_type>
1783 col_index = this->column_block_indices.
global_to_local(col_indices[j]);
1794 size_type length = 0;
1797 Assert (length <= n_cols, ExcInternalError());
1805 const std::pair<unsigned int,size_type>
1807 for (
unsigned int block_col=0; block_col<
n_block_cols(); ++block_col)
1812 block(row_index.first, block_col).set
1823 template <
class MatrixType>
1838 typedef typename MatrixType::Traits MatrixTraits;
1839 if ((MatrixTraits::zero_addition_can_be_elided ==
true)
1844 const std::pair<unsigned int,size_type>
1847 block(row_index.first,col_index.first).add (row_index.second,
1854 template <
class MatrixType>
1855 template <
typename number>
1859 const std::vector<size_type> &col_indices,
1861 const bool elide_zero_values)
1863 Assert (row_indices.size() == values.
m(),
1864 ExcDimensionMismatch(row_indices.size(), values.
m()));
1865 Assert (col_indices.size() == values.
n(),
1866 ExcDimensionMismatch(col_indices.size(), values.
n()));
1868 for (size_type i=0; i<row_indices.size(); ++i)
1869 add (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
1875 template <
class MatrixType>
1876 template <
typename number>
1881 const bool elide_zero_values)
1883 Assert (indices.size() == values.
m(),
1884 ExcDimensionMismatch(indices.size(), values.
m()));
1885 Assert (values.
n() == values.
m(), ExcNotQuadratic());
1887 for (size_type i=0; i<indices.size(); ++i)
1888 add (indices[i], indices.size(), &indices[0], &values(i,0),
1894 template <
class MatrixType>
1895 template <
typename number>
1899 const std::vector<size_type> &col_indices,
1900 const std::vector<number> &values,
1901 const bool elide_zero_values)
1903 Assert (col_indices.size() == values.size(),
1904 ExcDimensionMismatch(col_indices.size(), values.size()));
1906 add (row, col_indices.size(), &col_indices[0], &values[0],
1915 template <
class MatrixType>
1916 template <
typename number>
1920 const size_type n_cols,
1921 const size_type *col_indices,
1922 const number *values,
1923 const bool elide_zero_values,
1924 const bool col_indices_are_sorted)
1931 if (col_indices_are_sorted ==
true)
1936 size_type before = col_indices[0];
1937 for (size_type i=1; i<n_cols; ++i)
1938 if (col_indices[i] <= before)
1940 "indices appear to not be sorted."))
1942 before = col_indices[i];
1944 const std::pair<unsigned int,size_type>
1953 const size_type n_zero_block_indices = first_block - col_indices;
1954 block(row_index.first, 0).add (row_index.second,
1955 n_zero_block_indices,
1959 col_indices_are_sorted);
1961 if (n_zero_block_indices < n_cols)
1962 this->
add(row, n_cols - n_zero_block_indices, first_block,
1963 values + n_zero_block_indices, elide_zero_values,
1968 block(row_index.first, 0).
add (row_index.second,
1973 col_indices_are_sorted);
2022 for (size_type j=0; j<n_cols; ++j)
2024 number value = values[j];
2026 if (value == number() && elide_zero_values ==
true)
2029 const std::pair<unsigned int, size_type>
2030 col_index = this->column_block_indices.
global_to_local(col_indices[j]);
2041 size_type length = 0;
2044 Assert (length <= n_cols, ExcInternalError());
2052 const std::pair<unsigned int,size_type>
2054 for (
unsigned int block_col=0; block_col<
n_block_cols(); ++block_col)
2059 block(row_index.first, block_col).add
2065 col_indices_are_sorted);
2071 template <
class MatrixType>
2084 typedef typename MatrixType::Traits MatrixTraits;
2085 if ((MatrixTraits::zero_addition_can_be_elided ==
true)
2094 block(row, col).add(factor, matrix.
block(row,col));
2099 template <
class MatrixType>
2103 const size_type j)
const 2105 const std::pair<unsigned int,size_type>
2108 return block(row_index.first,col_index.first) (row_index.second,
2114 template <
class MatrixType>
2118 const size_type j)
const 2120 const std::pair<unsigned int,size_type>
2123 return block(row_index.first,col_index.first).el (row_index.second,
2129 template <
class MatrixType>
2137 const std::pair<unsigned int,size_type>
2139 return block(index.first,index.first).diag_element(index.second);
2144 template <
class MatrixType>
2151 block(r,c).compress (operation);
2156 template <
class MatrixType>
2166 block(r,c) *= factor;
2173 template <
class MatrixType>
2180 Assert (factor !=0, ExcDivideByZero());
2186 block(r,c) *= factor_inv;
2193 template <
class MatrixType>
2202 template <
class MatrixType>
2206 return this->column_block_indices;
2211 template <
class MatrixType>
2212 template <
class BlockVectorType>
2216 const BlockVectorType &src)
const 2225 block(row,0).vmult (dst.block(row),
2228 block(row,col).vmult_add (dst.block(row),
2235 template <
class MatrixType>
2236 template <
class BlockVectorType,
2241 const BlockVectorType &src)
const 2248 block(0,0).vmult (dst, src.block(0));
2250 block(0,col).vmult_add (dst, src.block(col));
2255 template <
class MatrixType>
2256 template <
class BlockVectorType,
2261 const VectorType &src)
const 2269 block(row,0).vmult (dst.block(row),
2275 template <
class MatrixType>
2276 template <
class VectorType>
2280 const VectorType &src)
const 2287 block(0,0).vmult (dst, src);
2292 template <
class MatrixType>
2293 template <
class BlockVectorType>
2296 const BlockVectorType &src)
const 2305 block(row,col).vmult_add (dst.block(row),
2312 template <
class MatrixType>
2313 template <
class BlockVectorType>
2317 const BlockVectorType &src)
const 2329 block(row,col).Tvmult_add (dst.block(col),
2336 template <
class MatrixType>
2337 template <
class BlockVectorType,
2342 const VectorType &src)
const 2352 block(0,col).Tvmult_add (dst.block(col), src);
2357 template <
class MatrixType>
2358 template <
class BlockVectorType,
2363 const BlockVectorType &src)
const 2370 block(0,0).Tvmult (dst, src.block(0));
2373 block(row,0).Tvmult_add (dst, src.block(row));
2378 template <
class MatrixType>
2379 template <
class VectorType>
2383 const VectorType &src)
const 2390 block(0,0).Tvmult (dst, src);
2395 template <
class MatrixType>
2396 template <
class BlockVectorType>
2399 const BlockVectorType &src)
const 2408 block(row,col).Tvmult_add (dst.block(col),
2414 template <
class MatrixType>
2415 template <
class BlockVectorType>
2427 norm_sqr +=
block(row,col).matrix_norm_square (v.block(row));
2429 norm_sqr +=
block(row,col).matrix_scalar_product (v.block(row),
2436 template <
class MatrixType>
2437 template <
class BlockVectorType>
2441 const BlockVectorType &v)
const 2451 result +=
block(row,col).matrix_scalar_product (u.block(row),
2458 template <
class MatrixType>
2459 template <
class BlockVectorType>
2463 const BlockVectorType &x,
2464 const BlockVectorType &b)
const 2488 block(row,0).residual (dst.block(row),
2492 for (size_type i=0; i<dst.block(row).size(); ++i)
2493 dst.block(row)(i) = -dst.block(row)(i);
2496 block(row,col).vmult_add (dst.block(row),
2499 for (size_type i=0; i<dst.block(row).size(); ++i)
2500 dst.block(row)(i) = -dst.block(row)(i);
2505 res += dst.block(row).norm_sqr ();
2506 return std::sqrt(res);
2511 template <
class MatrixType>
2515 const bool alternative_output)
const 2520 if (!alternative_output)
2521 out <<
"Block (" << row <<
", " << col <<
")" << std::endl;
2523 block(row, col).print(out, alternative_output);
2529 template <
class MatrixType>
2539 template <
class MatrixType>
2549 template <
class MatrixType>
2554 Assert (r<
m(), ExcIndexRange(r,0,
m()));
2560 template <
class MatrixType>
2565 Assert (r<
m(), ExcIndexRange(r,0,
m()));
2571 template <
class MatrixType>
2581 template <
class MatrixType>
2591 template <
class MatrixType>
2596 Assert (r<
m(), ExcIndexRange(r,0,
m()));
2602 template <
class MatrixType>
2607 Assert (r<
m(), ExcIndexRange(r,0,
m()));
2613 template <
class MatrixType>
2617 std::vector<size_type> row_sizes (this->
n_block_rows());
2618 std::vector<size_type> col_sizes (this->
n_block_cols());
2630 ExcIncompatibleRowNumbers (r,0,r,c));
2643 ExcIncompatibleRowNumbers (0,c,r,c));
2647 this->column_block_indices.
reinit (col_sizes);
2652 template <
class MatrixType>
2658 block(row, col).prepare_add();
2663 template <
class MatrixType>
2669 block(row, col).prepare_set();
2675 DEAL_II_NAMESPACE_CLOSE
2677 #endif // dealii__block_matrix_base_h BlockMatrixType MatrixType
Iterator lower_bound(Iterator first, Iterator last, const T &val)
const types::global_dof_index invalid_size_type
static const unsigned int invalid_unsigned_int
void vmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
BlockMatrixBase & copy_from(const BlockMatrixType &source)
void Tvmult_add(BlockVectorType &dst, const BlockVectorType &src) const
std::vector< size_type > counter_within_block
std::vector< std::vector< size_type > > column_indices
void set(const size_type i, const size_type j, const value_type value)
value_type operator()(const size_type i, const size_type j) const
::ExceptionBase & ExcMessage(std::string arg1)
Auxiliary class aiding in the handling of block structures like in BlockVector or FESystem...
BlockMatrixType::value_type value_type
void vmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
value_type diag_element(const size_type i) const
void Tvmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
void add(const size_type i, const size_type j, const value_type value)
value_type matrix_norm_square(const BlockVectorType &v) const
void Tvmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
void Tvmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
const BlockMatrixType MatrixType
TemporaryData temporary_data
types::global_dof_index size_type
std::size_t memory_consumption() const
BlockMatrixType::value_type value_type
void vmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
size_type total_size() const
BlockMatrixBase & operator*=(const value_type factor)
const BlockMatrixType * matrix
void print(std::ostream &out, const bool alternative_output=false) const
void vmult_add(BlockVectorType &dst, const BlockVectorType &src) const
void Tvmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
const BlockIndices & get_row_indices() const
std::vector< std::vector< value_type > > column_values
types::global_dof_index size_type
BlockMatrixBase & operator/=(const value_type factor)
unsigned int n_block_cols() const
unsigned int global_dof_index
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
types::global_dof_index size_type
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
void prepare_add_operation()
value_type el(const size_type i, const size_type j) const
const BlockIndices & get_column_indices() const
BlockType::value_type value_type
BlockMatrixType::BlockType::iterator base_iterator
BlockMatrixType::BlockType::const_iterator base_iterator
value_type residual(BlockVectorType &dst, const BlockVectorType &x, const BlockVectorType &b) const
unsigned int block_column() const
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
unsigned int block_row() const
BlockMatrixType::value_type value_type
void vmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
BlockType & block(const unsigned int row, const unsigned int column)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
Table< 2, SmartPointer< BlockType, BlockMatrixBase< MatrixType > > > sub_objects
size_type block_start(const unsigned int i) const
BlockIndices row_block_indices
unsigned int n_block_rows() const
unsigned int size() const
value_type matrix_scalar_product(const BlockVectorType &u, const BlockVectorType &v) const
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
#define AssertIsFinite(number)
void compress(::VectorOperation::values operation)
void prepare_set_operation()