KroneckerProduct module

Classes

class  Eigen::KroneckerProduct< Lhs, Rhs >
 Kronecker tensor product helper class for dense matrices. More...
 
class  Eigen::KroneckerProductBase< Derived >
 The base class of dense and sparse Kronecker product. More...
 
class  Eigen::KroneckerProductSparse< Lhs, Rhs >
 Kronecker tensor product helper class for sparse matrices. More...
 

Functions

template<typename A , typename B >
KroneckerProductSparse< A, BEigen::kroneckerProduct (const EigenBase< A > &a, const EigenBase< B > &b)
 
template<typename A , typename B >
KroneckerProduct< A, BEigen::kroneckerProduct (const MatrixBase< A > &a, const MatrixBase< B > &b)
 

Detailed Description

This module contains an experimental Kronecker product implementation.

Function Documentation

◆ kroneckerProduct() [1/2]

template<typename A , typename B >
KroneckerProductSparse<A,B> Eigen::kroneckerProduct ( const EigenBase< A > &  a,
const EigenBase< B > &  b 
)

Computes Kronecker tensor product of two matrices, at least one of which is sparse

Warning
If you want to replace a matrix by its Kronecker product with some matrix, do NOT do this:
A = kroneckerProduct(A,B); // bug!!! caused by aliasing effect
SparseMatrix< double > A(n, n)
KroneckerProduct< A, B > kroneckerProduct(const MatrixBase< A > &a, const MatrixBase< B > &b)
instead, use eval() to work around this:
A = kroneckerProduct(A,B).eval();
Parameters
aDense/sparse matrix a
bDense/sparse matrix b
Returns
Kronecker tensor product of a and b, stored in a sparse matrix

Definition at line 300 of file KroneckerTensorProduct.h.

301 {
302  return KroneckerProductSparse<A,B>(a.derived(), b.derived());
303 }
ArrayXXi a

◆ kroneckerProduct() [2/2]

template<typename A , typename B >
KroneckerProduct<A,B> Eigen::kroneckerProduct ( const MatrixBase< A > &  a,
const MatrixBase< B > &  b 
)

Computes Kronecker tensor product of two dense matrices

Warning
If you want to replace a matrix by its Kronecker product with some matrix, do NOT do this:
A = kroneckerProduct(A,B); // bug!!! caused by aliasing effect
instead, use eval() to work around this:
A = kroneckerProduct(A,B).eval();
Parameters
aDense matrix a
bDense matrix b
Returns
Kronecker tensor product of a and b

Definition at line 273 of file KroneckerTensorProduct.h.

274 {
275  return KroneckerProduct<A, B>(a.derived(), b.derived());
276 }