tests/testthat/test-SOA2plus_regulart.R

test_that("SOA2plus_regulart", {
  set.seed(1234)
  temp <- SOA2plus_regulart(2, 4)
  expect_equal(dim(temp), c(16, 10))
  expect_false(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(2, 4, m=5, old=TRUE)
  expect_equal(dim(temp), c(16, 5))
  expect_true(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(2, 4, m=7, old=TRUE)
  expect_equal(dim(temp), c(16, 7))
  expect_false(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(2, 4, m=7)
  expect_equal(dim(temp), c(16, 7))
  expect_true(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(3, 3)
  expect_equal(dim(temp), c(27, 6))
  expect_true(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(4, 3)
  expect_equal(dim(temp), c(64, 8))
  expect_true(ocheck(temp))

  set.seed(1234)
  temp <- SOA2plus_regulart(2, 4, orth=FALSE)
  expect_equal(dim(temp), c(16, 10))
  expect_false(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(2, 4, m=7, orth=FALSE)
  expect_equal(dim(temp), c(16, 7))
  expect_false(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(3, 3, orth=FALSE)
  expect_equal(dim(temp), c(27, 6))
  expect_false(ocheck(temp))
  set.seed(1234)
  temp <- SOA2plus_regulart(4, 3, orth=FALSE)
  expect_equal(dim(temp), c(64, 8))
  expect_false(ocheck(temp))

  temp <- SOA2plus_regulart(4, 3, m=3,
                            permlist = list(
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3)))
  expect_equal(dim(temp), c(64,3))
  temp <- SOA2plus_regulart(4, 3,
                            permlist = list(
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3),
                              list(0:3,0:3,0:3)))
  expect_equal(dim(temp), c(64,8))

  expect_error(SOA2plus_regulart(64, 3),
               regexp="must not be larger than s=2^5", fixed=TRUE)
  expect_error(SOA2plus_regulart(729, 3),
               regexp="must not be larger than s=3^3", fixed=TRUE)
})

Try the SOAs package in your browser

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

SOAs documentation built on Aug. 11, 2023, 1:09 a.m.