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. > ## > ## r a n k . r Test suite > ## > > > Rank <- pracma::Rank > nullspace <- pracma::nullspace > > magic <- pracma::magic > all.equal(Rank(c()), 0) [1] TRUE > r <- numeric(8) > for (i in 3:10){ + r[i-2] <- Rank(magic(i)) + } > identical(r, c(3, 3, 5, 5, 7, 3, 9, 7)) [1] TRUE > > hilb <- pracma::hilb > identical(Rank(hilb(6)), 6L) [1] TRUE > > # Vorzeichenwechsel moeglich > # N <- nullspace(magic(4)) > # all.equal(as.numeric(N), c(0.2236, 0.6708, -0.6708, -0.2236), > # tolerance = 1e-5) > > proc.time() user system elapsed 0.21 0.03 0.23