R Under development (unstable) (2023-11-07 r85491 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ### > ### eig.R +++ Test suite +++ > ### > > > test.inv <- function(input, expected) { + output <- do.call(getFromNamespace("inv", "pracma"), input) + identical(output, expected) + } > > inv.expected.empty <- matrix(0, nrow=0, ncol=0) > inv.expected.singl <- matrix(Inf, 2, 2) > inv.expected.mat1 <- matrix(c(3,-3,1, -3,5,-2, 1,-2,1), 3, 3) > > test.inv(list(a=c()), inv.expected.empty) [1] TRUE > test.inv(list(a=matrix(1, 2, 2)), inv.expected.singl) [1] TRUE Warning message: In (function (a) : Matrix appears to be singular. > test.inv(list(a=matrix(c(1,1,1, 1,2,3, 1,3,6), 3, 3)), inv.expected.mat1) [1] TRUE > > proc.time() user system elapsed 0.12 0.06 0.17