ldiMatrix-class            package:Matrix            R Documentation

_C_l_a_s_s "_l_d_i_M_a_t_r_i_x" _o_f _D_i_a_g_o_n_a_l _L_o_g_i_c_a_l _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The class '"ldiMatrix"' of logical diagonal matrices.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("ldiMatrix",
     ...)' but typically rather via 'Diagonal'.

_S_l_o_t_s:


     '_x': '"logical"' vector.

     '_d_i_a_g': '"character"' string, either "U" or "N", see 'ddiMatrix'.

     '_D_i_m','_D_i_m_n_a_m_e_s': matrix dimension and 'dimnames', see the
          'Matrix' class description.

_E_x_t_e_n_d_s:

     Class '"diagonalMatrix"' and class '"lMatrix"', directly.

     Class '"sparseMatrix"', by class '"diagonalMatrix"'.

_S_e_e _A_l_s_o:

     Classes 'ddiMatrix' and 'diagonalMatrix'; function 'Diagonal'.

_E_x_a_m_p_l_e_s:

     (lM <- Diagonal(x = c(TRUE,FALSE,FALSE)))
     str(lM)#> gory details (slots)

     crossprod(lM) # numeric
     (nM <- as(lM, "nMatrix"))# -> sparse (not formally ``diagonal'')
     crossprod(nM) # logical sparse

