Latin Hypercube Samples (lhs)  1.0
R, C++, and Rcpp code to generate Latin hypercube samples
All Classes Namespaces Files Functions Variables Typedefs Macros Pages
rutils.cpp File Reference
#include "rutils.h"

Namespaces

 oacpp
 

Functions

void oacpp::rutils::unifperm (std::vector< int > &pi, int q, RUnif &randomClass)
 

Detailed Description

Author
Robert Carnell

License: This file may be freely used and shared according to the original license.

Reference:

Original Header:

These programs construct and manipulate orthogonal arrays. They were prepared by

  • Art Owen
  • Department of Statistics
  • Sequoia Hall
  • Stanford CA 94305

They may be freely used and shared. This code comes with no warranty of any kind. Use it at your own risk.

I thank the Semiconductor Research Corporation and the National Science Foundation for supporting this work.

Function Documentation

◆ unifperm()

void oacpp::rutils::unifperm ( std::vector< int > &  pi,
int  q,
RUnif randomClass 
)

In S one just does rank(runif(q)). Here we want something like rank(runif(q))-1 since the symbols to be permuted are 0..q-1

Parameters
pia vector of integers to be permuted
qlength of the vector
randomClassa random number generator class