Dakota  Version 6.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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:
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 More...
 
SharedApproxData operator= (const SharedApproxData &approx)
 assignment operator More...
 
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 retrieval_index ()
 return index of trial set within popped bookkeeping 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 finalization_index (size_t i)
 return index of i-th trailing 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 store (size_t index=_NPOS)
 store the current state of the shared approximation data for later combination (defaults to push_back)
 
virtual void restore (size_t index=_NPOS)
 restore a previous state of the shared approximation data (defaults to pop_back from stored)
 
virtual void remove_stored (size_t index=_NPOS)
 remove an instance of stored approximation data prior to combination (defaults to pop_back)
 
virtual size_t pre_combine (short corr_type)
 aggregate the shared approximation data from current and stored states
 
virtual void post_combine (short corr_type)
 clean up stored data sets after aggregation
 
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)
 
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
 
String modelExportPrefix
 Prefix for model export files.
 
unsigned short modelExportFormat
 Bitmapped format reques 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
 

Private Member Functions

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...
 
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

SharedApproxDatadataRep
 pointer to the letter (initialized only for the envelope)
 
int referenceCount
 number of objects sharing dataRep
 

Friends

class Approximation
 
class TaylorApproximation
 
class TANA3Approximation
 
class GaussProcApproximation
 
class VPSApproximation
 
class SurfpackApproximation
 
class PecosApproximation
 

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

default constructor

For the default constructor, dataRep is NULL. This makes it necessary to check for NULL in the copy constructor, assignment operator, and destructor.

Referenced by SharedApproxData::get_shared_data().

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(), SharedApproxData::dataRep, and SharedApproxData::get_shared_data().

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(), SharedApproxData::dataRep, and SharedApproxData::get_shared_data().

SharedApproxData ( const SharedApproxData shared_data)

copy constructor

Copy constructor manages sharing of dataRep and incrementing of referenceCount.

References SharedApproxData::dataRep, and SharedApproxData::referenceCount.

~SharedApproxData ( )
virtual

destructor

Destructor decrements referenceCount and only deletes dataRep when referenceCount reaches zero.

References SharedApproxData::dataRep, and SharedApproxData::referenceCount.

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 ( 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

SharedApproxData operator= ( const SharedApproxData shared_data)

assignment operator

Assignment operator decrements referenceCount for old dataRep, assigns new dataRep, and increments referenceCount for new dataRep.

References SharedApproxData::dataRep, and SharedApproxData::referenceCount.

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().

Referenced by SharedApproxData::SharedApproxData().

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

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(), TaylorApproximation::build(), TaylorApproximation::gradient(), TaylorApproximation::hessian(), TaylorApproximation::min_coefficients(), Approximation::min_points(), Approximation::recommended_points(), SharedApproxData::SharedApproxData(), SharedPecosApproxData::SharedPecosApproxData(), SurfpackApproximation::SurfpackApproximation(), SurfpackApproximation::surrogates_to_surf_data(), TANA3Approximation::TANA3Approximation(), and TaylorApproximation::value().


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