Running ‘test-KrigingCholCrash.R’ [31m/20m]
  Running ‘test-KrigingFit.R’ [12s/10s]
  Running ‘test-KrigingLeaveOneOut.R’
  Running ‘test-KrigingLeaveOneOut_3d.R’
  Running ‘test-KrigingLogLik.R’
  Running ‘test-KrigingLogLikGradHess.R’ [22s/13s]
  Running ‘test-KrigingLogMargPost.R’
  Running ‘test-KrigingMethods.R’
  Running ‘test-KrigingPredict.R’ [70s/48s]
  Running ‘test-NoiseKrigingFit.R’
  Running ‘test-NoiseKrigingLogLik.R’ [15s/13s]
  Running ‘test-NoiseKrigingMethods.R’
  Running ‘test-NoiseKrigingPredict.R’ [19s/17s]
  Running ‘test-NuggetKrigingFit.R’ [14s/11s]
  Running ‘test-NuggetKrigingLogLik.R’
  Running ‘test-NuggetKrigingLogMargPost.R’
  Running ‘test-NuggetKrigingMethods.R’
  Running ‘test-NuggetKrigingPredict.R’ [19s/18s]
  Running ‘test-RobustGaSP-Nugget.R’
  Running ‘test-RobustGaSP.R’
  Running ‘test-asDiceKriging.R’ [25s/16s]
  Running ‘test-normalize.R’
  Running ‘test-rlibkriging-demo.R’
Running the tests in ‘tests/test-KrigingCholCrash.R’ failed.
Complete output:
  > library(testthat)
  > library(rlibkriging)
  > 
  > #library(testthat)
  > ##library(rlibkriging, lib.loc="bindings/R/Rlibs")
  > #packageDescription("rlibkriging")
  > rlibkriging:::linalg_set_num_nugget(1E-10)
  > default_nugget = rlibkriging:::linalg_get_num_nugget()
  > 
  > #############################################################
  > 
  > context("Chol Nugget")
  > 
  > f <- function(X) apply(X, 1,
  +                        function(x)
  +                          prod(
  +                            sin(2*pi*
  +                                  ( x * (seq(0,1,l=1+length(x))[-1])^2 )
  +                            )))
  > n <- 10
  > d <- 3
  > set.seed(1234)
  > X <- matrix(runif(n*d),ncol=d)
  > y <- f(X)
  > r = NULL
  > try( r <- Kriging(y, X, "gauss","constant",FALSE,"BFGS","LL") )
  OMP: Warning #96: Cannot form a team with 10 threads, using 2 instead.
  OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).
  > 
  > test_that(desc="Kriging fit with num nugget is passing", expect_true(!is.null(r)))
  Test passed 😸
  > 
  > l=as.list(r)
  > R = l$T %*% t(l$T) - 1E-10 * diag(nrow(X))
  > cholR=NULL
  > try( cholR <- chol(R) ) # Should not fail
  > 
  > test_that(desc="Kriging fit withOUT num nugget would also pass", expect_true(!is.null(cholR)))
  Test passed 🌈
  > 
  > rlibkriging:::linalg_set_num_nugget(0.0)
  > rlibkriging:::linalg_get_num_nugget()
  [1] 0
  > 
  > r_nonugget = NULL
  > try( r_nonugget <- Kriging(y, X, "gauss","constant",FALSE,"BFGS","LL") )
  > 
  > test_that(desc="Kriging fit with num nugget is passing", expect_true(!is.null(r_nonugget)))
  Test passed 🎊
  > 
  > l_nonugget=as.list(r_nonugget)
  > R_nonugget = l_nonugget$T %*% t(l_nonugget$T)
  > cholR_nonugget=NULL
  > try( cholR_nonugget <- chol(R_nonugget) ) # Should not fail
  > 
  > test_that(desc="Kriging fit withOUT num nugget would also pass", expect_true(!is.null(cholR_nonugget)))
  Test passed 🎊
  > 
  > rlibkriging:::linalg_set_num_nugget(default_nugget)
  > 
  > #############################################################
  > 
  > 
  > context("Chol Crash nD")
  > 
  > f <- function(X) apply(X, 1,
  +                        function(x)
  +                          prod(
  +                            sin(2*pi*
  +                                  ( x * (seq(0,1,l=1+length(x))[-1])^2 )
  +                            )))
  > n <- 1000
  > d <- 3
  > set.seed(1234)
  > X <- matrix(runif(n*d),ncol=d)
  > y <- f(X)
  > r = NULL
  > # This will crash "chol(): decomposition failed before adding numerical nugget to R mat
  > try( r <- Kriging(y, X, "gauss","constant",FALSE,"BFGS","LL") )