tests/testthat/test-qrcpp.R

testthat::test_that("qrcpp: decomposition works", {
  hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, `+`) }
  h9 <- hilbert(9)
  qr1 <- qrcpp(h9, tol = 1e-10)
  testthat::expect_lt(max(abs(qr1$Q %*% qr1$R - h9[,qr1$pivot])), 1e-07)
})

Try the trtswitch package in your browser

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

trtswitch documentation built on Nov. 2, 2024, 1:07 a.m.