kprod: Iterated Kronecker product

View source: R/kprod.R

kprodR Documentation

Iterated Kronecker product

Description

Compute the Kronecker product of several matrices.

Usage

kprod(..., FUN = `*`)

Arguments

...

A listing of matrices

FUN

A function to pass to base::kronecker()

Details

If kronecker is the function that computes A x B, kprod computes A x B x C and so on; it's a wrapper of Reduce and kronecker.

Value

A matrix that is the kronecker product of the specified matrices (from left to right).

Examples


kprod(diag(2), t(ones(2)))
kprod(t(ones(2)), diag(2))


kprod(diag(2), t(ones(2)), t(ones(2)))
kprod(t(ones(2)), diag(2), t(ones(2)))
kprod(t(ones(2)), t(ones(2)), diag(2))


# cf. aoki, hara, and takemura p.13
rbind(
  kprod(diag(2), t(ones(2))),
  kprod(t(ones(2)), diag(2))
) 



latte documentation built on June 9, 2025, 9:08 a.m.

Related to kprod in latte...