File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ context(" black/white lists" )
2+
3+ dat <- generate_fixed_data_frame()
4+ sbdata <- suppressMessages(sparsebnData(dat , type = " c" ))
5+
6+ # ## Get all blocks at once
7+ nodes <- names(sbdata $ data )
8+ blocks <- lapply(nodes , function (x ){
9+ # Allow all off-diagonal entries since we are no longer using the block decomposition
10+ row <- (nodes )[nodes != x ]
11+ col <- rep(x , length(col ))
12+ cbind(row , col )
13+ })
14+ blocks <- do.call(" rbind" , blocks )
15+
16+ pp <- ncol(dat )
17+ len_saturate <- pp * (pp - 1 )/ 2
18+ nlambda <- 20
19+
20+ test_that(" White lists work OK" , {
21+ dags <- ccdr.run(sbdata , lambdas.length = nlambda , whitelist = blocks )
22+ expect_equal(num.edges(dags ), rep(len_saturate , nlambda ))
23+ })
24+
25+ test_that(" Black lists work OK" , {
26+ dags <- ccdr.run(sbdata , lambdas.length = nlambda , blacklist = blocks )
27+ expect_equal(num.edges(dags ), rep(0 , nlambda ))
28+ })
You can’t perform that action at this time.
0 commit comments