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
lhs_r.cpp File Reference
#include "lhs_r.h"

Functions

RcppExport SEXP improvedLHS_cpp (SEXP n, SEXP k, SEXP dup)
 
RcppExport SEXP maximinLHS_cpp (SEXP n, SEXP k, SEXP dup)
 
RcppExport SEXP optimumLHS_cpp (SEXP n, SEXP k, SEXP maxsweeps, SEXP eps, SEXP bVerbose)
 
RcppExport SEXP optSeededLHS_cpp (SEXP n, SEXP k, SEXP maxsweeps, SEXP eps, SEXP inlhs, SEXP bVerbose)
 
RcppExport SEXP randomLHS_cpp (SEXP n, SEXP k, SEXP preserveDraw)
 
RcppExport SEXP geneticLHS_cpp (SEXP n, SEXP k, SEXP pop, SEXP gen, SEXP pMut, SEXP criterium, SEXP bVerbose)
 
RcppExport SEXP get_library_versions ()
 

Detailed Description

Author
Robert Carnell
License:\n GNU General Public License (GPL v3)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Function Documentation

◆ geneticLHS_cpp()

RcppExport SEXP geneticLHS_cpp ( SEXP  n,
SEXP  k,
SEXP  pop,
SEXP  gen,
SEXP  pMut,
SEXP  criterium,
SEXP  bVerbose 
)

A Latin hypercube sample using a genetic algorithm

Parameters
n(IntegerVector length 1) number of rows / samples in the lhs
k(IntegerVector length 1) number parameters / columns in the lhs
pop(IntegerVector length 1) the number of designs in the initial population
gen(IntegerVector length 1) the number of generations over which the algorithm is applied
pMut(NumericVector length 1) The probability with which a mutation occurs in a column of the progeny
criterium(NumericVector length 1) The optimality criterium of the algorithm. Default is S. Maximin is also supported
bVerbose(LogicalVector length 1) Print informational messages
Returns
(NumericMatrix dim n x k) an lhs

◆ get_library_versions()

RcppExport SEXP get_library_versions ( )

Get the versions of the bclib, oa, and lhslib C++ libraries

Returns
String of version information

◆ improvedLHS_cpp()

RcppExport SEXP improvedLHS_cpp ( SEXP  n,
SEXP  k,
SEXP  dup 
)

Improved Latin hypercube sample algorithm

Parameters
n(IntegerVector length 1) number of rows / samples in the lhs
k(IntegerVector length 1) number parameters / columns in the lhs
dup(IntegerVector length 1) A factor that determines the number of candidate points used in the search.
Returns
(NumericMatrix dim n x k) an lhs

◆ maximinLHS_cpp()

RcppExport SEXP maximinLHS_cpp ( SEXP  n,
SEXP  k,
SEXP  dup 
)

Latin hypercube sample algorithm using the maximin algorithm

Parameters
n(IntegerVector length 1) number of rows / samples in the lhs
k(IntegerVector length 1) number parameters / columns in the lhs
dup(IntegerVector length 1) A factor that determines the number of candidate points used in the search.
Returns
(NumericMatrix dim n x k) an lhs

◆ optimumLHS_cpp()

RcppExport SEXP optimumLHS_cpp ( SEXP  n,
SEXP  k,
SEXP  maxsweeps,
SEXP  eps,
SEXP  bVerbose 
)

Optimal Latin hypercube sample algorithm

Parameters
n(IntegerVector length 1) number of rows / samples in the lhs
k(IntegerVector length 1) number parameters / columns in the lhs
maxsweeps(IntegerVector length 1) the maximum number of sweeps to use in the algorithm
eps(NumericVector length 1) The optimal stopping criterion
bVerbose(LogicalVector length 1) should messages be printed
Returns
(NumericMatrix dim n x k) an lhs

◆ optSeededLHS_cpp()

RcppExport SEXP optSeededLHS_cpp ( SEXP  n,
SEXP  k,
SEXP  maxsweeps,
SEXP  eps,
SEXP  pOld,
SEXP  bVerbose 
)

Optimum Latin hypercube sample with a seed sample

Parameters
n(IntegerVector length 1) number of rows / samples in the lhs
k(IntegerVector length 1) number parameters / columns in the lhs
maxsweeps(IntegerVector length 1) the maximum number of sweeps to use in the algorithm
eps(NumericVector length 1) The optimal stopping criterion
pOld(NumericMatrix dim n x k) a seed matrix
bVerbose(LogicalVector length 1) should messages be printed?
Returns
(NumericMatrix dim n x k) an lhs

◆ randomLHS_cpp()

RcppExport SEXP randomLHS_cpp ( SEXP  n,
SEXP  k,
SEXP  preserveDraw 
)

a simple random Latin hypercube sample

Parameters
n(IntegerVector length 1) number of rows / samples in the lhs
k(IntegerVector length 1) number parameters / columns in the lhs
preserveDraw(LogicalVector length 1) should be same draw be taken regardless of the number of parameters selected
Returns
(NumericMatrix dim n x k) an lhs