Learn R Programming

Matrix (version 0.999375-46)

all.equal-methods: Matrix Package Methods for Function all.equal()

Description

Methods for function all.equal() (from Rpackage base) are defined for all Matrix classes.

Arguments

Examples

Run this code
(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))))

Run the code above in your browser using DataLab