Approximation Class Reference

Base class for the approximation class hierarchy. More...

Inheritance diagram for Approximation:

BasisPolyApproximation GaussProcApproximation SurfpackApproximation TANA3Approximation TaylorApproximation InterpPolyApproximation OrthogPolyApproximation List of all members.

Public Member Functions

 Approximation ()
 default constructor
 Approximation (ProblemDescDB &problem_db, const size_t &num_vars)
 standard constructor for envelope
 Approximation (const String &approx_type, short approx_order, const size_t &num_vars)
 alternate constructor
 Approximation (const Approximation &approx)
 copy constructor
virtual ~Approximation ()
 destructor
Approximation operator= (const Approximation &approx)
 assignment operator
virtual const Real & get_value (const RealVector &x)
 retrieve the approximate function value for a given parameter vector
virtual const RealBaseVectorget_gradient (const RealVector &x)
 retrieve the approximate function gradient for a given parameter vector
virtual const RealMatrixget_hessian (const RealVector &x)
 retrieve the approximate function Hessian for a given parameter vector
virtual const Real & get_variance (const RealVector &x)
 retrieve the variance of the predicted value for a given parameter vector
virtual const Real & get_diagnostic (const String &metric_type)
 retrieve the diagnostic metric for the diagnostic type specified
virtual const RealVectorapproximation_coefficients () const
 return the coefficient array computed by find_coefficients()
virtual void approximation_coefficients (const RealVector &approx_coeffs)
 computing with find_coefficients()
virtual void print_coefficients (ostream &s) const
 print the coefficient array computed in find_coefficients()
virtual int min_coefficients () const
 build the derived class approximation type in numVars dimensions
virtual int recommended_coefficients () const
 build the derived class approximation type in numVars dimensions
virtual int num_constraints () const
 return the number of constraints to be enforced via anchorPoint
virtual void clear_current ()
 clear current build data in preparation for next build
virtual const bool diagnostics_available ()
 check if diagnostics are available for this approximation type
int min_samples (bool constraint_flag) const
 type in numVars dimensions. Uses *_coefficients() and num_constraints().
int recommended_samples (bool constraint_flag) const
 in numVars dimensions (default same as min_samples)
int num_variables () const
 return the number of variables used in the approximation
const List< SurrogateDataPoint > & current_points () const
 return currentPoints
const SurrogateDataPointanchor_point () const
 return anchorPoint
void update (const Variables &vars, const Response &response, const int &fn_index)
 populates/replaces anchorPoint
void update (const RealVector &c_vars, const Real &fn_val, const RealBaseVector &fn_grad, const RealMatrix &fn_hess)
 populates/replaces anchorPoint
void update (const VariablesArray &vars_array, const ResponseArray &resp_array, const int &fn_index)
 populates/replaces currentPoints
void append (const Variables &vars, const Response &response, const int &fn_index)
 appends one additional entry to currentPoints
void append (const RealVector &c_vars, const Real &fn_val, const RealBaseVector &fn_grad, const RealMatrix &fn_hess)
 appends one additional entry to currentPoints
void append (const VariablesArray &vars_array, const ResponseArray &resp_array, const int &fn_index)
 appends multiple additional entries to currentPoints
void build ()
 builds the approximation by invoking find_coefficients()
bool anchor () const
 queries the status of anchorPoint
void clear_all ()
 clear all build data (current and history) to restore original state
void set_bounds (const RealVector &lower, const RealVector &upper)
 set approximation lower and upper bounds (currently only used by graphics)
void draw_surface ()
 problems only)
Approximationapprox_rep () const
 that are not mapped to the top Approximation level

Protected Member Functions

 Approximation (BaseConstructor, const ProblemDescDB &problem_db, const size_t &num_vars)
 derived class constructors - Coplien, p. 139)
virtual void find_coefficients ()
 calculate the data fit coefficients using currentPoints and anchorPoint

Protected Attributes

bool useGradsFlag
 trust region), but not require gradient evaluations at every point.
short outputLevel
 output verbosity level: {SILENT,QUIET,NORMAL,VERBOSE,DEBUG}_OUTPUT
int numVars
 number of variables in the approximation
String approxType
 approximation type identifier
short approxOrder
 orthogonal polynomials, and Taylor series)
Real approxValue
 value of the approximation returned by get_value()
RealBaseVector approxGradient
 gradient of the approximation returned by get_gradient()
RealMatrix approxHessian
 Hessian of the approximation returned by get_hessian().
Real approxVariance
 value of the approximation returned by get_variance()
Real approxDiagnostic
 value of the diagnostic returned by get_diagnostic()
List< SurrogateDataPointcurrentPoints
 are fit approximately (e.g., using least squares regression).
SurrogateDataPoint anchorPoint
 least squares regression).

Private Member Functions

Approximationget_approx (ProblemDescDB &problem_db, const size_t &num_vars)
 approxRep to the appropriate derived type.
Approximationget_approx (const String &approx_type, short approx_order, const size_t &num_vars)
 approxRep to the appropriate derived type.
void add (const Variables &vars, const Response &response, const int &fn_index, bool anchor_flag)
 add_anchor().
void add_point (const RealVector &x, const Real &fn_val, const RealBaseVector &fn_grad, const RealMatrix &fn_hess)
 add a new data point by appending to currentPoints
void add_anchor (const RealVector &x, const Real &fn_val, const RealBaseVector &fn_grad, const RealMatrix &fn_hess)
 add a new data point by assigning to anchorPoint

Private Attributes

RealVector approxLowerBounds
 approximation lower bounds (used only by 3D graphics)
RealVector approxUpperBounds
 approximation upper bounds (used only by 3D graphics)
ApproximationapproxRep
 pointer to the letter (initialized only for the envelope)
int referenceCount
 number of objects sharing approxRep

Detailed Description

Base class for the approximation class hierarchy.

The Approximation class is the base class for the response data fit approximation class hierarchy in DAKOTA. One instance of an Approximation must be created for each function to be approximated (a vector of Approximations is contained in ApproximationInterface). For memory efficiency and enhanced polymorphism, the approximation hierarchy employs the "letter/envelope idiom" (see Coplien "Advanced C++", p. 133), for which the base class (Approximation) serves as the envelope and one of the derived classes (selected in Approximation::get_approximation()) serves as the letter.


Constructor & Destructor Documentation

Approximation (  ) 

default constructor

The default constructor is used in Array<Approximation> instantiations and by the alternate envelope constructor. approxRep is NULL in this case (problem_db is needed to build a meaningful Approximation object). This makes it necessary to check for NULL in the copy constructor, assignment operator, and destructor.

Approximation ( ProblemDescDB problem_db,
const size_t &  num_vars 
)

standard constructor for envelope

Envelope constructor only needs to extract enough data to properly execute get_approx, since Approximation(BaseConstructor, problem_db) builds the actual base class data for the derived approximations.

Approximation ( const String approx_type,
short  approx_order,
const size_t &  num_vars 
)

alternate constructor

This is the alternate envelope constructor for instantiations on the fly. Since it does not have access to problem_db, the letter class is not fully populated. This constructor executes get_approx(type), which invokes the default constructor of the derived letter class, which in turn invokes the default constructor of the base class.

Approximation ( const Approximation approx  ) 

copy constructor

Copy constructor manages sharing of approxRep and incrementing of referenceCount.

~Approximation (  )  [virtual]

destructor

Destructor decrements referenceCount and only deletes approxRep when referenceCount reaches zero.

Approximation ( BaseConstructor  ,
const ProblemDescDB problem_db,
const size_t &  num_vars 
) [protected]

derived class constructors - Coplien, p. 139)

This constructor is the one which must build the base class data for all derived classes. get_approx() instantiates a derived class letter and the derived constructor selects this base class constructor in its initialization list (to avoid recursion in the base class constructor calling get_approx() again). Since the letter IS the representation, its rep pointer is set to NULL (an uninitialized pointer causes problems in ~Approximation).


Member Function Documentation

Approximation operator= ( const Approximation approx  ) 

assignment operator

Assignment operator decrements referenceCount for old approxRep, assigns new approxRep, and increments referenceCount for new approxRep.

void clear_current (  )  [inline, virtual]

clear current build data in preparation for next build

Redefined by TANA3Approximation to clear current data but preserve history.

Reimplemented in TANA3Approximation.

void clear_all (  )  [inline]

clear all build data (current and history) to restore original state

Clears out any history (e.g., TANA3Approximation use for a different response function in NonDReliability).

Approximation * get_approx ( ProblemDescDB problem_db,
const size_t &  num_vars 
) [private]

approxRep to the appropriate derived type.

Used only by the envelope constructor to initialize approxRep to the appropriate derived type.

Approximation * get_approx ( const String approx_type,
short  approx_order,
const size_t &  num_vars 
) [private]

approxRep to the appropriate derived type.

Used only by the envelope constructor to initialize approxRep to the appropriate derived type.


The documentation for this class was generated from the following files:
Generated on Wed Nov 5 19:54:06 2008 for DAKOTA by  doxygen 1.5.1