tests/testthat/test1.R

# Test 1 -------------------------------------------------------------------------------------------
context( "Distance function parallelization" )

test_that( "Same result sequencial and parallel code", {
  n<-1e5
  x<-runif( n )
  y<-runif( n )
  p<-rep(2.5,n)
  w<-runif(n)
  
  kw<-weight_pow_dist( x, y, w, p )
  
  nw<-sum( w * abs( x - y )^p )
  
  expect_equal( kw, nw )
} )

Try the KRIG package in your browser

Any scripts or data that you put into this service are public.

KRIG documentation built on May 2, 2019, 5:55 a.m.