Private Member Functions | |
| ResponseRep () | |
| default constructor | |
| ResponseRep (const Variables &vars, const ProblemDescDB &problem_db) | |
| standard constructor built from problem description database | |
| ResponseRep (const ActiveSet &set) | |
| alternate constructor using limited data | |
| ~ResponseRep () | |
| destructor | |
| void | read (istream &s) |
| read a responseRep object from an istream | |
| void | write (ostream &s) const |
| write a responseRep object to an ostream | |
| void | read_annotated (istream &s) |
| read a responseRep object from an istream (annotated format) | |
| void | write_annotated (ostream &s) const |
| write a responseRep object to an ostream (annotated format) | |
| void | read_tabular (istream &s) |
| read functionValues from an istream (tabular format) | |
| void | write_tabular (ostream &s) const |
| write functionValues to an ostream (tabular format) | |
| void | read (BiStream &s) |
| read a responseRep object from a binary stream | |
| void | write (BoStream &s) const |
| write a responseRep object to a binary stream | |
| void | read (MPIUnpackBuffer &s) |
| read a responseRep object from a packed MPI buffer | |
| void | write (MPIPackBuffer &s) const |
| write a responseRep object to a packed MPI buffer | |
| int | data_size () |
| double* response_data arrays passed into read_data and write_data. | |
| void | read_data (double *response_data) |
| read from an incoming double* array | |
| void | write_data (double *response_data) |
| write to an incoming double* array | |
| void | overlay (const Response &response) |
| add incoming response to functionValues/Gradients/Hessians | |
| void | copy_results (const RealVector &source_fn_vals, const RealMatrix &source_fn_grads, const RealMatrixArray &source_fn_hessians, const ActiveSet &source_set) |
| update this response object from components of another response object | |
| void | copy_results_partial (size_t start_index_target, size_t num_items, const RealVector &source_fn_vals, const RealMatrix &source_fn_grads, const RealMatrixArray &source_fn_hessians, const ActiveSet &source_set, size_t start_index_source) |
| another response object | |
| void | reshape (const size_t &num_fns, const size_t &num_params, bool grad_flag, bool hess_flag) |
| rehapes response data arrays | |
| void | reset () |
| resets all response data to zero | |
| void | reset_inactive () |
| resets all inactive response data to zero | |
| void | active_set_request_vector (const ShortArray &asrv) |
| of response functions | |
| void | active_set_derivative_vector (const UIntArray &asdv) |
| functionGradients/functionHessians if needed | |
Private Attributes | |
| int | referenceCount |
| number of handle objects sharing responseRep | |
| RealVector | functionValues |
| abstract set of response functions | |
| RealMatrix | functionGradients |
| first derivatives of the response functions | |
| RealMatrixArray | functionHessians |
| second derivatives of the response functions | |
| ActiveSet | responseActiveSet |
| copy of the ActiveSet used by the Model to generate a Response instance | |
| StringArray | functionLabels |
| response function identifiers used to improve output readability | |
| String | idResponses |
| response identifier string from the input file | |
Friends | |
| class | Response |
| the handle class can access attributes of the body class directly | |
| bool | operator== (const ResponseRep &rep1, const ResponseRep &rep2) |
| equality operator | |
The ResponseRep class is the "representation" of the response container class. It is the "body" portion of the "handle-body idiom" (see Coplien "Advanced C++", p. 58). The handle class (Response) provides for memory efficiency in management of multiple response objects through reference counting and representation sharing. The body class (ResponseRep) actually contains the response data (functionValues, functionGradients, functionHessians, etc.). The representation is hidden in that an instance of ResponseRep may only be created by Response. Therefore, programmers create instances of the Response handle class, and only need to be aware of the handle/body mechanisms when it comes to managing shallow copies (shared representation) versus deep copies (separate representation used for history mechanisms).
| ResponseRep | ( | const Variables & | vars, | |
| const ProblemDescDB & | problem_db | |||
| ) | [private] |
standard constructor built from problem description database
The standard constructor used by Dakota::ModelRep.
| ResponseRep | ( | const ActiveSet & | set | ) | [private] |
alternate constructor using limited data
Used for building a response object of the correct size on the fly (e.g., by slave analysis servers performing execute() on a local_response). functionLabels is not needed for this purpose since it's not passed in the MPI send/recv buffers. However, NPSOLOptimizer's user-defined functions option uses this constructor to build bestResponse and bestResponse needs functionLabels for I/O, so construction of functionLabels has been added.
| void read | ( | istream & | s | ) | [private] |
read a responseRep object from an istream
ASCII version of read needs capabilities for capturing data omissions or formatting errors (resulting from user error or asynch race condition) and analysis failures (resulting from nonconvergence, instability, etc.).
| void write | ( | ostream & | s | ) | const [private] |
write a responseRep object to an ostream
ASCII version of write.
| void read_annotated | ( | istream & | s | ) | [private] |
read a responseRep object from an istream (annotated format)
read_annotated() is used for neutral file translation of restart files. Since objects are built solely from this data, annotations are used. This version closely mirrors the BiStream version.
| void write_annotated | ( | ostream & | s | ) | const [private] |
write a responseRep object to an ostream (annotated format)
write_annotated() is used for neutral file translation of restart files. Since objects need to be build solely from this data, annotations are used. This version closely mirrors the BoStream version, with the exception of the use of white space between fields.
| void read_tabular | ( | istream & | s | ) | [private] |
read functionValues from an istream (tabular format)
read_tabular is used to read functionValues in tabular format. It is currently only used by ApproximationInterfaces in reading samples from a file. There is insufficient data in a tabular file to build complete response objects; rather, the response object must be constructed a priori and then its functionValues can be set.
| void write_tabular | ( | ostream & | s | ) | const [private] |
write functionValues to an ostream (tabular format)
write_tabular is used for output of functionValues in a tabular format for convenience in post-processing/plotting of DAKOTA results.
| void read | ( | BiStream & | s | ) | [private] |
read a responseRep object from a binary stream
Binary version differs from ASCII version in 2 primary ways: (1) it lacks formatting. (2) the Response has not been sized a priori. In reading data from the binary restart file, a ParamResponsePair was constructed with its default constructor which called the Response default constructor. Therefore, we must first read sizing data and resize all of the arrays.
| void write | ( | BoStream & | s | ) | const [private] |
write a responseRep object to a binary stream
Binary version differs from ASCII version in 2 primary ways: (1) It lacks formatting. (2) In reading data from the binary restart file, ParamResponsePairs are constructed with their default constructor which calls the Response default constructor. Therefore, we must first write sizing data so that ResponseRep::read(BoStream& s) can resize the arrays.
| void read | ( | MPIUnpackBuffer & | s | ) | [private] |
read a responseRep object from a packed MPI buffer
UnpackBuffer version differs from BiStream version in the omission of functionLabels. Master processor retains labels and interface ids and communicates asv and response data only with slaves.
| void write | ( | MPIPackBuffer & | s | ) | const [private] |
write a responseRep object to a packed MPI buffer
MPIPackBuffer version differs from BoStream version only in the omission of functionLabels. The master processor retains labels and ids and communicates asv and response data only with slaves.
| void copy_results | ( | const RealVector & | source_fn_vals, | |
| const RealMatrix & | source_fn_grads, | |||
| const RealMatrixArray & | source_fn_hessians, | |||
| const ActiveSet & | source_set | |||
| ) | [private] |
update this response object from components of another response object
Copy function values/gradients/Hessians data _only_. Prevents unwanted overwriting of responseActiveSet, functionLabels, etc. Also, care is taken to account for differences in derivative variable matrix sizing.
| void copy_results_partial | ( | size_t | start_index_target, | |
| size_t | num_items, | |||
| const RealVector & | source_fn_vals, | |||
| const RealMatrix & | source_fn_grads, | |||
| const RealMatrixArray & | source_fn_hessians, | |||
| const ActiveSet & | source_set, | |||
| size_t | start_index_source | |||
| ) | [private] |
another response object
Copy function values/gradients/Hessians data _only_. Prevents unwanted overwriting of responseActiveSet, functionLabels, etc. Also, care is taken to account for differences in derivative variable matrix sizing.
| void reshape | ( | const size_t & | num_fns, | |
| const size_t & | num_params, | |||
| bool | grad_flag, | |||
| bool | hess_flag | |||
| ) | [private] |
rehapes response data arrays
Reshape functionValues, functionGradients, and functionHessians according to num_fns, num_params, grad_flag, and hess_flag.
| void reset | ( | ) | [private] |
resets all response data to zero
Reset all numerical response data (not labels, ids, or active set) to zero.
| void reset_inactive | ( | ) | [private] |
resets all inactive response data to zero
Used to clear out any inactive data left over from previous evaluations.
RealMatrix functionGradients [private] |
first derivatives of the response functions
the gradient vectors (plural) are arranged as a Jacobian matrix (singular) with (row, col) = (response fn index, variable index).
1.5.1