Dakota  Version 6.20
Explore and Predict with Confidence
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Rank1Lattice Class Reference

Class for rank-1 lattice rules in Dakota. More...

Inheritance diagram for Rank1Lattice:
LowDiscrepancySequence

Public Member Functions

 Rank1Lattice (const UInt32Vector &generatingVector, int mMax, bool randomShiftFlag, int seedValue, Rank1LatticeOrdering ordering, short outputLevel)
 Default constructor. More...
 
 Rank1Lattice (const UInt32Vector &generatingVector, int mMax)
 A constructor that uses radical inverse ordering and a random shift.
 
 Rank1Lattice (int seedValue)
 A constructor with only the random seed as argument.
 
 Rank1Lattice ()
 A constructor with no arguments.
 
 Rank1Lattice (ProblemDescDB &problem_db)
 A constructor that takes a problem description database.
 
 Rank1Lattice (std::tuple< UInt32Vector, int > data, ProblemDescDB &problem_db)
 A constructor that takes a tuple and a problem description database The tuple contains the generating vector and corresponding log2 of the maximum number of points. More...
 
 ~Rank1Lattice ()
 Destructor.
 
void randomize ()
 Randomize this rank-1 lattice rule NOTE: required for 'unique' sampling in NonDLowDiscrepancySampling
 
void random_shift ()
 Randomly shift this rank-1 lattice rule.
 
void no_random_shift ()
 Do not randomly shift this rank-1 lattice rule.
 
- Public Member Functions inherited from LowDiscrepancySequence
 LowDiscrepancySequence (int mMax, int dMax, int seedValue, short outputLevel)
 Default constructor. More...
 
void get_points (RealMatrix &points)
 Get points from this low-discrepancy generator This function will store the points in-place in the matrix points Each column of points contains a dimension-dimensional point where dimension is equal to the number of rows of points and the number of points is equal to the number of columns of points
 
void get_points (const size_t n, RealMatrix &points)
 Get the first n points from this low-discrepancy generator This function will store the points in-place in the matrix points Each column of points contains a dimension-dimensional point where dimension is equal to the number of rows of points
 
void get_points (const size_t nMin, const size_t nMax, RealMatrix &points)
 Generates low-discrepancy points between given indices Returns the points with index nMin, nMin + 1, ..., nMax - 1 This function will store the points in-place in the matrix points Each column of points contains a dimension-dimensional point. More...
 

Private Member Functions

std::tuple< UInt32Vector, int > get_data (ProblemDescDB &problem_db)
 Extract the generating vector and log2 of the maximum number of points from the given problem description database. More...
 
const std::tuple< UInt32Vector, int > get_generating_vector_from_file (ProblemDescDB &problem_db)
 Case I: the generating vector is provided in an external file. More...
 
const std::tuple< UInt32Vector, int > get_inline_generating_vector (ProblemDescDB &problem_db)
 Case II: the generating vector is provided in the input file. More...
 
const std::tuple< UInt32Vector, int > get_default_generating_vector (ProblemDescDB &problem_db)
 Case III: a default generating vector has been selected. More...
 
void random_shift (int seed)
 Apply random shift to this rank-1 lattice rule Uses the given seed to initialize the RNG When the seed is < 0, the random shift will be removed. More...
 
void unsafe_get_points (const size_t nMin, const size_t nMax, RealMatrix &points)
 Generates rank-1 lattice points without error checking. More...
 
UInt32 reorder_natural (UInt32 k)
 Position of the kth lattice point in RANK_1_LATTICE_NATURAL_ORDERING.
 
UInt32 reorder_radical_inverse (UInt32 k)
 Position of the kth lattice point in RANK_1_LATTICE_RADICAL_INVERSE_ORDERING.
 

Private Attributes

UInt32Vector generatingVector
 Generating vector of this rank-1 lattice rule.
 
bool randomShiftFlag
 Randomize this rank-1 lattice rule if true.
 
RealVector randomShift
 Random shift associated with this rank-1 lattice rule.
 
Rank1LatticeOrdering ordering
 Order of the points of this rank-1 lattice rule.
 
Real scale
 Scale factor for rank-1 lattice points.
 
UInt32(Rank1Lattice::* reorder )(UInt32)
 Function pointer to the chosen order of the points.
 

Additional Inherited Members

- Protected Member Functions inherited from LowDiscrepancySequence
void check_sizes (const size_t nMin, const size_t nMax, RealMatrix &points)
 Perform checks on the matrix points Each column of points contains a dimension-dimensional point where dimension is equal to the number of rows of points The number of points numPoints is nMax - nMin Checks if the requested number of points numPoints exceeds the maximum number of points allowed in this low-discrepancy sequence Checks if the number of rows of the matrix points exceeds the maximum dimension allowed in this low-discrepancy sequence Checks if the matrix points has numPoints columns. More...
 
- Protected Attributes inherited from LowDiscrepancySequence
int dMax
 Maximum dimension of this low-discrepancy sequence.
 
int mMax
 log2 of the maximum number of points of this low-discrepancy sequence More...
 
int seedValue
 The seed of this low-discrepancy sequence.
 
short outputLevel
 The output verbosity level, can be one of {SILENT, QUIET, NORMAL, VERBOSE, DEBUG}_OUTPUT.
 

Detailed Description

Class for rank-1 lattice rules in Dakota.

Constructor & Destructor Documentation

◆ Rank1Lattice() [1/2]

Rank1Lattice ( const UInt32Vector &  generatingVector,
int  mMax,
bool  randomShiftFlag,
int  seedValue,
Rank1LatticeOrdering  ordering,
short  outputLevel 
)

Default constructor.

Print summary info when debugging

Options for setting the random shift of this rank-1 lattice rule

Print random shift vector when debugging

Print warning about missing random shift (will include the 0 point)

Options for setting the ordering of this rank-1 lattice rule

Parameters
mMaxGenerating vector
randomShiftFlaglog2 of maximum number of points
seedValueUse random shift if true
orderingRandom seed value
outputLevelOrder of the lattice points Verbosity

References Dakota::abort_handler(), LowDiscrepancySequence::dMax, Rank1Lattice::generatingVector, Dakota::length(), LowDiscrepancySequence::mMax, Rank1Lattice::ordering, LowDiscrepancySequence::outputLevel, Rank1Lattice::random_shift(), Rank1Lattice::randomShift, Rank1Lattice::randomShiftFlag, Rank1Lattice::reorder, Rank1Lattice::reorder_natural(), Rank1Lattice::reorder_radical_inverse(), Rank1Lattice::scale, and LowDiscrepancySequence::seedValue.

◆ Rank1Lattice() [2/2]

Rank1Lattice ( std::tuple< UInt32Vector, int >  data,
ProblemDescDB problem_db 
)

A constructor that takes a tuple and a problem description database The tuple contains the generating vector and corresponding log2 of the maximum number of points.

A constructor that takes a tuple and a problem description database.

Member Function Documentation

◆ get_data()

std::tuple< UInt32Vector, int > get_data ( ProblemDescDB problem_db)
private

Extract the generating vector and log2 of the maximum number of points from the given problem description database.

Extract the generating vector and log2 of the maximum number of points from the given problem description database There are 3 different ways to specify a generating vector:

+-----------------------------------------------—+ | Case I: "generating_vector file [...]" | +-----------------------------------------------—+ The generating vector will be read from the file with the given name

+-----------------------------------------------—+ | Case II: "generating_vector inline [...]" | +-----------------------------------------------—+ Assumes the generating vector is given as an inline sequence of integers

+-----------------------------------------------—+ | Case III: "generating_vector predefined [...]" | +-----------------------------------------------—+ The given name should match the name of a predefined generating vector Choose one of:

  • cools_kuo_nuyens
  • kuo

Name of the file with the generating vector

Get the inline generating vector

NOTE: outputLevel has not been set yet, so gettting it directly from the 'problem_db' instead

Case I: the generating vector is provided in an external file

Case II: the generating vector is provided in the input file

Case III: a default generating vector has been selected

Verify that mMax has not been provided

References Dakota::abort_handler(), Rank1Lattice::get_default_generating_vector(), Rank1Lattice::get_generating_vector_from_file(), Rank1Lattice::get_inline_generating_vector(), ProblemDescDB::get_int(), ProblemDescDB::get_iv(), ProblemDescDB::get_short(), ProblemDescDB::get_string(), and LowDiscrepancySequence::outputLevel.

◆ get_generating_vector_from_file()

const std::tuple< UInt32Vector, int > get_generating_vector_from_file ( ProblemDescDB problem_db)
private

Case I: the generating vector is provided in an external file.

Wrap in try-block

Catch-all handler

References Dakota::abort_handler(), Rank1Lattice::generatingVector, ProblemDescDB::get_int(), and ProblemDescDB::get_string().

Referenced by Rank1Lattice::get_data().

◆ get_inline_generating_vector()

const std::tuple< UInt32Vector, int > get_inline_generating_vector ( ProblemDescDB problem_db)
private

Case II: the generating vector is provided in the input file.

Get the inline generating vector

Can't get away without making a copy here, conversion from int to UInt32, maybe there's a smarter way to do this? NOTE: that smarter way would probably mean implementing 'UINT32LIST' instead of 'INTEGERLIST'

References Rank1Lattice::generatingVector, ProblemDescDB::get_int(), and ProblemDescDB::get_iv().

Referenced by Rank1Lattice::get_data().

◆ get_default_generating_vector()

const std::tuple< UInt32Vector, int > get_default_generating_vector ( ProblemDescDB problem_db)
private

Case III: a default generating vector has been selected.

NOTE: outputLevel has not been set yet, so gettting it directly from the 'problem_db' instead

Select predefined generating vector

References Dakota::cools_kuo_nuyens_d250_m20, ProblemDescDB::get_bool(), ProblemDescDB::get_short(), Dakota::kuo_d3600_m20, and LowDiscrepancySequence::outputLevel.

Referenced by Rank1Lattice::get_data().

◆ random_shift()

void random_shift ( int  seed)
private

Apply random shift to this rank-1 lattice rule Uses the given seed to initialize the RNG When the seed is < 0, the random shift will be removed.

Randomize this low-discrepancy sequence Uses the given seed to initialize the RNG When the seed is < 0, the random shift will be removed.

NOTE: lhsDriver is really slow, switching to boost since variables are uncorrelated

Sets all entries to 0

References LowDiscrepancySequence::dMax, and Rank1Lattice::randomShift.

◆ unsafe_get_points()

void unsafe_get_points ( const size_t  nMin,
const size_t  nMax,
RealMatrix &  points 
)
privatevirtual

Generates rank-1 lattice points without error checking.

Generates rank-1 lattice points without error checking Returns the points with index nMin, nMin + 1, ..., nMax - 1 This function will store the points in-place in the matrix points Each column of points contains a dimension-dimensional point where dimension is equal to the number of rows of points

Loop over all points

phi(k)

Loop over all dimensions

Map to [0, 1)

Implements LowDiscrepancySequence.

References Rank1Lattice::generatingVector, Rank1Lattice::randomShift, Rank1Lattice::reorder, and Rank1Lattice::scale.


The documentation for this class was generated from the following files: