R Under development (unstable) (2024-02-14 r85901 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > library(cpr) > > ################################################################################ > # test that matrix rank is as expected > set.seed(42) > mat <- matrix(rnorm(25000 * 120), nrow = 25000) > stopifnot(identical(matrix_rank(mat), 120)) > > ################################################################################ > # test that matrix rank of a full rank bspline basis is as expected > x <- runif(100, 0, 1) > bmat <- bsplines(x = x, bknots = c(0, 1), df = 15) > stopifnot(identical(matrix_rank(bmat), 15)) > > ################################################################################ > # test that matrix rank of a rank-deficient bspline basis > bmat <- bsplines(x, bknots = c(0, 1), iknots = c(0.5, 0.5, 0.5, 0.5, 0.5)) > stopifnot(identical(ncol(bmat), 9L)) > stopifnot(identical(matrix_rank(bmat), 8)) > > ################################################################################ > ## End of File ## > ################################################################################ > > proc.time() user system elapsed 1.14 0.04 1.18