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

