all.equal-methods           package:Matrix           R Documentation

_M_a_t_r_i_x _M_e_t_h_o_d_s _f_o_r _F_u_n_c_t_i_o_n _a_l_l._e_q_u_a_l()

_D_e_s_c_r_i_p_t_i_o_n:

     Methods for function 'all.equal()' (from R package 'base') are
     defined for all 'Matrix' classes.

_M_e_t_h_o_d_s:


     _t_a_r_g_e_t = "_M_a_t_r_i_x", _c_u_r_r_e_n_t = "_M_a_t_r_i_x"  

     _t_a_r_g_e_t = "_A_N_Y", _c_u_r_r_e_n_t = "_M_a_t_r_i_x"  

     _t_a_r_g_e_t = "_M_a_t_r_i_x", _c_u_r_r_e_n_t = "_A_N_Y" these three methods are simply
          using 'all.equal.numeric' directly and work via
          'as.vector()'.

_E_x_a_m_p_l_e_s:

     (A <- spMatrix(3,3, i= c(1:3,2:1), j=c(3:1,1:2), x = 1:5))
     ex <- expand(lu. <- lu(A))
     stopifnot( all.equal(as(A[lu.@p + 1L, lu.@q + 1L], "CsparseMatrix"),
                          lu.@L %*% lu.@U),
                with(ex, all.equal(as(P %*% A %*% Q, "CsparseMatrix"),
                                   L %*% U)),
                with(ex, all.equal(as(A, "CsparseMatrix"),
                                   t(P) %*% L %*% U %*% t(Q))))

