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

Base class for the shared approximation data class hierarchy. More...

Inheritance diagram for SharedApproxData:
SharedC3ApproxData SharedPecosApproxData SharedSurfpackApproxData

Public Member Functions

 SharedApproxData ()
 default constructor More...
 
 SharedApproxData (ProblemDescDB &problem_db, size_t num_vars)
 standard constructor for envelope More...
 
 SharedApproxData (const String &approx_type, const UShortArray &approx_order, size_t num_vars, short data_order, short output_level)
 alternate constructor for envelope More...
 
 SharedApproxData (const SharedApproxData &approx)
 copy constructor More...
 
virtual ~SharedApproxData ()
 destructor
 
SharedApproxData operator= (const SharedApproxData &approx)
 assignment operator
 
virtual void active_model_key (const Pecos::ActiveKey &key)
 activate an approximation state based on its multi-index key
 
virtual void clear_model_keys ()
 reset initial state by clearing all model keys for an approximation
 
virtual void integration_iterator (const Iterator &iterator)
 set integration driver for structured grid approximations
 
virtual short discrepancy_reduction () const
 return the discrepancy type for approximations that support MLMF
 
virtual void build ()
 builds the shared approximation data from scratch
 
virtual void rebuild ()
 rebuilds the shared approximation data incrementally
 
virtual void pop (bool save_surr_data)
 back out the previous increment to the shared approximation data
 
virtual bool push_available ()
 queries availability of pushing data associated with a trial set
 
virtual size_t push_index (const Pecos::ActiveKey &key)
 return index for restoring trial set within stored data sets
 
virtual void pre_push ()
 push a previous state of the shared approximation data
 
virtual void post_push ()
 clean up popped bookkeeping following push
 
virtual size_t finalize_index (size_t i, const Pecos::ActiveKey &key)
 return index of i-th trial set within restorable bookkeeping sets
 
virtual void pre_finalize ()
 finalize the shared approximation data following a set of increments
 
virtual void post_finalize ()
 clean up popped bookkeeping following aggregation
 
virtual void clear_inactive ()
 clear inactive approximation data
 
virtual void pre_combine ()
 aggregate the shared approximation data from current and stored states
 
virtual void post_combine ()
 clean up stored data sets after aggregation
 
virtual void combined_to_active (bool clear_combined=true)
 promote aggregated data sets to active state
 
virtual bool advancement_available ()
 queries availability of advancing the approximation resolution
 
virtual void increment_order ()
 increments polynomial expansion order (PCE, FT)
 
virtual void decrement_order ()
 decrements polynomial expansion order (PCE, FT)
 
virtual void construct_basis (const Pecos::MultivariateDistribution &mv_dist)
 construct the shared basis for an expansion-based approximation
 
virtual void update_basis_distribution_parameters (const Pecos::MultivariateDistribution &mvd)
 propagate updates to random variable distribution parameters to a polynomial basis
 
virtual void configuration_options (const Pecos::ExpansionConfigOptions &ec_options)
 set ExpansionConfigOptions instance as a group specification
 
virtual void configuration_options (const Pecos::BasisConfigOptions &bc_options)
 set BasisConfigOptions instance as a group specification
 
virtual void configuration_options (const Pecos::RegressionConfigOptions &rc_options)
 set BasisConfigOptions instance as a group specification
 
virtual void random_variables_key (const BitArray &random_vars_key)
 assign key identifying a subset of variables that are to be treated as random for statistical purposes (e.g. expectation)
 
virtual void refinement_statistics_mode (short stats_mode)
 assign mode for statistics roll-up: {ACTIVE,COMBINED}_EXPANSION_STATS
 
virtual const Pecos::BitArrayULongMap & sobol_index_map () const
 return set of Sobol indices that have been requested (e.g., as constrained by throttling) and are computable by a (sparse) expansion of limited order
 
const Pecos::ActiveKey & active_model_key () const
 return active multi-index key
 
void discrepancy_emulation_mode (short mode)
 set discrepancy emulation mode for approximating response differences
 
short discrepancy_emulation_mode () const
 return discrepancy emulation mode for approximating response differences
 
bool formulation_updated () const
 query whether the form of an approximation has been updated
 
void formulation_updated (bool update)
 assign the status of approximation formulation updates
 
void set_bounds (const RealVector &c_l_bnds, const RealVector &c_u_bnds, const IntVector &di_l_bnds, const IntVector &di_u_bnds, const RealVector &dr_l_bnds, const RealVector &dr_u_bnds)
 set approximation lower and upper bounds (currently only used by graphics)
 
std::shared_ptr< SharedApproxDatadata_rep () const
 returns dataRep for access to derived class member functions that are not mapped to the top SharedApproxData level
 

Protected Member Functions

 SharedApproxData (BaseConstructor, ProblemDescDB &problem_db, size_t num_vars)
 constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More...
 
 SharedApproxData (NoDBBaseConstructor, const String &approx_type, size_t num_vars, short data_order, short output_level)
 constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More...
 

Protected Attributes

size_t numVars
 number of variables in the approximation
 
String approxType
 approximation type identifier
 
short buildDataOrder
 order of the data used for surrogate construction, in ActiveSet request vector 3-bit format. More...
 
short outputLevel
 output verbosity level: {SILENT,QUIET,NORMAL,VERBOSE,DEBUG}_OUTPUT
 
Pecos::ActiveKey activeKey
 key indicating the active model or model-pair used for approximation data
 
short discrepEmulationMode
 approach for emulating response differences: {DEFAULT,DISTINCT,RECURSIVE}_EMULATION
 
String modelExportPrefix
 Prefix for model export files.
 
unsigned short modelExportFormat
 Bitmapped format request for exported models.
 
RealVector approxCLowerBnds
 approximation continuous lower bounds (used by 3D graphics and Surfpack KrigingModel)
 
RealVector approxCUpperBnds
 approximation continuous upper bounds (used by 3D graphics and Surfpack KrigingModel)
 
IntVector approxDILowerBnds
 approximation continuous lower bounds
 
IntVector approxDIUpperBnds
 approximation continuous upper bounds
 
RealVector approxDRLowerBnds
 approximation continuous lower bounds
 
RealVector approxDRUpperBnds
 approximation continuous upper bounds
 
std::map< Pecos::ActiveKey, bool > formUpdated
 tracker for changes in order,rank configuration since last build (used by DataFitSurrModel::rebuild_approximation())
 

Private Member Functions

std::shared_ptr< SharedApproxDataget_shared_data (ProblemDescDB &problem_db, size_t num_vars)
 Used only by the standard envelope constructor to initialize dataRep to the appropriate derived type. More...
 
std::shared_ptr< SharedApproxDataget_shared_data (const String &approx_type, const UShortArray &approx_order, size_t num_vars, short data_order, short output_level)
 Used only by the alternate envelope constructor to initialize dataRep to the appropriate derived type. More...
 

Private Attributes

std::shared_ptr< SharedApproxDatadataRep
 pointer to the letter (initialized only for the envelope)
 

Friends

class Approximation
 
class TaylorApproximation
 
class TANA3Approximation
 
class QMEApproximation
 
class GaussProcApproximation
 
class VPSApproximation
 
class PecosApproximation
 
class C3Approximation
 
class SurfpackApproximation
 
class SurrogatesGPApprox
 
class SurrogatesBaseApprox
 
class SurrogatesPolyApprox
 
class SurrogatesPythonApprox
 

Detailed Description

Base class for the shared approximation data class hierarchy.

The SharedApproxData class is the base class for the shared approximation data class hierarchy in DAKOTA. For memory efficiency and enhanced polymorphism, the approximation hierarchy employs the "letter/envelope idiom" (see Coplien "Advanced C++", p. 133), for which the base class (SharedApproxData) serves as the envelope and one of the derived classes (selected in SharedApproxData::get_shared_data()) serves as the letter.

Constructor & Destructor Documentation

◆ SharedApproxData() [1/6]

default constructor

For the default constructor, dataRep is NULL.

Referenced by SharedApproxData::get_shared_data().

◆ SharedApproxData() [2/6]

SharedApproxData ( ProblemDescDB problem_db,
size_t  num_vars 
)

standard constructor for envelope

Envelope constructor only needs to extract enough data to properly execute get_shared_data, since SharedApproxData(BaseConstructor, problem_db) builds the actual base class data for the derived approximations.

References Dakota::abort_handler(), and SharedApproxData::dataRep.

◆ SharedApproxData() [3/6]

SharedApproxData ( const String &  approx_type,
const UShortArray &  approx_order,
size_t  num_vars,
short  data_order,
short  output_level 
)

alternate constructor for envelope

This is the alternate envelope constructor for instantiations on the fly. Since it does not have access to problem_db, it utilizes the NoDBBaseConstructor constructor chain.

References Dakota::abort_handler(), and SharedApproxData::dataRep.

◆ SharedApproxData() [4/6]

SharedApproxData ( const SharedApproxData shared_data)

copy constructor

Copy constructor manages sharing of dataRep.

◆ SharedApproxData() [5/6]

SharedApproxData ( BaseConstructor  ,
ProblemDescDB problem_db,
size_t  num_vars 
)
protected

constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139)

This constructor is the one which must build the base class data for all derived classes. get_shared_data() instantiates a derived class letter and the derived constructor selects this base class constructor in its initialization list (to avoid recursion in the base class constructor calling get_shared_data() again). Since the letter IS the representation, its rep pointer is set to NULL (an uninitialized pointer causes problems in ~SharedApproxData).

References SharedApproxData::approxType, SharedApproxData::buildDataOrder, ProblemDescDB::get_bool(), ProblemDescDB::get_db_model_node(), ProblemDescDB::get_string(), ProblemDescDB::set_db_model_nodes(), Dakota::strbegins(), and Dakota::strends().

◆ SharedApproxData() [6/6]

SharedApproxData ( NoDBBaseConstructor  ,
const String &  approx_type,
size_t  num_vars,
short  data_order,
short  output_level 
)
protected

constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139)

This constructor is the one which must build the base class data for all derived classes. get_shared_data() instantiates a derived class letter and the derived constructor selects this base class constructor in its initialization list (to avoid recursion in the base class constructor calling get_shared_data() again). Since the letter IS the representation, its rep pointer is set to NULL (an uninitialized pointer causes problems in ~SharedApproxData).

References SharedApproxData::approxType, SharedApproxData::buildDataOrder, Dakota::strbegins(), and Dakota::strends().

Member Function Documentation

◆ get_shared_data() [1/2]

std::shared_ptr< SharedApproxData > get_shared_data ( ProblemDescDB problem_db,
size_t  num_vars 
)
private

Used only by the standard envelope constructor to initialize dataRep to the appropriate derived type.

Used only by the envelope constructor to initialize dataRep to the appropriate derived type.

References ProblemDescDB::get_string(), SharedApproxData::SharedApproxData(), and Dakota::strends().

◆ get_shared_data() [2/2]

std::shared_ptr< SharedApproxData > get_shared_data ( const String &  approx_type,
const UShortArray &  approx_order,
size_t  num_vars,
short  data_order,
short  output_level 
)
private

Used only by the alternate envelope constructor to initialize dataRep to the appropriate derived type.

Used only by the envelope constructor to initialize dataRep to the appropriate derived type.

References SharedApproxData::SharedApproxData(), and Dakota::strends().

Member Data Documentation

◆ buildDataOrder

short buildDataOrder
protected

order of the data used for surrogate construction, in ActiveSet request vector 3-bit format.

This setting distinguishes derivative data intended for use in construction (includes derivatives w.r.t. the build variables) from derivative data that may be approximated separately (excludes derivatives w.r.t. auxilliary variables). This setting should also not be inferred directly from the responses specification, since we may need gradient support for evaluating gradients at a single point (e.g., the center of a trust region), but not require gradient evaluations at every point.

Referenced by SharedSurfpackApproxData::add_sd_to_surfdata(), SharedApproxData::SharedApproxData(), and SharedPecosApproxData::SharedPecosApproxData().


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