deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
full_matrix.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1999 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_full_matrix_h
14#define dealii_full_matrix_h
15
16
17#include <deal.II/base/config.h>
18
20#include <deal.II/base/table.h>
21#include <deal.II/base/tensor.h>
22
26
27#include <cstring>
28#include <iomanip>
29#include <vector>
30
32
33
34// forward declarations
35#ifndef DOXYGEN
36template <typename number>
37class Vector;
38template <typename number>
40#endif
41
75template <typename number>
76class FullMatrix : public Table<2, number>
77{
78public:
86 static_assert(
87 std::is_arithmetic_v<typename numbers::NumberTraits<number>::real_type>,
88 "The FullMatrix class only supports basic numeric types. In particular, it "
89 "does not support automatically differentiated numbers.");
90
91
95 using size_type = std::size_t;
96
101 using value_type = number;
102
107
112
116 using Table<2, number>::begin;
117
121 using Table<2, number>::end;
122
133
148 explicit FullMatrix(const size_type n = 0);
149
153 FullMatrix(const size_type rows, const size_type cols);
154
159 FullMatrix(const size_type rows, const size_type cols, const number *entries);
160
182 template <typename number2>
185
194 operator=(const number d);
195
206
211 template <typename number2>
214
215
221 template <typename MatrixType>
222 void
223 copy_from(const MatrixType &);
224
230 template <typename MatrixType>
231 void
232 copy_transposed(const MatrixType &);
233
241 template <int dim>
242 void
244 const unsigned int src_r_i = 0,
245 const unsigned int src_r_j = dim - 1,
246 const unsigned int src_c_i = 0,
247 const unsigned int src_c_j = dim - 1,
248 const size_type dst_r = 0,
249 const size_type dst_c = 0);
250
258 template <int dim>
259 void
261 const size_type src_r_i = 0,
262 const size_type src_r_j = dim - 1,
263 const size_type src_c_i = 0,
264 const size_type src_c_j = dim - 1,
265 const unsigned int dst_r = 0,
266 const unsigned int dst_c = 0) const;
267
280 template <typename MatrixType, typename index_type>
281 void
282 extract_submatrix_from(const MatrixType &matrix,
283 const std::vector<index_type> &row_index_set,
284 const std::vector<index_type> &column_index_set);
285
298 template <typename MatrixType, typename index_type>
299 void
300 scatter_matrix_to(const std::vector<index_type> &row_index_set,
301 const std::vector<index_type> &column_index_set,
302 MatrixType &matrix) const;
303
314 template <typename number2>
315 void
317 const size_type dst_offset_i = 0,
318 const size_type dst_offset_j = 0,
319 const size_type src_offset_i = 0,
320 const size_type src_offset_j = 0);
321
322
326 template <typename number2>
327 void
328 fill(const number2 *);
329
341 template <typename number2>
342 void
344 const std::vector<size_type> &p_rows,
345 const std::vector<size_type> &p_cols);
346
357 void
358 set(const size_type i, const size_type j, const number value);
372 bool
374
380 m() const;
381
387 n() const;
388
394 bool
395 all_zero() const;
396
412 template <typename number2>
413 number2
415
425 template <typename number2>
426 number2
428 const Vector<number2> &v) const;
429
435 l1_norm() const;
436
442 linfty_norm() const;
443
453
464
470 number
471 determinant() const;
472
478 number
479 trace() const;
480
487 template <typename StreamType>
488 void
489 print(StreamType &s,
490 const unsigned int width = 5,
491 const unsigned int precision = 2) const;
492
519 void
520 print_formatted(std::ostream &out,
521 const unsigned int precision = 3,
522 const bool scientific = true,
523 const unsigned int width = 0,
524 const char *zero_string = " ",
525 const double denominator = 1.,
526 const double threshold = 0.,
527 const char *separator = " ") const;
528
533 std::size_t
535
546 begin(const size_type r);
547
552 end(const size_type r);
553
558 begin(const size_type r) const;
559
564 end(const size_type r) const;
565
575 FullMatrix &
576 operator*=(const number factor);
577
581 FullMatrix &
582 operator/=(const number factor);
583
591 template <typename number2>
592 void
593 add(const number a, const FullMatrix<number2> &A);
594
602 template <typename number2>
603 void
604 add(const number a,
605 const FullMatrix<number2> &A,
606 const number b,
607 const FullMatrix<number2> &B);
608
617 template <typename number2>
618 void
619 add(const number a,
620 const FullMatrix<number2> &A,
621 const number b,
622 const FullMatrix<number2> &B,
623 const number c,
624 const FullMatrix<number2> &C);
625
637 template <typename number2>
638 void
640 const number factor,
641 const size_type dst_offset_i = 0,
642 const size_type dst_offset_j = 0,
643 const size_type src_offset_i = 0,
644 const size_type src_offset_j = 0);
645
651 template <typename number2>
652 void
653 Tadd(const number s, const FullMatrix<number2> &B);
654
666 template <typename number2>
667 void
669 const number factor,
670 const size_type dst_offset_i = 0,
671 const size_type dst_offset_j = 0,
672 const size_type src_offset_i = 0,
673 const size_type src_offset_j = 0);
674
678 void
679 add(const size_type row, const size_type column, const number value);
680
690 template <typename number2, typename index_type>
691 void
692 add(const size_type row,
693 const size_type n_cols,
694 const index_type *col_indices,
695 const number2 *values,
696 const bool elide_zero_values = true,
697 const bool col_indices_are_sorted = false);
698
702 void
703 add_row(const size_type i, const number s, const size_type j);
704
709 void
711 const number s,
712 const size_type j,
713 const number t,
714 const size_type k);
715
719 void
720 add_col(const size_type i, const number s, const size_type j);
721
726 void
728 const number s,
729 const size_type j,
730 const number t,
731 const size_type k);
732
736 void
737 swap_row(const size_type i, const size_type j);
738
742 void
743 swap_col(const size_type i, const size_type j);
744
757 void
758 permute(const std::vector<unsigned int> &row_perm,
759 const std::vector<unsigned int> &col_perm);
760
765 void
766 diagadd(const number s);
767
771 template <typename number2>
772 void
773 equ(const number a, const FullMatrix<number2> &A);
774
778 template <typename number2>
779 void
780 equ(const number a,
781 const FullMatrix<number2> &A,
782 const number b,
783 const FullMatrix<number2> &B);
784
788 template <typename number2>
789 void
790 equ(const number a,
791 const FullMatrix<number2> &A,
792 const number b,
793 const FullMatrix<number2> &B,
794 const number c,
795 const FullMatrix<number2> &C);
796
803 void
805
820 void
822
829 template <typename number2>
830 void
832
841 template <typename number2>
842 void
844
849 template <typename number2>
850 void
852
858 template <typename number2>
859 void
861
867 template <typename number2>
868 void
870
895 template <typename number2>
896 void
898 const FullMatrix<number2> &B,
899 const bool adding = false) const;
900
919 template <typename number2>
920 void
922 const FullMatrix<number2> &B,
923 const bool adding = false) const;
924
943 template <typename number2>
944 void
946 const FullMatrix<number2> &B,
947 const bool adding = false) const;
948
968 template <typename number2>
969 void
971 const FullMatrix<number2> &B,
972 const bool adding = false) const;
973
984 void
986 const FullMatrix<number> &B,
987 const FullMatrix<number> &D,
988 const bool transpose_B = false,
989 const bool transpose_D = false,
990 const number scaling = number(1.));
991
992
1017 void
1019 const FullMatrix<number> &B,
1020 const bool adding);
1021
1022
1042 template <typename... Rest>
1043 void
1045 const FullMatrix<number> &B,
1046 const Rest &...rest);
1047
1048
1061 template <typename number2>
1062 void
1064 const Vector<number2> &v,
1065 const bool adding = false) const;
1066
1072 template <typename number2>
1073 void
1075
1089 template <typename number2>
1090 void
1092 const Vector<number2> &v,
1093 const bool adding = false) const;
1094
1101 template <typename number2>
1102 void
1104
1110 template <typename somenumber>
1111 void
1113 const Vector<somenumber> &src,
1114 const number omega = 1.) const;
1115
1122 template <typename number2, typename number3>
1123 number
1125 const Vector<number2> &x,
1126 const Vector<number3> &b) const;
1127
1138 template <typename number2>
1139 void
1140 forward(Vector<number2> &dst, const Vector<number2> &src) const;
1141
1149 template <typename number2>
1150 void
1152
1157
1169
1175 number,
1176 << "The maximal pivot is " << arg1
1177 << ", which is below the threshold. The matrix may be singular.");
1182 size_type,
1183 size_type,
1184 size_type,
1185 << "Target region not in matrix: size in this direction="
1186 << arg1 << ", size of new matrix=" << arg2
1187 << ", offset=" << arg3);
1192 "You are attempting an operation on two vectors that "
1193 "are the same object, but the operation requires that the "
1194 "two objects are in fact different.");
1200};
1201
1204#ifndef DOXYGEN
1205/*-------------------------Inline functions -------------------------------*/
1206
1207
1208
1209template <typename number>
1210inline typename FullMatrix<number>::size_type
1212{
1213 return this->n_rows();
1214}
1215
1216
1217
1218template <typename number>
1219inline typename FullMatrix<number>::size_type
1221{
1222 return this->n_cols();
1223}
1224
1225
1226
1227template <typename number>
1229FullMatrix<number>::operator=(const number d)
1230{
1232
1233 if (this->n_elements() != 0)
1234 this->reset_values();
1235
1236 return *this;
1237}
1238
1239
1240
1241template <typename number>
1242template <typename number2>
1243inline void
1244FullMatrix<number>::fill(const number2 *src)
1245{
1247}
1248
1249
1250
1251template <typename number>
1252template <typename MatrixType>
1253void
1254FullMatrix<number>::copy_from(const MatrixType &M)
1255{
1256 this->reinit(M.m(), M.n());
1257
1258 // loop over the elements of the argument matrix row by row, as suggested
1259 // in the documentation of the sparse matrix iterator class, and
1260 // copy them into the current object
1261 for (size_type row = 0; row < M.m(); ++row)
1262 {
1263 const typename MatrixType::const_iterator end_row = M.end(row);
1264 for (typename MatrixType::const_iterator entry = M.begin(row);
1265 entry != end_row;
1266 ++entry)
1267 this->el(row, entry->column()) = entry->value();
1268 }
1269}
1270
1271
1272
1273template <typename number>
1274template <int dim>
1275void
1277 const unsigned int src_r_i,
1278 const unsigned int src_r_j,
1279 const unsigned int src_c_i,
1280 const unsigned int src_c_j,
1281 const size_type dst_r,
1282 const size_type dst_c)
1283{
1284 Assert(!this->empty(), ExcEmptyMatrix());
1285 AssertIndexRange(src_r_j - src_r_i, this->m() - dst_r);
1286 AssertIndexRange(src_c_j - src_c_i, this->n() - dst_c);
1287 AssertIndexRange(src_r_j, dim);
1288 AssertIndexRange(src_c_j, dim);
1289 AssertIndexRange(src_r_i, src_r_j + 1);
1290 AssertIndexRange(src_c_i, src_c_j + 1);
1291
1292 for (size_type i = 0; i < src_r_j - src_r_i + 1; ++i)
1293 for (size_type j = 0; j < src_c_j - src_c_i + 1; ++j)
1294 {
1295 const unsigned int src_r_index = static_cast<unsigned int>(i + src_r_i);
1296 const unsigned int src_c_index = static_cast<unsigned int>(j + src_c_i);
1297 (*this)(i + dst_r, j + dst_c) = number(T[src_r_index][src_c_index]);
1298 }
1299}
1300
1301
1302
1303template <typename number>
1304template <int dim>
1305void
1307 const size_type src_r_i,
1308 const size_type src_r_j,
1309 const size_type src_c_i,
1310 const size_type src_c_j,
1311 const unsigned int dst_r,
1312 const unsigned int dst_c) const
1313{
1314 Assert(!this->empty(), ExcEmptyMatrix());
1315 AssertIndexRange(src_r_j - src_r_i, dim - dst_r);
1316 AssertIndexRange(src_c_j - src_c_i, dim - dst_c);
1317 AssertIndexRange(src_r_j, this->m());
1318 AssertIndexRange(src_r_j, this->n());
1319 AssertIndexRange(src_r_i, src_r_j + 1);
1320 AssertIndexRange(src_c_j, src_c_j + 1);
1321
1322 for (size_type i = 0; i < src_r_j - src_r_i + 1; ++i)
1323 for (size_type j = 0; j < src_c_j - src_c_i + 1; ++j)
1324 {
1325 const unsigned int dst_r_index = static_cast<unsigned int>(i + dst_r);
1326 const unsigned int dst_c_index = static_cast<unsigned int>(j + dst_c);
1327 T[dst_r_index][dst_c_index] = double((*this)(i + src_r_i, j + src_c_i));
1328 }
1329}
1330
1331
1332
1333template <typename number>
1334template <typename MatrixType>
1335void
1336FullMatrix<number>::copy_transposed(const MatrixType &M)
1337{
1338 this->reinit(M.n(), M.m());
1339
1340 // loop over the elements of the argument matrix row by row, as suggested
1341 // in the documentation of the sparse matrix iterator class, and
1342 // copy them into the current object
1343 for (size_type row = 0; row < M.m(); ++row)
1344 {
1345 const typename MatrixType::const_iterator end_row = M.end(row);
1346 for (typename MatrixType::const_iterator entry = M.begin(row);
1347 entry != end_row;
1348 ++entry)
1349 this->el(entry->column(), row) = entry->value();
1350 }
1351}
1352
1353
1354
1355template <typename number>
1356template <typename MatrixType, typename index_type>
1357inline void
1359 const MatrixType &matrix,
1360 const std::vector<index_type> &row_index_set,
1361 const std::vector<index_type> &column_index_set)
1362{
1363 AssertDimension(row_index_set.size(), this->n_rows());
1364 AssertDimension(column_index_set.size(), this->n_cols());
1365
1366 const size_type n_rows_submatrix = row_index_set.size();
1367 const size_type n_cols_submatrix = column_index_set.size();
1368
1369 for (size_type sub_row = 0; sub_row < n_rows_submatrix; ++sub_row)
1370 for (size_type sub_col = 0; sub_col < n_cols_submatrix; ++sub_col)
1371 (*this)(sub_row, sub_col) =
1372 matrix.el(row_index_set[sub_row], column_index_set[sub_col]);
1373}
1374
1375
1376
1377template <typename number>
1378template <typename MatrixType, typename index_type>
1379inline void
1381 const std::vector<index_type> &row_index_set,
1382 const std::vector<index_type> &column_index_set,
1383 MatrixType &matrix) const
1384{
1385 AssertDimension(row_index_set.size(), this->n_rows());
1386 AssertDimension(column_index_set.size(), this->n_cols());
1387
1388 const size_type n_rows_submatrix = row_index_set.size();
1389 const size_type n_cols_submatrix = column_index_set.size();
1390
1391 for (size_type sub_row = 0; sub_row < n_rows_submatrix; ++sub_row)
1392 for (size_type sub_col = 0; sub_col < n_cols_submatrix; ++sub_col)
1393 matrix.set(row_index_set[sub_row],
1394 column_index_set[sub_col],
1395 (*this)(sub_row, sub_col));
1396}
1397
1398
1399template <typename number>
1400inline void
1401FullMatrix<number>::set(const size_type i,
1402 const size_type j,
1403 const number value)
1404{
1405 (*this)(i, j) = value;
1406}
1407
1408
1409
1410template <typename number>
1411template <typename number2>
1412void
1414 const Vector<number2> &v) const
1415{
1416 vmult(w, v, true);
1417}
1418
1419
1420template <typename number>
1421template <typename number2>
1422void
1424 const Vector<number2> &v) const
1425{
1426 Tvmult(w, v, true);
1427}
1428
1429
1430//---------------------------------------------------------------------------
1431template <typename number>
1432inline typename FullMatrix<number>::iterator
1433FullMatrix<number>::begin(const size_type r)
1434{
1435 AssertIndexRange(r, m());
1436 return iterator(this, r, 0);
1437}
1438
1439
1440
1441template <typename number>
1442inline typename FullMatrix<number>::iterator
1443FullMatrix<number>::end(const size_type r)
1444{
1445 AssertIndexRange(r, m());
1446 return iterator(this, r + 1, 0);
1447}
1448
1449
1450
1451template <typename number>
1453FullMatrix<number>::begin(const size_type r) const
1454{
1455 AssertIndexRange(r, m());
1456 return const_iterator(this, r, 0);
1457}
1458
1459
1460
1461template <typename number>
1463FullMatrix<number>::end(const size_type r) const
1464{
1465 AssertIndexRange(r, m());
1466 return const_iterator(this, r + 1, 0);
1467}
1468
1469
1470
1471template <typename number>
1472inline void
1473FullMatrix<number>::add(const size_type r, const size_type c, const number v)
1474{
1475 AssertIndexRange(r, this->m());
1476 AssertIndexRange(c, this->n());
1477
1478 this->operator()(r, c) += v;
1479}
1480
1481
1482
1483template <typename number>
1484template <typename number2, typename index_type>
1485inline void
1486FullMatrix<number>::add(const size_type row,
1487 const size_type n_cols,
1488 const index_type *col_indices,
1489 const number2 *values,
1490 const bool,
1491 const bool)
1492{
1493 AssertIndexRange(row, this->m());
1494 for (size_type col = 0; col < n_cols; ++col)
1495 {
1496 AssertIndexRange(col_indices[col], this->n());
1497 this->operator()(row, col_indices[col]) += values[col];
1498 }
1499}
1500
1501
1502template <typename number>
1503template <typename StreamType>
1504inline void
1505FullMatrix<number>::print(StreamType &s,
1506 const unsigned int w,
1507 const unsigned int p) const
1508{
1509 Assert(!this->empty(), ExcEmptyMatrix());
1510
1511 // save the state of out stream
1512 const std::streamsize old_precision = s.precision(p);
1513 const std::streamsize old_width = s.width(w);
1514
1515 for (size_type i = 0; i < this->m(); ++i)
1516 {
1517 for (size_type j = 0; j < this->n(); ++j)
1518 {
1519 s.width(w);
1520 s.precision(p);
1521 s << this->el(i, j);
1522 }
1523 s << std::endl;
1524 }
1525
1526 // reset output format
1527 s.precision(old_precision);
1528 s.width(old_width);
1529}
1530
1531
1532template <typename number>
1533template <typename... Rest>
1534void
1536 const FullMatrix<number> &B,
1537 const Rest &...rest)
1538{
1539 this->kronecker_product(A, B, false); // tmp := A ⊗ B
1540
1541 static_assert(
1542 (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Rest>>,
1544 ...),
1545 "kronecker_product: all variadic arguments must be ::FullMatrix<number>");
1546
1547 if constexpr (sizeof...(rest) != 0)
1548 {
1549 // copy the current object into tmp and proceed with the next factor
1550 FullMatrix<number> tmp = *this;
1551 this->kronecker_product(tmp, rest...);
1552 }
1553}
1554
1555
1556
1557#endif // DOXYGEN
1558
1560
1561#endif
*  iterator end()
*  *  iterator begin()
*  *  Point< dim > operator()(const Point< dim > &p) const * 
*  *  const_iterator()=default
*  *  iterator()=default
typename numbers::NumberTraits< number >::real_type real_type
typename Table< 2, number >::const_iterator const_iterator
void triple_product(const FullMatrix< number > &A, const FullMatrix< number > &B, const FullMatrix< number > &D, const bool transpose_B=false, const bool transpose_D=false, const number scaling=number(1.))
FullMatrix< number > & operator=(const number d)
void TmTmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
FullMatrix(const size_type rows, const size_type cols)
number residual(Vector< number2 > &dst, const Vector< number2 > &x, const Vector< number3 > &b) const
std::size_t memory_consumption() const
void diagadd(const number s)
void fill_permutation(const FullMatrix< number2 > &src, const std::vector< size_type > &p_rows, const std::vector< size_type > &p_cols)
void add_row(const size_type i, const number s, const size_type j)
void mmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
real_type relative_symmetry_norm2() const
void add(const size_type row, const size_type column, const number value)
void copy_from(const Tensor< 2, dim > &T, const unsigned int src_r_i=0, const unsigned int src_r_j=dim - 1, const unsigned int src_c_i=0, const unsigned int src_c_j=dim - 1, const size_type dst_r=0, const size_type dst_c=0)
void symmetrize()
void equ(const number a, const FullMatrix< number2 > &A, const number b, const FullMatrix< number2 > &B)
number trace() const
void right_invert(const FullMatrix< number2 > &M)
FullMatrix< number > & operator=(const FullMatrix< number2 > &)
FullMatrix & operator/=(const number factor)
std::size_t size_type
Definition full_matrix.h:95
void set(const size_type i, const size_type j, const number value)
size_type n() const
void add_row(const size_type i, const number s, const size_type j, const number t, const size_type k)
FullMatrix< number > & operator=(const IdentityMatrix &id)
void permute(const std::vector< unsigned int > &row_perm, const std::vector< unsigned int > &col_perm)
number value_type
typename Table< 2, number >::iterator iterator
void add(const number a, const FullMatrix< number2 > &A, const number b, const FullMatrix< number2 > &B, const number c, const FullMatrix< number2 > &C)
void Tadd(const number s, const FullMatrix< number2 > &B)
void vmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
bool all_zero() const
void add_col(const size_type i, const number s, const size_type j, const number t, const size_type k)
void scatter_matrix_to(const std::vector< index_type > &row_index_set, const std::vector< index_type > &column_index_set, MatrixType &matrix) const
void swap_row(const size_type i, const size_type j)
void kronecker_product(const FullMatrix< number > &A, const FullMatrix< number > &B, const Rest &...rest)
void add(const FullMatrix< number2 > &src, const number factor, const size_type dst_offset_i=0, const size_type dst_offset_j=0, const size_type src_offset_i=0, const size_type src_offset_j=0)
void copy_to(Tensor< 2, dim > &T, const size_type src_r_i=0, const size_type src_r_j=dim - 1, const size_type src_c_i=0, const size_type src_c_j=dim - 1, const unsigned int dst_r=0, const unsigned int dst_c=0) const
number2 matrix_norm_square(const Vector< number2 > &v) const
void equ(const number a, const FullMatrix< number2 > &A)
const_iterator end(const size_type r) const
FullMatrix(const size_type rows, const size_type cols, const number *entries)
bool operator==(const FullMatrix< number > &) const
void Tvmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
void print_formatted(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const unsigned int width=0, const char *zero_string=" ", const double denominator=1., const double threshold=0., const char *separator=" ") const
void Tmmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
number2 matrix_scalar_product(const Vector< number2 > &u, const Vector< number2 > &v) const
void gauss_jordan()
void add(const size_type row, const size_type n_cols, const index_type *col_indices, const number2 *values, const bool elide_zero_values=true, const bool col_indices_are_sorted=false)
void add_col(const size_type i, const number s, const size_type j)
void precondition_Jacobi(Vector< somenumber > &dst, const Vector< somenumber > &src, const number omega=1.) const
FullMatrix(const IdentityMatrix &id)
void vmult_add(Vector< number2 > &w, const Vector< number2 > &v) const
void invert(const FullMatrix< number2 > &M)
void cholesky(const FullMatrix< number2 > &A)
void fill(const FullMatrix< number2 > &src, const size_type dst_offset_i=0, const size_type dst_offset_j=0, const size_type src_offset_i=0, const size_type src_offset_j=0)
void add(const number a, const FullMatrix< number2 > &A)
number determinant() const
void equ(const number a, const FullMatrix< number2 > &A, const number b, const FullMatrix< number2 > &B, const number c, const FullMatrix< number2 > &C)
void fill(const number2 *)
void copy_transposed(const MatrixType &)
void print(StreamType &s, const unsigned int width=5, const unsigned int precision=2) const
FullMatrix< number > & operator=(const LAPACKFullMatrix< number2 > &)
FullMatrix & operator*=(const number factor)
void Tvmult_add(Vector< number2 > &w, const Vector< number2 > &v) const
void mTmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
void left_invert(const FullMatrix< number2 > &M)
iterator begin(const size_type r)
iterator end(const size_type r)
void add(const number a, const FullMatrix< number2 > &A, const number b, const FullMatrix< number2 > &B)
void outer_product(const Vector< number2 > &V, const Vector< number2 > &W)
real_type frobenius_norm() const
void forward(Vector< number2 > &dst, const Vector< number2 > &src) const
void Tadd(const FullMatrix< number2 > &src, const number factor, const size_type dst_offset_i=0, const size_type dst_offset_j=0, const size_type src_offset_i=0, const size_type src_offset_j=0)
FullMatrix(const size_type n=0)
size_type m() const
void swap_col(const size_type i, const size_type j)
void extract_submatrix_from(const MatrixType &matrix, const std::vector< index_type > &row_index_set, const std::vector< index_type > &column_index_set)
void backward(Vector< number2 > &dst, const Vector< number2 > &src) const
void copy_from(const MatrixType &)
const_iterator begin(const size_type r) const
void kronecker_product(const FullMatrix< number > &A, const FullMatrix< number > &B, const bool adding)
Compute the Kronecker product of two matrices.
real_type l1_norm() const
real_type linfty_norm() const
void compress(VectorOperation::values)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DeclException0(Exception0)
static ::ExceptionBase & ExcEmptyMatrix()
static ::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcNotRegular(number arg1)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcMatrixNotPositiveDefinite()
static ::ExceptionBase & ExcSourceEqualsDestination()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcInvalidDestination(size_type arg1, size_type arg2, size_type arg3)
#define DeclException1(Exception1, type1, outsequence)
@ matrix
Contents is actually a matrix.
constexpr char T
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)