$extrastylesheet
Dakota  Version 6.2
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
SharedApproxData Class Reference

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

Inheritance diagram for SharedApproxData:
SharedPecosApproxData SharedSurfpackApproxData

List of all members.

Public Member Functions

 SharedApproxData ()
 default constructor
 SharedApproxData (ProblemDescDB &problem_db, size_t num_vars)
 standard constructor for envelope
 SharedApproxData (const String &approx_type, const UShortArray &approx_order, size_t num_vars, short data_order, short output_level)
 alternate constructor for envelope
 SharedApproxData (const SharedApproxData &approx)
 copy constructor
virtual ~SharedApproxData ()
 destructor
SharedApproxData operator= (const SharedApproxData &approx)
 assignment operator
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 restore_available ()
 queries availability of restoration for trial set
virtual size_t restoration_index ()
 return index of trial set within restorable bookkeeping sets
virtual void pre_restore ()
 restore a previous state of the shared approximation data
virtual void post_restore ()
 clean up saved storage following restoration
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 saved storage following aggregation
virtual void store ()
 store the current state of the shared approximation data for later combination
virtual void pre_combine (short corr_type)
 aggregate the shared approximation data from current and saved states
virtual void post_combine (short corr_type)
 clean up saved storage 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)
 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)

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.
short outputLevel
 output verbosity level: {SILENT,QUIET,NORMAL,VERBOSE,DEBUG}_OUTPUT
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.
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.

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: