tests/testthat/test-row_and_col_sums.R

context("Row- and column-sums are all one")

test_that("Ryser and brute algorithms produce the same output", {
  expect_equal( max(abs( rowSums(brute(A))-1 ),abs( colSums(brute(A))-1 ))<1e-10,TRUE )
})

test_that("Ryser and brute algorithms produce the same output", {
  expect_equal( max(abs( rowSums(ryser(A))-1 ),abs( colSums(ryser(A))-1 ))<1e-10,TRUE )
})

test_that("Ryser and brute algorithms produce the same output", {
  expect_equal( max(abs( rowSums(BG(triA))-1 ),abs( colSums(BG(triA))-1 ))<1e-10,TRUE )
})

Try the expperm package in your browser

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

expperm documentation built on May 29, 2019, 1:02 a.m.