Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ApproximationInterface Class Reference

Derived class within the interface class hierarchy for supporting approximations to simulation-based results. More...

Inheritance diagram for ApproximationInterface:
Interface

List of all members.

Public Member Functions

 ApproximationInterface (ProblemDescDB &problem_db, const Variables &am_vars, bool am_cache, const String &am_interface_id, size_t num_fns)
 primary constructor
 ApproximationInterface (const String &approx_type, const UShortArray &approx_order, const Variables &am_vars, bool am_cache, const String &am_interface_id, size_t num_fns, short data_order, short output_level)
 alternate constructor for instantiations on the fly
 ~ApproximationInterface ()
 destructor

Protected Member Functions

void map (const Variables &vars, const ActiveSet &set, Response &response, const bool asynch_flag=false)
 the function evaluator: provides an approximate "mapping" from the variables to the responses using functionSurfaces
int minimum_points (bool constraint_flag) const
 returns the minimum number of samples required to build the functionSurfaces
int recommended_points (bool constraint_flag) const
 returns the recommended number of samples recommended to build the functionSurfaces
void approximation_function_indices (const IntSet &approx_fn_indices)
 set the (currently active) approximation function index set
void update_approximation (const Variables &vars, const IntResponsePair &response_pr)
void update_approximation (const RealMatrix &samples, const IntResponseMap &resp_map)
void update_approximation (const VariablesArray &vars_array, const IntResponseMap &resp_map)
void append_approximation (const Variables &vars, const IntResponsePair &response_pr)
void append_approximation (const RealMatrix &samples, const IntResponseMap &resp_map)
void append_approximation (const VariablesArray &vars_array, const IntResponseMap &resp_map)
void build_approximation (const RealVector &lower_bnds, const RealVector &upper_bnds)
void rebuild_approximation (const BoolDeque &rebuild_deque)
void pop_approximation (bool save_surr_data)
void restore_approximation ()
bool restore_available ()
void finalize_approximation ()
 finalizes the approximation by applying all trial increments
void store_approximation ()
 move the current approximation into storage for later combination
void combine_approximation (short corr_type)
 combine the current approximation with one previously stored
void clear_current ()
 clears current data from an approximation interface
void clear_all ()
 clears all data from an approximation interface
std::vector< Approximation > & approximations ()
 retrieve the Approximations within an ApproximationInterface
const Pecos::SurrogateData & approximation_data (size_t index)
 retrieve the approximation data from a particular Approximation within an ApproximationInterface
const RealVectorArray & approximation_coefficients ()
 retrieve the approximation coefficients from each Approximation within an ApproximationInterface
void approximation_coefficients (const RealVectorArray &approx_coeffs)
 set the approximation coefficients within each Approximation within an ApproximationInterface
const RealVector & approximation_variances (const RealVector &c_vars)
 retrieve the approximation variances from each Approximation within an ApproximationInterface
const IntResponseMap & synch ()
 recovers data from a series of asynchronous evaluations (blocking)
const IntResponseMap & synch_nowait ()
 recovers data from a series of asynchronous evaluations (nonblocking)

Private Member Functions

void mixed_add (const Variables &vars, const Response &response, bool anchor)
 add variables/response data to functionSurfaces using a mixture of shallow and deep copies
void mixed_add (const Real *c_vars, const Response &response, bool anchor)
 add variables/response data to functionSurfaces using a mixture of shallow and deep copies
void shallow_add (const Variables &vars, const Response &response, bool anchor)
 add variables/response data to functionSurfaces using a shallow copy
void update_pop_counts (const IntResponseMap &resp_map)
 update the popCount within each of the functionSurfaces based on the active set definitions within resp_map

Private Attributes

IntSet approxFnIndices
 for incomplete approximation sets, this array specifies the response function subset that is approximated
std::vector< ApproximationfunctionSurfaces
 list of approximations, one per response function
RealVectorArray functionSurfaceCoeffs
 array of approximation coefficient vectors, one vector per response function
RealVector functionSurfaceVariances
 vector of approximation variances, one value per response function
StringArray diagnosticSet
 set of diagnostic metrics
Variables actualModelVars
 copy of the actualModel variables object used to simplify conversion among differing variable views
bool actualModelCache
 indicates usage of an evaluation cache by the actualModel
String actualModelInterfaceId
 the interface id from the actualModel used for ordered PRPCache lookups
IntResponseMap beforeSynchResponseMap
 bookkeeping map to catalogue responses generated in map() for use in synch() and synch_nowait(). This supports pseudo-asynchronous operations (approximate responses are always computed synchronously, but asynchronous virtual functions are supported through bookkeeping).

Detailed Description

Derived class within the interface class hierarchy for supporting approximations to simulation-based results.

ApproximationInterface provides an interface class for building a set of global/local/multipoint approximations and performing approximate function evaluations using them. It contains a list of Approximation objects, one for each response function.


Member Function Documentation

void update_approximation ( const Variables vars,
const IntResponsePair &  response_pr 
) [protected, virtual]

This function populates/replaces each Approximation::anchorPoint with the incoming variables/response data point.

Reimplemented from Interface.

References ApproximationInterface::actualModelCache, ApproximationInterface::actualModelInterfaceId, Dakota::data_pairs, Dakota::lookup_by_ids(), ApproximationInterface::mixed_add(), and ApproximationInterface::shallow_add().

void update_approximation ( const RealMatrix &  samples,
const IntResponseMap &  resp_map 
) [protected, virtual]
void update_approximation ( const VariablesArray &  vars_array,
const IntResponseMap &  resp_map 
) [protected, virtual]
void append_approximation ( const Variables vars,
const IntResponsePair &  response_pr 
) [protected, virtual]
void append_approximation ( const RealMatrix &  samples,
const IntResponseMap &  resp_map 
) [protected, virtual]
void append_approximation ( const VariablesArray &  vars_array,
const IntResponseMap &  resp_map 
) [protected, virtual]
void build_approximation ( const RealVector &  lower_bnds,
const RealVector &  upper_bnds 
) [protected, virtual]

This function finds the coefficients for each Approximation based on the data passed through update_approximation() calls. The bounds are used only for graphics visualization.

Reimplemented from Interface.

References ApproximationInterface::approxFnIndices, ApproximationInterface::diagnosticSet, ApproximationInterface::functionSurfaces, and Interface::outputLevel.

void rebuild_approximation ( const BoolDeque &  rebuild_deque) [protected, virtual]

This function updates the coefficients for each Approximation based on data increments provided by {update,append}_approximation().

Reimplemented from Interface.

References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.

void pop_approximation ( bool  save_surr_data) [protected, virtual]

This function removes data provided by a previous call to append_approximation().

Reimplemented from Interface.

References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.

void restore_approximation ( ) [protected, virtual]

This function updates the coefficients for each Approximation based on data increments provided by {update,append}_approximation().

Reimplemented from Interface.

References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.

bool restore_available ( ) [protected, virtual]

This function updates the coefficients for each Approximation based on data increments provided by {update,append}_approximation().

Reimplemented from Interface.

References ApproximationInterface::approxFnIndices, and ApproximationInterface::functionSurfaces.


Member Data Documentation

std::vector<Approximation> functionSurfaces [private]

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