
####################################################
#   Function definitions for Chapter 2

#   Korobov point-set for lattice based integration
korobov <- function(a,d,N){
   z <- numeric(d)
   z[1] <- 1
   for (i in 2:d){
     z[i] <- (z[i-1]*a) %% N
   }
   Z <- matrix(rep(z,N),N,d,byrow=TRUE)
   B <- matrix(rep(1:N),N,d)
   return( (B*Z/N) %% 1)
}


