dsCMatrix-class            package:Matrix            R Documentation

_N_u_m_e_r_i_c _S_y_m_m_e_t_r_i_c _S_p_a_r_s_e (_c_o_l_u_m_n _c_o_m_p_r_e_s_s_e_d) _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The 'dsCMatrix' class is a class of symmetric, sparse numeric
     matrices in the compressed, column-oriented format.  In this
     implementation the non-zero elements in the columns are sorted
     into increasing row order.
      The 'dsTMatrix' class is the class of symmetric, sparse numeric
     matrices in triplet format.

_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("dsCMatrix",
     ...)' or 'new("dsTMatrix", ...)' or (for 'dsCMatrix') also
     automatically from 'Matrix(.)'.

_S_l_o_t_s:


     '_u_p_l_o': A character object indicating if the upper triangle
          ('"U"') or the lower triangle ('"L"') is stored.

     '_i': Object of class '"integer"' of length nnZ (_half_ number of
          non-zero elements).  These are the row numbers for each
          non-zero element in the lower triangle of the matrix.

     '_p': (only in class '"dsCMatrix"':) Object of class '"integer"' of
          pointers, one for each column, to the initial (zero-based)
          index of elements in the column.

     '_j': (only in class '"dsTMatrix"':) Object of class '"integer"' of
          length nnZ (as 'i').  These are the column numbers for each
          non-zero element in the lower triangle of the matrix.

     '_x': Object of class '"numeric"' of length nnZ - the non-zero
          elements of the matrix (to be duplicated for full matrix).

     '_f_a_c_t_o_r_s': Object of class '"list"' - a list of factorizations of
          the matrix. 

     '_D_i_m': Object of class '"integer"' - the dimensions of the matrix
          - must be an integer vector with exactly two non-negative
          values.

_E_x_t_e_n_d_s:

     Both classes extend classes and 'symmetricMatrix' 'dsparseMatrix'
     directly; 'dsCMatrix' further directly extends 'CsparseMatrix',
     where 'dsTMatrix' does 'TsparseMatrix'.

_M_e_t_h_o_d_s:


     _s_o_l_v_e 'signature(a = "dsCMatrix", b = "dsparseMatrix")': Solve a
          linear system of equations defined by 'x' using a Cholesky
          decomposition.  All steps will be based on _sparse_
          representations.

     _s_o_l_v_e 'signature(a = "dsCMatrix", b = "matrix")': Solve a linear
          system of equations defined by 'x' using a Cholesky
          decomposition.

     _c_h_o_l 'signature(x = "dsCMatrix", pivot = "logical")': Returns (and
          stores) the Cholesky decomposition of 'x', see 'chol'.

     _C_h_o_l_e_s_k_y 'signature(A = "dsCMatrix",...)': Computes more flexibly
          Cholesky decompositions, see 'Cholesky'.

     _d_e_t_e_r_m_i_n_a_n_t 'signature(x = "dsCMatrix", logarithm = "missing")':
          Evaluate the determinant of 'x' on the logarithm scale.  This
          creates and stores the Cholesky factorization.

     _d_e_t_e_r_m_i_n_a_n_t 'signature(x = "dsCMatrix", logarithm = "logical")':
          Evaluate the determinant of 'x' on the logarithm scale or
          not, according to the 'logarithm' argument.  This creates and
          stores the Cholesky factorization.

     _t 'signature(x = "dsCMatrix")': Transpose.  As for all symmetric
          matrices, a matrix for which the upper triangle is stored
          produces a matrix for which the lower triangle is stored and
          vice versa, i.e., the 'uplo' slot is swapped, and the row and
          column indices are interchanged.

     _t 'signature(x = "dsTMatrix")': Transpose.  The 'uplo' slot is
          swapped from '"U"' to '"L"' or vice versa, as for a
          '"dsCMatrix"', see above.

     _c_o_e_r_c_e 'signature(from = "dsCMatrix", to = "dgTMatrix")'

     _c_o_e_r_c_e 'signature(from = "dsCMatrix", to = "dgeMatrix")'

     _c_o_e_r_c_e 'signature(from = "dsCMatrix", to = "matrix")'

     _c_o_e_r_c_e 'signature(from = "dsTMatrix", to = "dgeMatrix")'

     _c_o_e_r_c_e 'signature(from = "dsTMatrix", to = "dsCMatrix")'

     _c_o_e_r_c_e 'signature(from = "dsTMatrix", to = "dsyMatrix")'

     _c_o_e_r_c_e 'signature(from = "dsTMatrix", to = "matrix")'

_S_e_e _A_l_s_o:

     Classes 'dgCMatrix', 'dgTMatrix', 'dgeMatrix' and those mentioned
     above.

_E_x_a_m_p_l_e_s:

     mm <- Matrix(toeplitz(c(10, 0, 1, 0, 3)), sparse = TRUE)
     mm # automatically dsCMatrix
     str(mm)

     ## how would we go from a manually constructed Tsparse* :
     mT <- as(mm, "dgTMatrix")

     ## Either
     (symM <- as(mT, "symmetricMatrix"))# dsT
     (symC <- as(symM, "CsparseMatrix"))# dsC
     ## or
     sC <- Matrix(mT, sparse=TRUE, forceCheck=TRUE)

     sym2 <- as(symC, "TsparseMatrix")

