tests/testthat/test-combinatorics.R

test_that("combinations with repetition algorithm works", {
  expect_snapshot(combinations_with_repetition(5, 3), cran=TRUE)
  expect_snapshot(combinations_with_repetition(3, 5), cran=TRUE)
})

test_that("multiset partitions are correctly generated", {
  expect_snapshot(generate_partitions(5, 3), cran=TRUE)
  expect_snapshot(generate_partitions(3, 5), cran=TRUE)
})

Try the nn2poly package in your browser

Any scripts or data that you put into this service are public.

nn2poly documentation built on May 29, 2024, 5:08 a.m.