From bc5bb61f5263a91da3ddb81a5b8ae61b1066a1dc Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Thu, 22 Dec 2022 13:18:54 +0100 Subject: [PATCH] Added placeholder for mysubset() --- R/mysubset.R | 13 +++++++++++++ R/triangulate.R | 2 +- tests/testthat/test-spatialMixture.R | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 R/mysubset.R diff --git a/R/mysubset.R b/R/mysubset.R new file mode 100644 index 0000000..fd0a3f5 --- /dev/null +++ b/R/mysubset.R @@ -0,0 +1,13 @@ +mysubset <- function(small, large) { +# function p=mysubset(small,large) +# % MYSUBSET Is the small set of +ve integers a subset of the large set? +# % p = mysubset(small, large) + +# % Surprisingly, this is not built-in. + +# if isempty(small) +# p = 1; % isempty(large); +# else +# p = length(myintersect(small,large)) == length(small); +# end +} diff --git a/R/triangulate.R b/R/triangulate.R index 7976fc1..36d1410 100644 --- a/R/triangulate.R +++ b/R/triangulate.R @@ -22,7 +22,7 @@ triangulate <- function(G, order) { exclude <- 0 for (c in 1:length(cliques)) { - if (mysubset(nodes, cliques[[c]])) { # not maximal) + if (mysubset(nodes, cliques[[c]])) { # not maximal) # TODO: translate mysubset exclude <- 1 break } diff --git a/tests/testthat/test-spatialMixture.R b/tests/testthat/test-spatialMixture.R index 8f25500..4bf01e6 100644 --- a/tests/testthat/test-spatialMixture.R +++ b/tests/testthat/test-spatialMixture.R @@ -39,6 +39,7 @@ test_that("lakseKlitik() and subfunctions produce expected output", { # TODO: test triangulate() # TODO: test neighbors() # TODO: test myintersect() + # TODO: test mysubset() # TODO: test findCliques() # TODO: test cliques_to_jtree() # TODO: test lakseKlitik()