Latin Hypercube Samples (lhs)
1.0
R, C++, and Rcpp code to generate Latin hypercube samples
|
Go to the source code of this file.
Namespaces | |
oacpp | |
Functions | |
void | oacpp::rutils::unifperm (std::vector< int > &pi, int q, RUnif &randomClass) |
template<class T > | |
void | oacpp::rutils::findranks_slow_zero (const std::vector< T > &v, std::vector< int > &indx) |
template<class T > | |
void | oacpp::rutils::findranks_slow (const std::vector< T > &v, std::vector< int > &indx) |
template<class T > | |
bool | oacpp::rutils::findranksCompare (const std::pair< T, int > &first, const std::pair< T, int > &second) |
template<class T > | |
void | oacpp::rutils::findranks_zero (const std::vector< T > &v, std::vector< int > &rank) |
template<class T > | |
void | oacpp::rutils::findranks (const std::vector< T > &v, std::vector< int > &rank) |
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.
void oacpp::rutils::findranks | ( | const std::vector< T > & | v, |
std::vector< int > & | rank | ||
) |
Find the rank of each vector element
T | numeric argument that can be ranked |
v | the vector to be ranked |
rank | the ranks of the elements |
void oacpp::rutils::findranks_slow | ( | const std::vector< T > & | v, |
std::vector< int > & | indx | ||
) |
Find the rank of each vector element
T | numeric argument that can be ranked |
v | the vector to be ranked |
indx | the ranks of the elements |
void oacpp::rutils::findranks_slow_zero | ( | const std::vector< T > & | v, |
std::vector< int > & | indx | ||
) |
Find the rank of each vector element (zero based)
T | numeric argument that can be ranked |
v | the vector to be ranked |
indx | the ranks of the elements |
void oacpp::rutils::findranks_zero | ( | const std::vector< T > & | v, |
std::vector< int > & | rank | ||
) |
Find the rank of each vector element (zero based)
T | numeric argument that can be ranked |
v | the vector to be ranked |
rank | the ranks of the elements |
bool oacpp::rutils::findranksCompare | ( | const std::pair< T, int > & | first, |
const std::pair< T, int > & | second | ||
) |
Comparison operator to use in the findranks method
first | the first pair of arguments (value, rank) |
second | the second pair of arguments (value, rank) |
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
pi | a vector of integers to be permuted |
q | length of the vector |
randomClass | a random number generator class |