tests/testthat/test-utils-sym.R

################################################################################

test_that("col_count_sym() works", {

  replicate(100, {

    N <- 300
    spmat <- Matrix::rsparsematrix(N, N, 0.1, symmetric = TRUE)
    expect_identical(col_count_sym(spmat@p, spmat@i),
                     Matrix::colSums(spmat != 0))
  })

})

################################################################################

Try the bigsparser package in your browser

Any scripts or data that you put into this service are public.

bigsparser documentation built on June 7, 2022, 9:06 a.m.