tests/testthat/test-frank.R

context("Frank matrices")

# Frank matrix ---------------------------------------------------------

test_that("Frank matrix", {
  F <- frank(4)
  A <- matrix(c(4,3,0,0,3,3,2,0,2,2,2,1,1,1,1,1),nrow=4)

  expect_equal(norm(F - A), 0)

  F <- frank(4, 1)

  expect_equal(norm(F - t(A[4:1, 4:1])), 0)
})

Try the gallery package in your browser

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

gallery documentation built on Sept. 26, 2024, 5:07 p.m.