nMatrix-class             package:Matrix             R Documentation

_C_l_a_s_s "_n_M_a_t_r_i_x" _o_f _N_o_n-_z_e_r_o _P_a_t_t_e_r_n _M_a_t_r_i_c_e_s

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

     The 'nMatrix' class is the virtual mother class of all
     _*n*on-zero pattern_ (or simply _patter*n*_) matrices in the
     'Matrix' package.

_S_l_o_t_s:

     Common to _all_ matrix object in the package:

     '_D_i_m': Object of class '"integer"' - the dimensions of the matrix
          - must be an integer vector with exactly two non-negative
          values.

     '_D_i_m_n_a_m_e_s': list of length two; each component containing NULL or
          a 'character' vector length equal the corresponding 'Dim'
          element.

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

     There is a bunch of coercion methods (for 'as(..)'), e.g.,

     _c_o_e_r_c_e 'signature(from = "nMatrix", to = "matrix")': ... 

     _c_o_e_r_c_e 'signature(from = "nMatrix", to = "dMatrix")': ... 

     _c_o_e_r_c_e 'signature(from = "nMatrix", to = "lMatrix")': ... 

     _c_o_e_r_c_e 'signature(from = "matrix", to = "nMatrix")': Note that
          these coercions (must) coerce 'NA's to non-zero, hence
          conceptually 'TRUE'. This is particularly important when
          'sparseMatrix' objects are coerced to '"nMatrix"' and hence
          to 'nsparseMatrix'.

     _c_o_e_r_c_e 'signature(from = "dMatrix", to = "nMatrix")': ... 

     _c_o_e_r_c_e 'signature(from = "lMatrix", to = "nMatrix")': ... 

_S_e_e _A_l_s_o:

     The classes 'lMatrix', 'nsparseMatrix', and the mother class,
     'Matrix'.

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

     getClass("nMatrix")

     L3 <- Matrix(upper.tri(diag(3)))
     L3 # an "ltCMatrix"
     as(L3, "nMatrix") # -> ntC*

     ## similar, not using Matrix()
     as(upper.tri(diag(3)), "nMatrix")# currently "ngTMatrix"

