tests/testthat/test-1F0.R

context("1F0")

test_that("1F0 is det(I-X)^(-a)", {
  X <- toeplitz(c(3,2,1))/100
  obtained <- hypergeomPFQ(m = 15, a = 3, b = NULL, x = X)
  expected <- det(diag(3)-X)^(-3)
  expect_equal(obtained, expected)
  #
  X <- toeplitz(c(2,2,1))/100
  obtained <- hypergeomPFQ(m = 15, a = 4i, b = NULL, x = X)
  expected <- det(diag(3)-X)^(-4i)
  expect_equal(obtained, expected)
  #
  X <- toeplitz(c(3i,2,1))/100
  obtained <- hypergeomPFQ(m = 15, a = 3, b = NULL, x = X)
  expected <- EigenR::Eigen_det(diag(3)-X)^(-3)
  expect_equal(obtained, expected)
  #
  X <- toeplitz(c(2i,2,1))/100
  obtained <- hypergeomPFQ(m = 15, a = 4i, b = NULL, x = X)
  expected <- EigenR::Eigen_det(diag(3)-X)^(-4i)
  expect_equal(obtained, expected)
})

Try the HypergeoMat package in your browser

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

HypergeoMat documentation built on Feb. 16, 2023, 7:40 p.m.