Dakota  Version 6.21
Explore and Predict with Confidence
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SharedResponseData Class Reference

Container class encapsulating variables data that can be shared among a set of Response instances. More...

Public Member Functions

 SharedResponseData ()
 default constructor
 
 SharedResponseData (const ProblemDescDB &problem_db)
 standard constructor
 
 SharedResponseData (const ActiveSet &set)
 alternate on-the-fly constructor (explicit disallows its use for implicit type conversion so that instantiations of Response(set) are invalid)
 
 SharedResponseData (const SharedResponseData &srd)
 copy constructor
 
 ~SharedResponseData ()
 destructor
 
SharedResponseDataoperator= (const SharedResponseData &srd)
 assignment operator
 
bool operator== (const SharedResponseData &other)
 experimental operator== for use in unit testing
 
size_t num_scalar_responses () const
 number of scalar responses: primary_scalar + nonlinear constraints; note that these are non-contiguous when primary fields are present.
 
size_t num_scalar_primary () const
 number of scalar primary responses (objectives, calibration terms, generic)
 
size_t num_field_response_groups () const
 number of primary fields (primary field groups)
 
size_t num_response_groups () const
 total number of response groups (number scalars + number pri field groups)
 
size_t num_field_functions () const
 total number of primary field functions (elements); 1-norm of priFieldLengths
 
size_t num_primary_functions () const
 number of primary functions (pri scalars + 1-norm of priFieldLengths)
 
size_t num_functions () const
 total number of response functions (pri scalars + 1-norm of priFieldLengths + secondary scalars)
 
const IntVector & field_lengths () const
 length of each primary field
 
void field_lengths (const IntVector &field_lens)
 set field lengths (e.g., if experiment different from simulation)
 
const IntVector & num_coords_per_field () const
 number of independent coordinates for each primary field
 
const String & function_label (size_t i) const
 return a response function identifier string
 
const StringArray & function_labels () const
 return the response function identifier strings
 
StringArray & function_labels ()
 return the response function identifier strings
 
void function_label (const String &label, size_t i)
 set a response function identifier string
 
void function_labels (const StringArray &labels)
 set the response function identifier strings
 
const StringArray & field_group_labels () const
 return the coarse (per-group) primary field response labels
 
void field_group_labels (const StringArray &field_labels)
 set the coarse primary field group labels (must agree with number fields)
 
const String & responses_id () const
 return the response identifier
 
short response_type () const
 return the response type: {BASE,SIMULATION,EXPERIMENT}_RESPONSE
 
void response_type (short type)
 set the response type: {BASE,SIMULATION,EXPERIMENT}_RESPONSE
 
short primary_fn_type () const
 get the primary function type (generic, objective, calibration)
 
void primary_fn_type (short type)
 set the primary function type (generic, objective, calibration)
 
const RealVector & simulation_error () const
 retrieve simulation variance
 
const StringArray & metadata_labels () const
 get labels for metadata fields
 
void metadata_labels (const StringArray &md_labels)
 set labels for metadata fields
 
void read_annotated (std::istream &s, size_t num_md)
 read metadata labels from annotated (neutral) file
 
SharedResponseData copy () const
 create a deep copy of the current object and return by value
 
void reshape (size_t num_fns)
 reshape the data, disconnecting a shared rep if necessary
 
void reshape_metadata (size_t num_meta)
 reshape the shared metadata (labels only at this time)
 
void reshape_labels (StringArray &resp_labels, size_t num_fns)
 reshape the response labels using inflation/deflation if possible
 
bool is_null () const
 return true if empty handle with null representation
 
long reference_count () const
 how many handles (including this) are sharing this representation (body); for debugging/testing only
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 serialize through the pointer, which requires object tracking: write and read are symmetric for this class
 

Private Attributes

std::shared_ptr< SharedResponseDataRepsrdRep
 pointer to the body (handle-body idiom)
 

Friends

class boost::serialization::access
 allow boost access to serialize this class
 

Detailed Description

Container class encapsulating variables data that can be shared among a set of Response instances.

An array of Response objects (e.g., Analyzer::allResponse) contains repeated configuration data (id's, labels, counts). SharedResponseData employs a handle-body idiom to allow this shared data to be managed in a single object with many references to it, one per Response object in the array. This allows scaling to larger sample sets.


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