https://github.com/cran/pracma
Raw File
Tip revision: 10ae2bb8daa6ba60ffc49143525900a7978d54b7 authored by HwB on 08 August 2013, 00:00:00 UTC
version 1.5.0
Tip revision: 10ae2bb
polyint.R
###
### polyint.R  +++ Test suite +++
###


test.polyint <- function(input, expected) {
   output <- do.call(getFromNamespace("polyint", "pracma"), input)
   identical(output, expected)
}

polyint.expected.1 <- c(1, 0)
polyint.expected.2 <- c(1/6, 1/5, 1/4, 1/3, 1/2, 1, 1)

test.polyint(list(p=c(1)), polyint.expected.1)
test.polyint(list(p=c(1,1,1,1,1,1), k=1), polyint.expected.2)
back to top