R Under development (unstable) (2024-05-20 r86569 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("polyCub") > > ### Regression tests > > hexagon <- list( + list(x = c(7.33, 7.33, 3, -1.33, -1.33, 3), + y = c(-0.5, 4.5, 7, 4.5, -0.5, -3)) + ) > f <- function (s) (rowSums(s^2)+1)^-2 > ##plotpolyf(hexagon, f) > > ## isotropic cubature can handle control list for integrate() > ## previously, passing control arguments did not work > int1 <- polyCub.iso(hexagon, f, center=c(0,0), control=list(rel.tol=1e-3)) > int2 <- polyCub.iso(hexagon, f, center=c(0,0), control=list(rel.tol=1e-8)) > ## results are almost but not identical > stopifnot(all.equal(int1, int2, tolerance = 1e-3), + !identical(int1, int2)) > > proc.time() user system elapsed 0.32 0.15 0.45