template<typename LhsMatrix, typename RhsMatrix>
class Eigen::KroneckerSum< LhsMatrix, RhsMatrix >
The Kronecker sum \( A \oplus B = A \otimes I + I \otimes B \) of two square matrices as an implicit operator that is never materialized.
For A of size n1 and B of size n2 the Kronecker sum is the n1*n2 x n1*n2 matrix whose block (i,j) is A(i,j)*I plus B on the diagonal blocks. It is the matrix of the separable operators that finite-difference and spectral discretizations produce on tensor-product grids: with Dx and Dy the 1-D second-difference matrices tridiag(1, -2, 1)/h^2, the 2-D Laplacian is \( D_y \oplus D_x \), the 3-D one \( D_z \oplus D_y \oplus D_x \), and an implicit Euler step of the heat equation, \( (I - \tau L) u = b \) with \( L = D_y \oplus D_x \), is \( \big((I - \tau D_y) \oplus (-\tau D_x)\big) u = b \), since \( I \otimes I = I \) lets a shift go into either factor.
With \( \mathrm{vec} \) stacking columns as for KroneckerOperator, the product is \( (A \oplus B)\,\mathrm{vec}(X) = \mathrm{vec}(B X + X A^T) \) for X of size n2 x n1: one product with each factor, O(n1 n2 (n1 + n2)) for dense factors and O(n1 nnz(B) + n2 nnz(A)) for sparse ones, with no identity ever formed. The factors may be of any kind KroneckerOperator accepts – dense, diagonal, sparse, Identity() or a KroneckerOperator – or a KroneckerSum itself, which is how sums of three or more factors are built (makeKroneckerSum(a, b, c, ...) nests to the right). A Kronecker sum may in turn be a factor of a KroneckerOperator.
The operator is closed under transpose, conjugate and adjoint ( \( (A \oplus B)^T = A^T \oplus B^T \)), materializes into a dense or a sparse matrix on assignment, and plugs into the matrix-free iterative solvers (with IdentityPreconditioner). solve and the reusable BartelsStewart solver use the Schur forms of the factors; eigenvalues are the pairwise sums \( \lambda_i(A) + \mu_j(B) \), with eigenvectors \( V_A \otimes V_B \), also as a KroneckerOperator factor.
for (int k = 0; k < steps; ++k) u = step.solve(u);
Direct solver for Kronecker-sum systems .
Definition KroneckerSum.h:554
KroneckerSum< typename internal::kron_factor_storage< LhsDerived >::type, typename internal::kron_factor_storage< RhsDerived >::type > makeKroneckerSum(const EigenBase< LhsDerived > &a, const EigenBase< RhsDerived > &b)
Definition KroneckerSum.h:479
- Template Parameters
-
| LhsMatrix | the type of the left factor A, see KroneckerOperator. |
| RhsMatrix | the type of the right factor B, under the same convention; its scalar type must match that of LhsMatrix. |
- See also
- makeKroneckerSum(), class BartelsStewart, class KroneckerOperator