kronecker-methods           package:Matrix           R Documentation

_M_e_t_h_o_d_s _f_o_r _F_u_n_c_t_i_o_n '_k_r_o_n_e_c_k_e_r()' _i_n _P_a_c_k_a_g_e '_M_a_t_r_i_x'

_D_e_s_c_r_i_p_t_i_o_n:

     Computes Kronecker products for objects inheriting from
     '"Matrix"'.

     In order to preserver sparseness, we treat '0 * NA' as '0', not as
     'NA' as usually in R (and as used for the 'base' function
     'kronecker').

_M_e_t_h_o_d_s:



     _k_r_o_n_e_c_k_e_r 'signature(X = "Matrix", Y = "ANY")' .......

     _k_r_o_n_e_c_k_e_r 'signature(X = "ANY", Y = "Matrix")' .......

     _k_r_o_n_e_c_k_e_r 'signature(X = "diagonalMatrix", Y = "ANY")' .......

     _k_r_o_n_e_c_k_e_r 'signature(X = "sparseMatrix", Y = "ANY")' .......

     _k_r_o_n_e_c_k_e_r 'signature(X = "TsparseMatrix", Y = "TsparseMatrix")'
          .......

     _k_r_o_n_e_c_k_e_r 'signature(X = "dgTMatrix", Y = "dgTMatrix")' .......

     _k_r_o_n_e_c_k_e_r 'signature(X = "dtTMatrix", Y = "dtTMatrix")' .......


_E_x_a_m_p_l_e_s:

     (t1 <- spMatrix(5,4, x= c(3,2,-7,11), i= 1:4, j=4:1)) #  5 x  4
     (t2 <- kronecker(Diagonal(3, 2:4), t1))               # 15 x 12

     ## should also work with special-cased logical matrices
     l3 <- upper.tri(matrix(,3,3))
     M <- Matrix(l3)
     (N <- as(M, "nsparseMatrix"))
     N2 <- as(N, "generalMatrix")
     MM <- kronecker(M,M)
     NN <- kronecker(N,N)
     NN2 <- kronecker(N2,N2)
     stopifnot(identical(NN,MM),
               is(NN, "triangularMatrix"))

