Computes the generalised Kronecker product of two numeric or character arrays.

x %kronecker% y

Arguments

x

numeric or character array.

y

numeric or character array.

Value

array.

References

Guidotti, E. (2020). "calculus: High dimensional numerical and symbolic calculus in R". https://arxiv.org/abs/2101.00086

See also

Other basic arithmetic: %diff%(), %div%(), %dot%(), %inner%(), %outer%(), %prod%(), %sum%()

Examples

### numeric Kronecker product 
c(1,2) %kronecker% c(2,3)
#> [1] 2 3 4 6

### symbolic Kronecker product 
array(1:4, dim = c(2,2)) %kronecker% c("a","b")
#>      [,1]      [,2]     
#> [1,] "1 * (a)" "3 * (a)"
#> [2,] "1 * (b)" "3 * (b)"
#> [3,] "2 * (a)" "4 * (a)"
#> [4,] "2 * (b)" "4 * (b)"