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

Typedefs

using oalhslib::msize_type = bclib::matrix< int >::size_type
 
using oalhslib::columnit = bclib::matrix< int >::columnwise_iterator
 
using oalhslib::viterator = std::vector< int >::iterator
 
using oalhslib::vconstiterator = std::vector< int >::const_iterator
 
using oalhslib::vsize_type = std::vector< int >::size_type
 

Functions

void oalhslib::oaLHS (int n, int k, const bclib::matrix< int > &oa, bclib::matrix< int > &intlhs, bclib::matrix< double > &lhs, bool bVerbose, bclib::CRandom< double > &oRandom)
 
void oalhslib::printOAandUnique (const bclib::matrix< int > &oa, const std::vector< std::vector< int > > &uniqueLevelsVector)
 
void oalhslib::oaLHS (int n, int k, const bclib::matrix< int > &oa, bclib::matrix< int > &intlhs, bool bVerbose)
 
void oalhslib::replaceOAValues (const bclib::matrix< int > &oa, const std::vector< std::vector< int > > &uniqueLevelsVector, bclib::matrix< int > &intlhs, bclib::CRandom< double > &oRandom, bool isRandom)
 
void oalhslib::generateOALHS (int n, int k, bclib::matrix< double > &oalhs, bool bChooseLargerDesign, bool bVerbose, bclib::CRandom< double > &oRandom)
 

Detailed Description

Author
Robert Carnell

License: GNU Lesser General Public License (LGPL v3) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Typedef Documentation

◆ columnit

using oalhslib::columnit = typedef bclib::matrix<int>::columnwise_iterator

matrix column iterator

◆ msize_type

using oalhslib::msize_type = typedef bclib::matrix<int>::size_type

matrix size type

◆ vconstiterator

using oalhslib::vconstiterator = typedef std::vector<int>::const_iterator

vector const iterator

◆ viterator

using oalhslib::viterator = typedef std::vector<int>::iterator

vector iterator

◆ vsize_type

using oalhslib::vsize_type = typedef std::vector<int>::size_type

vector size type

Function Documentation

◆ generateOALHS()

void oalhslib::generateOALHS ( int  n,
int  k,
bclib::matrix< double > &  oalhs,
bool  bChooseLargerDesign,
bool  bVerbose,
bclib::CRandom< double > &  oRandom 
)

generate an orthogonal array Latin hypercube

Parameters
nthe number of rows or samples
kthe number of columns or parameters
oalhsthe generated Latin hypercube sample
bChooseLargerDesignchoose a larger design if the orthogonal array is not sufficient
bVerboseshould messages be printed
oRandoma random generator

◆ oaLHS() [1/2]

void oalhslib::oaLHS ( int  n,
int  k,
const bclib::matrix< int > &  oa,
bclib::matrix< int > &  intlhs,
bclib::matrix< double > &  lhs,
bool  bVerbose,
bclib::CRandom< double > &  oRandom 
)

create an orthogonal array latin hypercube from an orthogonal array

Parameters
nthe number of rows or samples
kthe number of columns or parameters
oaan orthogonal array
intlhsan integer based Latin hypercube sample
lhsa Latin hypercube sample
bVerbosewill messages be printed
oRandoma random generator

◆ oaLHS() [2/2]

void oalhslib::oaLHS ( int  n,
int  k,
const bclib::matrix< int > &  oa,
bclib::matrix< int > &  intlhs,
bool  bVerbose 
)

create a deterministic orthogonal array latin hypercube from an orthogonal array

Parameters
nthe number of rows or samples
kthe number of columns or parameters
oaan orthogonal array
intlhsan integer based Latin hypercube sample
bVerbosewill messages be printed

◆ printOAandUnique()

void oalhslib::printOAandUnique ( const bclib::matrix< int > &  oa,
const std::vector< std::vector< int > > &  uniqueLevelsVector 
)

print an orthogonal array and the unique levels

Parameters
oaan orthogonal array
uniqueLevelsVector

◆ replaceOAValues()

void oalhslib::replaceOAValues ( const bclib::matrix< int > &  oa,
const std::vector< std::vector< int > > &  uniqueLevelsVector,
bclib::matrix< int > &  intlhs,
bclib::CRandom< double > &  oRandom,
bool  isRandom 
)

replace orthogonal array values

Parameters
oaan orthogonal array
uniqueLevelsVector
intlhsan integer based Latin hypercube sample
oRandoma random number generator
isRandomis the result randomized