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"))