CsparseMatrix-class package:Matrix R Documentation _C_l_a_s_s "_C_s_p_a_r_s_e_M_a_t_r_i_x" _o_f _S_p_a_r_s_e _M_a_t_r_i_c_e_s _i_n _C_o_l_u_m_n-_c_o_m_p_r_e_s_s_e_d _F_o_r_m _D_e_s_c_r_i_p_t_i_o_n: The '"CsparseMatrix"' class is the virtual class of all sparse matrices coded in sorted compressed column-oriented form. Since it is a virtual class, no objects may be created from it. See 'showClass("CsparseMatrix")' for its subclasses. _S_l_o_t_s: '_i': Object of class '"integer"' of length nnzero (number of non-zero elements). These are the _0-based_ row numbers for each non-zero element in the matrix, i.e., 'i' must be in '0:(nrow(.)-1)'. '_p': Object of class '"integer"' for providing pointers, one for each column, to the initial (zero-based) index of elements in the column. '.@p' is of length 'ncol(.) + 1', with 'p[1] == 0' and 'p[length(p)] == nnzero', such that in fact, 'diff(.@p)' are the number of non-zero elements for each column. '_D_i_m', '_D_i_m_n_a_m_e_s': inherited from the superclass, see the 'sparseMatrix' class. _E_x_t_e_n_d_s: Class '"sparseMatrix"', directly. Class '"Matrix"', by class '"sparseMatrix"'. _M_e_t_h_o_d_s: _A_r_i_t_h 'signature(e1 = "CsparseMatrix", e2 = "numeric")': ... _A_r_i_t_h 'signature(e1 = "numeric", e2 = "CsparseMatrix")': ... _M_a_t_h 'signature(x = "CsparseMatrix")': ... _b_a_n_d 'signature(x = "CsparseMatrix")': ... - 'signature(e1 = "CsparseMatrix", e2 = "numeric")': ... - 'signature(e1 = "numeric", e2 = "CsparseMatrix")': ... [<- 'signature(x = "CsparseMatrix", i = "index", j = "missing", value = "replValue")': ... [<- 'signature(x = "CsparseMatrix", i = "index", j = "index", value = "replValue")': ... [<- 'signature(x = "CsparseMatrix", i = "missing", j = "index", value = "replValue")': ... %*% 'signature(x = "CsparseMatrix", y = "CsparseMatrix")': ... %*% 'signature(x = "CsparseMatrix", y = "denseMatrix")': ... %*% 'signature(x = "CsparseMatrix", y = "matrix")': ... + 'signature(e1 = "CsparseMatrix", e2 = "numeric")': ... + 'signature(e1 = "numeric", e2 = "CsparseMatrix")': ... _c_o_e_r_c_e 'signature(from = "CsparseMatrix", to = "TsparseMatrix")': ... _c_o_e_r_c_e 'signature(from = "CsparseMatrix", to = "denseMatrix")': ... _c_o_e_r_c_e 'signature(from = "CsparseMatrix", to = "matrix")': ... _c_o_e_r_c_e 'signature(from = "CsparseMatrix", to = "lsparseMatrix")': ... _c_o_e_r_c_e 'signature(from = "CsparseMatrix", to = "nsparseMatrix")': ... _c_o_e_r_c_e 'signature(from = "TsparseMatrix", to = "CsparseMatrix")': ... _c_o_e_r_c_e 'signature(from = "denseMatrix", to = "CsparseMatrix")': ... _c_r_o_s_s_p_r_o_d 'signature(x = "CsparseMatrix", y = "CsparseMatrix")': ... _c_r_o_s_s_p_r_o_d 'signature(x = "CsparseMatrix", y = "missing")': ... _c_r_o_s_s_p_r_o_d 'signature(x = "CsparseMatrix", y = "dgeMatrix")': ... _c_r_o_s_s_p_r_o_d 'signature(x = "CsparseMatrix", y = "matrix")': ... _d_i_a_g 'signature(x = "CsparseMatrix")': ... _g_a_m_m_a 'signature(x = "CsparseMatrix")': ... _l_g_a_m_m_a 'signature(x = "CsparseMatrix")': ... _l_o_g 'signature(x = "CsparseMatrix")': ... _t 'signature(x = "CsparseMatrix")': ... _t_c_r_o_s_s_p_r_o_d 'signature(x = "CsparseMatrix", y = "CsparseMatrix")': ... _t_c_r_o_s_s_p_r_o_d 'signature(x = "CsparseMatrix", y = "missing")': ... _t_r_i_l 'signature(x = "CsparseMatrix")': ... _t_r_i_u 'signature(x = "CsparseMatrix")': ... _N_o_t_e: All classes extending 'CsparseMatrix' have a common validity (see 'validObject') check function. That function additionally checks the 'i' slot for each column to contain increasing row numbers. In earlier versions of 'Matrix' ('<= 0.999375-16'), 'validObject' automatically re-sorted the entries when necessary, and hence 'new()' calls with somewhat permuted 'i' and 'x' slots worked, as 'new(...)' (_with_ slot arguments) automatically checks the validity. Now, you have to use 'sparseMatrix' to achieve the same functionality or know how to use '.validateCsparse()' to do so. _S_e_e _A_l_s_o: 'colSums', 'kronecker', and other such methods with own help pages. Further, the super class of 'CsparseMatrix', 'sparseMatrix', and, e.g., class 'dgCMatrix' for the links to other classes. _E_x_a_m_p_l_e_s: getClass("CsparseMatrix") ## The common validity check function (based on C code): getValidity(getClass("CsparseMatrix")) ## This behavior has been changed # un-sorted i-slot on input is automatically "sorted" : #M <- new("dgCMatrix", Dim = 2:3, p = as.integer(c(0,1,1,3)), # i = c(1L, 1:0), x= c(2,2,1)) #stopifnot(M@i == c(1L, 0:1), M@x == c(2,1,2))