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")

