

   KKrroonneecckkeerr PPrroodduucctt ooff AArrrraayyss

        kronecker(X, Y, FUN="*", ...)
        X %x% Y

   AArrgguummeennttss::

          X: vector or array.

          Y: vector or array.

        FUN: a function, possibly specified as character
             (string).

        ...: optional arguments to be passed to `FUN'.

   DDeessccrriippttiioonn::

        Computes the generalised kronecker product of two
        arrays, `X' and `Y'.  `kronecker(X, Y)' returns an
        array `A' with dimensions `dim(X) * dim(Y)'.

   DDeettaaiillss::

        If `X' and `Y' do not have the same number of dimen-
        sions, the smaller array is padded with dimensions of
        size one.  `A' consists of submatrices constructed by
        taking `X' one term at a time and expanding that term
        as `FUN(x, Y, ...)'.

        `%x%' is an `.Alias' for `kronecker' (where `FUN' is
        hardwired to `"*"').

   AAuutthhoorr((ss))::

        Jonathan Rougier

   RReeffeerreenncceess::

        Shayle R. Searle (1982).  Matrix Algebra Useful for
        Statistics; John Wiley and Sons.

   SSeeee AAllssoo::

        `outer' on which `kronecker' is built and `matmult' for
        usual matrix multiplication.

   EExxaammpplleess::

        # simple scalar multiplication
        ( M <- matrix(1:6, ncol=2) )
        all(kronecker(4, M)==4 * M)

        ( A <- matrix(0:3, ncol=2) )
        A %x% cbind(2:3)
        # Block diagonal array:
        kronecker(diag(3), M)
        all(kronecker(diag(3), M) == diag(3) %x% M)

