Container class for a variables object, a response object, and an evaluation id. More...
Public Member Functions | |
ParamResponsePair () | |
default constructor | |
ParamResponsePair (const Variables &vars, const String &interface_id, const Response &response, bool deep_copy=false) | |
alternate constructor for temporaries | |
ParamResponsePair (const Variables &vars, const String &interface_id, const Response &response, const int eval_id, bool deep_copy=true) | |
standard constructor for history uses | |
ParamResponsePair (const ParamResponsePair &pair) | |
copy constructor | |
~ParamResponsePair () | |
destructor | |
ParamResponsePair & | operator= (const ParamResponsePair &pair) |
assignment operator | |
void | read (std::istream &s) |
read a ParamResponsePair object from an std::istream | |
void | write (std::ostream &s) const |
write a ParamResponsePair object to an std::ostream | |
void | read_annotated (std::istream &s) |
read a ParamResponsePair object in annotated format from an std::istream | |
void | write_annotated (std::ostream &s) const |
write a ParamResponsePair object in annotated format to an std::ostream | |
void | write_tabular (std::ostream &s) const |
write a ParamResponsePair object in tabular format to an std::ostream | |
void | read (BiStream &s) |
read a ParamResponsePair object from the binary restart stream | |
void | write (BoStream &s) const |
write a ParamResponsePair object to the binary restart stream | |
void | read (MPIUnpackBuffer &s) |
read a ParamResponsePair object from a packed MPI buffer | |
void | write (MPIPackBuffer &s) const |
write a ParamResponsePair object to a packed MPI buffer | |
int | eval_id () const |
return the evaluation identifier | |
const String & | interface_id () const |
return the interface identifier from the response object | |
const IntStringPair & | eval_interface_ids () const |
return the aggregate eval/interface identifier from the response object | |
const Variables & | prp_parameters () const |
return the parameters object | |
const Response & | prp_response () const |
return the response object | |
void | prp_response (const Response &response) |
set the response object | |
const ActiveSet & | active_set () const |
return the active set object from the response object | |
void | active_set (const ActiveSet &set) |
set the active set object within the response object | |
Private Attributes | |
Variables | prPairParameters |
the set of parameters for the function evaluation | |
Response | prPairResponse |
the response set for the function evaluation | |
IntStringPair | evalInterfaceIds |
the evalInterfaceIds aggregate | |
Friends | |
bool | operator== (const ParamResponsePair &pair1, const ParamResponsePair &pair2) |
equality operator | |
bool | operator!= (const ParamResponsePair &pair1, const ParamResponsePair &pair2) |
inequality operator |
Container class for a variables object, a response object, and an evaluation id.
ParamResponsePair provides a container class for association of the input for a particular function evaluation (a variables object) with the output from this function evaluation (a response object), along with an evaluation identifier. This container defines the basic unit used in the data_pairs cache, in restart file operations, and in a variety of scheduling algorithm queues. With the advent of STL, replacement of arrays of this class with map<> and pair<> template constructs may be possible (using map<pair<int,String>, pair<Variables,Response> >, for example), assuming that deep copies, I/O, alternate constructors, etc., can be adequately addressed. Boost tuple<> may also be a candidate.
ParamResponsePair | ( | const Variables & | vars, |
const String & | interface_id, | ||
const Response & | response, | ||
bool | deep_copy = false |
||
) | [inline] |
alternate constructor for temporaries
Uses of this constructor often employ the standard Variables and Response copy constructors to share representations since this constructor is commonly used for search_pairs (which are local instantiations that go out of scope prior to any changes to values; i.e., they are not used for history).
ParamResponsePair | ( | const Variables & | vars, |
const String & | interface_id, | ||
const Response & | response, | ||
const int | eval_id, | ||
bool | deep_copy = true |
||
) | [inline] |
standard constructor for history uses
Uses of this constructor often do not share representations since deep copies are used when history mechanisms (e.g., data_pairs and beforeSynchCorePRPQueue) are involved.
void read | ( | MPIUnpackBuffer & | s | ) | [inline] |
read a ParamResponsePair object from a packed MPI buffer
idInterface is omitted since master processor retains interface ids and communicates asv and response data only with slaves.
References ParamResponsePair::evalInterfaceIds, ParamResponsePair::prPairParameters, and ParamResponsePair::prPairResponse.
void write | ( | MPIPackBuffer & | s | ) | const [inline] |
write a ParamResponsePair object to a packed MPI buffer
idInterface is omitted since master processor retains interface ids and communicates asv and response data only with slaves.
References ParamResponsePair::evalInterfaceIds, ParamResponsePair::prPairParameters, and ParamResponsePair::prPairResponse.
IntStringPair evalInterfaceIds [private] |
the evalInterfaceIds aggregate
the function evaluation identifier (assigned from ApplicationInterface::fnEvalId) is paired with the interface used to generate the response object. Used in PRPCache id_vars_set_compare to prevent duplicate detection on results from different interfaces. evalInterfaceIds belongs here rather than in Response since some Response objects involve consolidation of several fn evals (e.g., Model::synchronize_derivatives()) that are not, in total, generated by a single interface. The prPair, on the other hand, is used for storage of all low level fn evals that get evaluated in ApplicationInterface::map().
Referenced by ParamResponsePair::eval_id(), ParamResponsePair::eval_interface_ids(), ParamResponsePair::interface_id(), ParamResponsePair::operator=(), Dakota::operator==(), ParamResponsePair::read(), ParamResponsePair::read_annotated(), ParamResponsePair::write(), ParamResponsePair::write_annotated(), and ParamResponsePair::write_tabular().