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.eig <- function(input, expected) { + output <- do.call(getFromNamespace("eig", "pracma"), input) + identical(output, expected) + } > > eig.expected.empty <- matrix(0, nrow=0, ncol=0) > eig.expected.singl <- 1 > eig.expected.mat1 <- c(2, 0) > eig.expected.mat2 <- c(1+1i, 1-1i) > eig.expected.mat3 <- c(1, -1) > > test.eig(list(a=c()), eig.expected.empty) [1] TRUE > test.eig(list(a=c(1)), eig.expected.singl) [1] TRUE > test.eig(list(a=matrix(c(1,-1,-1,1), 2, 2)), eig.expected.mat1) [1] TRUE > test.eig(list(a=matrix(c(1,1,-1,1), 2, 2)), eig.expected.mat2) [1] TRUE > test.eig(list(a=matrix(c(0,1i,-1i,0), 2, 2)), eig.expected.mat3) [1] TRUE > > proc.time() user system elapsed 0.18 0.01 0.18