Inheritance diagram for RecastModel:
Public Member Functions | |
RecastModel (Model &sub_model, const Sizet2DArray &vars_map_indices, bool nonlinear_vars_mapping, void(*variables_map)(const Variables &recast_vars, Variables &sub_model_vars), void(*set_map)(const ActiveSet &recast_set, ActiveSet &sub_model_set), const Sizet2DArray &primary_resp_map_indices, const Sizet2DArray &secondary_resp_map_indices, size_t recast_secondary_offset, const BoolDequeArray &nonlinear_resp_mapping, void(*primary_resp_map)(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response), void(*secondary_resp_map)(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response)) | |
standard constructor | |
RecastModel (Model &sub_model, size_t num_recast_primary_fns, size_t num_recast_secondary_fns, size_t recast_secondary_offset) | |
alternate constructor | |
~RecastModel () | |
destructor | |
void | initialize (const Sizet2DArray &vars_map_indices, bool nonlinear_vars_mapping, void(*variables_map)(const Variables &recast_vars, Variables &sub_model_vars), void(*set_map)(const ActiveSet &recast_set, ActiveSet &sub_model_set), const Sizet2DArray &primary_resp_map_indices, const Sizet2DArray &secondary_resp_map_indices, const BoolDequeArray &nonlinear_resp_mapping, void(*primary_resp_map)(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response), void(*secondary_resp_map)(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response)) |
completes initialization of the RecastModel after alternate construction | |
void | submodel_supports_estimated_derivatives (bool ssed_flag) |
override the submodel's derivative estimation behavior | |
Protected Member Functions | |
void | derived_compute_response (const ActiveSet &set) |
(forward to subModel.compute_response()) | |
void | derived_asynch_compute_response (const ActiveSet &set) |
(forward to subModel.asynch_compute_response()) | |
const IntResponseMap & | derived_synchronize () |
(forward to subModel.synchronize()) | |
const IntResponseMap & | derived_synchronize_nowait () |
(forward to subModel.synchronize_nowait()) | |
Iterator & | subordinate_iterator () |
return sub-iterator, if present, within subModel | |
Model & | subordinate_model () |
return subModel | |
Model & | surrogate_model () |
return surrogate model, if present, within subModel | |
Model & | truth_model () |
return truth model, if present, within subModel | |
void | derived_subordinate_models (ModelList &ml, bool recurse_flag) |
add subModel to list and recurse into subModel | |
void | update_from_subordinate_model (bool recurse_flag=true) |
pass request to subModel if recursing and then update from it | |
Interface & | interface () |
return subModel interface | |
void | surrogate_function_indices (const IntSet &surr_fn_indices) |
forward to subModel | |
void | surrogate_bypass (bool bypass_flag) |
models contained within this model | |
void | build_approximation () |
builds the subModel approximation | |
bool | build_approximation (const Variables &vars, const Response &response) |
builds the subModel approximation | |
void | update_approximation (const Variables &vars, const Response &response, bool rebuild_flag) |
updates the subModel approximation | |
void | update_approximation (const VariablesArray &vars_array, const ResponseArray &resp_array, bool rebuild_flag) |
updates the subModel approximation | |
void | append_approximation (const Variables &vars, const Response &response, bool rebuild_flag) |
appends the subModel approximation | |
void | append_approximation (const VariablesArray &vars_array, const ResponseArray &resp_array, bool rebuild_flag) |
appends the subModel approximation | |
Array< Approximation > & | approximations () |
retrieve the set of Approximations from the subModel | |
const RealVectorArray & | approximation_coefficients () |
retrieve the approximation coefficients from the subModel | |
void | approximation_coefficients (const RealVectorArray &approx_coeffs) |
set the approximation coefficients within the subModel | |
void | print_coefficients (ostream &s, size_t index) const |
print a particular set of approximation coefficients within the subModel | |
const RealVector & | approximation_variances (const RealVector &c_vars) |
retrieve the approximation variances from the subModel | |
const List< SurrogateDataPoint > & | approximation_data (size_t index) |
retrieve the approximation data from the subModel | |
void | component_parallel_mode (short mode) |
virtual function redefinition is simply a sanity check. | |
String | local_eval_synchronization () |
return subModel local synchronization setting | |
int | local_eval_concurrency () |
return subModel local evaluation concurrency | |
bool | derived_master_overload () const |
evaluation (request forwarded to subModel) | |
void | derived_init_communicators (const int &max_iterator_concurrency, bool recurse_flag=true) |
set up RecastModel for parallel operations (request forwarded to subModel) | |
void | derived_init_serial () |
set up RecastModel for serial operations (request forwarded to subModel). | |
void | derived_set_communicators (const int &max_iterator_concurrency, bool recurse_flag=true) |
set active parallel configuration within subModel | |
void | derived_free_communicators (const int &max_iterator_concurrency, bool recurse_flag=true) |
to subModel) | |
void | serve () |
Completes when a termination message is received from stop_servers(). | |
void | stop_servers () |
when RecastModel iteration is complete. | |
const String & | interface_id () const |
return the subModel interface identifier | |
int | evaluation_id () const |
forwarded to subModel) | |
void | set_evaluation_reference () |
(request forwarded to subModel) | |
void | fine_grained_evaluation_counters () |
request fine-grained evaluation reporting within subModel | |
void | print_evaluation_summary (ostream &s, bool minimal_header=false, bool relative_count=true) const |
forwarded to subModel) | |
Private Member Functions | |
void | set_mapping (const ActiveSet &recast_set, ActiveSet &sub_model_set) |
into sub_model_set for use with subModel. | |
void | update_from_sub_model () |
update current variables/labels/bounds/targets from subModel | |
Private Attributes | |
Model | subModel |
the sub-model underlying the function pointers | |
Sizet2DArray | varsMapIndices |
subModel variables) | |
bool | nonlinearVarsMapping |
Hessians are managed per function, not per variable. | |
bool | respMapping |
are supplied | |
Sizet2DArray | primaryRespMapIndices |
to RecastModel Response). | |
Sizet2DArray | secondaryRespMapIndices |
to RecastModel response). | |
BoolDequeArray | nonlinearRespMapping |
augment the subModel function value/gradient requirements. | |
IntActiveSetMap | recastSetMap |
Needed for currentResponse update in synchronization routines. | |
IntVariablesMap | recastVarsMap |
synchronization routines. | |
IntVariablesMap | subModelVarsMap |
synchronization routines. | |
IntResponseMap | recastResponseMap |
and RecastModel::derived_synchronize_nowait() | |
void(* | variablesMapping )(const Variables &recast_vars, Variables &sub_model_vars) |
holds pointer for variables mapping function passed in ctor/initialize | |
void(* | setMapping )(const ActiveSet &recast_set, ActiveSet &sub_model_set) |
holds pointer for set mapping function passed in ctor/initialize | |
void(* | primaryRespMapping )(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response) |
ctor/initialize | |
void(* | secondaryRespMapping )(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response) |
ctor/initialize |
The RecastModel class uses function pointers to allow recasting of the subModel input/output into new problem forms. This is currently used to recast SBO approximate subproblems, but can be used for multiobjective, input/output scaling, and other problem modifications in the future.
RecastModel | ( | Model & | sub_model, | |
size_t | num_recast_primary_fns, | |||
size_t | num_recast_secondary_fns, | |||
size_t | recast_secondary_offset | |||
) |
alternate constructor
This alternate constructor defers initialization of the function pointers until a separate call to initialize(), and accepts the minimum information needed to construct currentVariables, currentResponse, and userDefinedConstraints. The resulting model is sufficiently complete for passing to an Iterator.
void initialize | ( | const Sizet2DArray & | vars_map_indices, | |
bool | nonlinear_vars_mapping, | |||
void(*)(const Variables &recast_vars, Variables &sub_model_vars) | variables_map, | |||
void(*)(const ActiveSet &recast_set, ActiveSet &sub_model_set) | set_map, | |||
const Sizet2DArray & | primary_resp_map_indices, | |||
const Sizet2DArray & | secondary_resp_map_indices, | |||
const BoolDequeArray & | nonlinear_resp_mapping, | |||
void(*)(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response) | primary_resp_map, | |||
void(*)(const Variables &sub_model_vars, const Variables &recast_vars, const Response &sub_model_response, Response &recast_response) | secondary_resp_map | |||
) |
completes initialization of the RecastModel after alternate construction
This function is used for late initialization of the recasting functions. It is used in concert with the alternate constructor.
void update_from_sub_model | ( | ) | [private] |
update current variables/labels/bounds/targets from subModel
Update inactive values and labels in currentVariables and inactive bound constraints in userDefinedConstraints from variables and constraints data within subModel.