R Under development (unstable) (2024-02-11 r85891 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(pcalg) > > my.stop <- FALSE > tmp.set <- c(1,2,3) > res <- NULL > > while(!my.stop) { + tmp <- getNextSet(5,3,tmp.set) + tmp.set <- tmp$nextSet + if (tmp$wasLast) { + my.stop <- TRUE + } else { + res <- rbind(res,tmp.set) + } + } > > resTrue <- rbind(c(1,2,4), + c(1,2,5), + c(1,3,4), + c(1,3,5), + c(1,4,5), + c(2,3,4), + c(2,3,5), + c(2,4,5), + c(3,4,5)) > > if(any(resTrue!=res)) { + stop("Test of getNextSet: Theoretical values not reproduced!") + } > > proc.time() user system elapsed 1.29 0.23 1.51