tests/testthat/test-gl_cumint.R

test_that(".gl_cumint gives the cumulative integral at the nodes", {
  q <- .gl_cumint(8L)
  x <- .gl_rule(8L)$x
  # integral of 4 x^3 + 1 from -1 to x is x^4 + x
  expect_equal(as.vector(q %*% (4 * x^3 + 1)), x^4 + x, tolerance = 1e-12)
  # degree 7 is exact
  expect_equal(as.vector(q %*% (8 * x^7)), x^8 - 1, tolerance = 1e-12)
})

Try the DesignComplexSurvival package in your browser

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

DesignComplexSurvival documentation built on Nov. 23, 2026, 5:07 p.m.