dsyMatrix-class            package:Matrix            R Documentation

_S_y_m_m_e_t_r_i_c _D_e_n_s_e _N_u_m_e_r_i_c _M_a_t_r_i_c_e_s

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

     The '"dsyMatrix"' class is the class of symmetric, dense matrices
     in non-packed storage and '"dspMatrix"' is the class of symmetric
     dense matrices in packed storage.  Only the upper triangle or the
     lower triangle is stored.

_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("dsyMatrix",
     ...)'.

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

     '_u_p_l_o': Object of class '"character"'. Must be either "U", for
          upper triangular, and "L", for lower triangular.

     '_x': Object of class '"numeric"'. The numeric values that
          constitute the matrix, stored in column-major order.

     '_D_i_m','_D_i_m_n_a_m_e_s': The dimension (a length-2 '"integer"') and
          corresponding names (or 'NULL'), see the 'Matrix'.

     '_f_a_c_t_o_r_s': Object of class '"list"'.  A named list of
          factorizations that have been computed for the matrix.

_E_x_t_e_n_d_s:

     '"dsyMatrix"' extends class '"dgeMatrix"', directly, whereas
      '"dspMatrix"' extends class '"ddenseMatrix"', directly.

     Both extend class '"symmetricMatrix"', directly, and class
     '"Matrix"' and others, _in_directly, use 'showClass("dsyMatrix")',
     e.g., for details.

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

     _c_o_e_r_c_e 'signature(from = "ddenseMatrix", to = "dgeMatrix")'

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

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

     _c_o_e_r_c_e 'signature(from = "dsyMatrix", to = "dspMatrix")'

     _c_o_e_r_c_e 'signature(from = "dspMatrix", to = "dsyMatrix")'

     _n_o_r_m 'signature(x = "dspMatrix", type = "character")'

     _n_o_r_m 'signature(x = "dsyMatrix", type = "character")'

     _n_o_r_m 'signature(x = "dspMatrix", type = "missing")'

     _n_o_r_m 'signature(x = "dsyMatrix", type = "missing")'

     _s_o_l_v_e 'signature(a = "dspMatrix", b = "missing")'

     _s_o_l_v_e 'signature(a = "dsyMatrix", b = "missing")'

     _s_o_l_v_e 'signature(a = "dspMatrix", b = "matrix")'

     _s_o_l_v_e 'signature(a = "dsyMatrix", b = "matrix")'

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

     Classes 'dgeMatrix' and 'Matrix'; 'solve', 'norm', 'rcond', 't'

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

     ## Only upper triangular part matters (when uplo == "U" as per default)
     (sy2 <- new("dsyMatrix", Dim = as.integer(c(2,2)), x = c(14, NA,32,77)))
     (c2 <- chol(sy2))
     all.equal(c2, c2. <- chol(as(sy2, "dpoMatrix")))# equal, but not same class
     str(c2)

     ## An example where chol() can't work
     (sy3 <- new("dsyMatrix", Dim = as.integer(c(2,2)), x = c(14, -1, 2, -7)))

     validObject(as(sy3, "dpoMatrix"), test=TRUE) # >> is not pos.def.
     try(chol(sy3)) ## Error: not pos.def

