R Under development (unstable) (2024-08-17 r87027 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(expm) Loading required package: Matrix Attaching package: 'expm' The following object is masked from 'package:Matrix': expm > > source(system.file("test-tools.R", package= "expm"), keep.source=FALSE)# relErr() Loading required package: tools > > set.seed(101) > for(n in c(1:5, 10:11, if(doExtras) 100:101 else 25)) { + cat("n = ",n,"\n-----\n") + for(i in seq_len(if(doExtras)10 else 3)) { + A <- matrix(round(10*rnorm(n^2))/4, n,n) + E <- matrix(rnorm(n^2, sd = 1e-3), n,n) + F1 <- expmFrechet(A, E) + F2 <- expmFrechet(A, E, "block") + if(i == 1 && n < 9) print(F1) + stopifnot(all.equal(F1, F2, tol = 6e-15 * n)) + cat(sprintf("%5.2f ", relErr(F1 $ L, F2 $ L) * 2^52)) + } + cat(" * eps_C \n") + } n = 1 ----- $expm [,1] [1,] 0.4723666 $Lexpm [,1] [1,] 0.0002609645 0.00 0.00 0.00 * eps_C n = 2 ----- $expm [,1] [,2] [1,] 3.7943192 3.9860952 [2,] -0.4428995 0.2511234 $Lexpm [,1] [,2] [1,] -0.000196749 0.0005570041 [2,] -0.001188989 -0.0019747694 2.27 1.51 2.97 * eps_C n = 3 ----- $expm [,1] [,2] [,3] [1,] -13.234401 -7.815106 -5.911481 [2,] 3.475001 -14.396109 -2.922287 [3,] -4.792555 -3.230410 -2.237135 $Lexpm [,1] [,2] [,3] [1,] -0.006244373 0.03825617 0.006773883 [2,] -0.009314389 -0.01048467 -0.005528605 [3,] -0.003071235 0.01362774 0.002137511 3.85 7.21 6.22 * eps_C n = 4 ----- $expm [,1] [,2] [,3] [,4] [1,] 0.2707319 -0.1626405 -2.119235 -0.07861206 [2,] 2.0900646 -0.7912464 -14.169394 -0.17449996 [3,] 6.3895316 12.2833412 -18.789145 6.32147099 [4,] -2.2731287 -5.9125055 4.417767 -2.96095147 $Lexpm [,1] [,2] [,3] [,4] [1,] 7.677032e-05 0.001682315 -0.0008184674 0.0009526274 [2,] -1.662466e-03 0.009155436 0.0057316462 0.0050790835 [3,] -4.184527e-03 -0.001231147 0.0132157465 0.0025368226 [4,] -4.704290e-04 0.000236295 0.0019512119 -0.0013450671 4.21 7.84 0.57 * eps_C n = 5 ----- $expm [,1] [,2] [,3] [,4] [,5] [1,] 28.89025 -7.887859 -5.470599 0.5944806 9.342582 [2,] 13.49317 -13.253465 34.703223 31.9553150 -3.493428 [3,] 77.39341 -41.002709 78.782028 79.2962299 5.522557 [4,] 32.49178 -16.213884 20.464336 23.6511224 4.510920 [5,] -41.22584 20.972736 -29.288624 -33.2428425 -5.776531 $Lexpm [,1] [,2] [,3] [,4] [,5] [1,] 0.056099069 -0.036816360 0.09881220 0.086689105 -0.0230892952 [2,] -0.022878412 0.028215505 -0.04468039 -0.041094058 0.0005738551 [3,] 0.047797873 -0.004093659 0.09600680 0.079920949 -0.0371636943 [4,] 0.022749004 -0.006615176 0.04445098 0.036856490 -0.0189132368 [5,] 0.004190808 -0.010861707 -0.01759342 -0.008662979 0.0249103378 4.75 2.83 2.87 * eps_C n = 10 ----- 3.13 4.72 2.42 * eps_C n = 11 ----- 3.28 3.60 3.22 * eps_C n = 25 ----- 4.08 6.25 4.37 * eps_C > > cat('Time elapsed: ', proc.time(), '\n') # for "statistical reasons" Time elapsed: 1.34 0.12 1.45 NA NA > > proc.time() user system elapsed 1.34 0.12 1.45