Sandia Home Sandia Home
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK::Point Class Reference

#include <APPSPACK_Point.hpp>

Collaboration diagram for APPSPACK::Point:

Collaboration graph
[legend]
List of all members.

Detailed Description

A trial point.

A trial point contains an x-vector either waiting to be evaluated or that is already evaluated. Each Point is unique and has an associated unique tag. Copying is disallowed.

Definition at line 54 of file APPSPACK_Point.hpp.

Public Types

enum  State {
  Unevaluated, Infeasible, CachedInsufficientDecrease, Cached,
  EvaluatedInsufficientDecrease, Evaluated
}
 The evaluation state of the trial point. More...

Public Member Functions

Constructors
 Point (const Vector &x_in, const Value &f_in, double step_in, double alpha_in)
 Point (const Vector &x_in, double step_in, const Point &parent, int idx_in)
Destructors
 ~Point ()
Accessors
const VectorgetX () const
const ValuegetF () const
int getTag () const
int getParentTag () const
int getIndex () const
double getStep () const
Manipulators
void setCachedFunctionValue (const Value &f_in, const string &msg_in)
void setEvaluatedFunctionValue (const Value &f_in, const string &msg_in)
void setInfeasible ()
Comparisons
bool operator< (const Point &other) const
Printing
ostream & leftshift (ostream &stream) const
 Print out the point to the given stream.

Private Member Functions

void operator= (const Point &source)
 Disallowed.
 Point (const Point &source)
 Disallow copy constructor.
bool isSufficientDecrease () const
 Check for sufficient decrease as compared to the parent's function value.

Private Attributes

const Vector x
 The x vector.
Value f
 The function value, f(x).
const int tag
 Integer tag value.
const double step
 The step that was used to create this point.
string msg
 Message string.
const int parentTag
 Integer tag of parent.
const int idx
 Index of corresponding direction.
const Value parentValue
 Parent function value.
const double alpha
 Value of the sufficient decrease parameter.
const double rho
 Value of $\rho$ used in sufficient decrease calculation.
State state
 Trial point state.

Static Private Attributes

int staticCount = 0
 Static counter used to generate unique tags.


Member Enumeration Documentation

enum APPSPACK::Point::State
 

The evaluation state of the trial point.

Enumeration values:
Unevaluated  Trial point has not yet been evaluated.
Infeasible  Trial point violates constraints.
CachedInsufficientDecrease  Trial point function value has been retrieved from the cache, but there is insufficient decrease.
Cached  Trial point function value has been retrieved from the cache.
EvaluatedInsufficientDecrease  Trial point has been evaluated successfully, but there is insufficient decrease.
Evaluated  Trial point has been evaluated successfully, and there is sufficient decrease.
Definition at line 59 of file APPSPACK_Point.hpp.


Constructor & Destructor Documentation

APPSPACK::Point::Point const Vector x_in,
const Value f_in,
double  step_in,
double  alpha_in
 

Construct a trial point with no parent. This constructor is only used for the initial guess.

Parameters:
x_in - The x-vector.
f_in - The function value (which may be unknown).
step_in - The step length.
alpha_in - The value of alpha to be used by all points.
Definition at line 43 of file APPSPACK_Point.cpp.

References staticCount, and APPSPACK::Vector.

APPSPACK::Point::Point const Vector x_in,
double  step_in,
const Point parent,
int  idx_in
 

Construct a trial point with a parent.

Parameters:
x_in - The x-vector to be evaluated.
step_in - The step length. This is saved as step and also used in the calculation of rho.
parent - The parent of this trial point. The tag of this point is saved as parentTag for later use in processing the resulting function evaluation. Also, the function value is saved as parentValue to save for the sufficient decrease comparison. Finally, alpha is copied.
idx_in - The index of direction used to generate this trial point, saved as idx. This is used in processing the resulting function value.
Definition at line 59 of file APPSPACK_Point.cpp.

References staticCount, and APPSPACK::Vector.

APPSPACK::Point::~Point  ) 
 

Destructor Definition at line 76 of file APPSPACK_Point.cpp.

APPSPACK::Point::Point const Point source  )  [private]
 

Disallow copy constructor.


Member Function Documentation

const APPSPACK::Vector & APPSPACK::Point::getX  )  const
 

Return x. Needed for extracting points to send to user function evaluator. Definition at line 80 of file APPSPACK_Point.cpp.

References APPSPACK::Vector, and x.

Referenced by APPSPACK::Directions::computeNewDirections(), APPSPACK::Conveyor::exchange(), APPSPACK::Solver::generateTrialPoints(), and APPSPACK::Solver::getBestX().

const APPSPACK::Value & APPSPACK::Point::getF  )  const
 

Return f(x). Definition at line 85 of file APPSPACK_Point.cpp.

References f.

Referenced by APPSPACK::Solver::getBestF(), APPSPACK::Solver::isBestF(), and APPSPACK::Solver::processNewBestPoint().

int APPSPACK::Point::getTag  )  const
 

Get the tag of this trial point. Definition at line 89 of file APPSPACK_Point.cpp.

References tag.

Referenced by APPSPACK::Conveyor::exchange(), APPSPACK::Solver::generateTrialPoints(), and APPSPACK::Solver::processEvaluatedTrialPoints().

int APPSPACK::Point::getParentTag  )  const
 

Get parent's tag. Definition at line 94 of file APPSPACK_Point.cpp.

References parentTag.

Referenced by APPSPACK::Solver::processEvaluatedTrialPoints().

int APPSPACK::Point::getIndex  )  const
 

Get index of direction the generated this trial point. Definition at line 99 of file APPSPACK_Point.cpp.

References idx.

Referenced by APPSPACK::Solver::processEvaluatedTrialPoints().

double APPSPACK::Point::getStep  )  const
 

Return the step associated with this trial point. Definition at line 104 of file APPSPACK_Point.cpp.

References step.

Referenced by APPSPACK::Directions::computeNewDirections().

void APPSPACK::Point::setCachedFunctionValue const Value f_in,
const string &  msg_in
 

Store the cached function value in f. Automatically checks for sufficient decrease and sets state appropriately. Definition at line 109 of file APPSPACK_Point.cpp.

References Cached, CachedInsufficientDecrease, f, isSufficientDecrease(), msg, and state.

Referenced by APPSPACK::Conveyor::exchange().

void APPSPACK::Point::setEvaluatedFunctionValue const Value f_in,
const string &  msg_in
 

Store the evaluated function value in f. Automatically checks for sufficient decrease and sets state appropriately. Definition at line 116 of file APPSPACK_Point.cpp.

References Evaluated, EvaluatedInsufficientDecrease, f, isSufficientDecrease(), msg, and state.

Referenced by APPSPACK::Conveyor::exchange().

void APPSPACK::Point::setInfeasible  ) 
 

The trial point is infeasbile. Set state appropriately. Definition at line 123 of file APPSPACK_Point.cpp.

References Infeasible, and state.

bool APPSPACK::Point::operator< const Point other  )  const
 

Basically, the evaluation is based on comparing the two function values. To complicate matters, however, we may not have to valid function values, which leads to all sorts of special cases. Further, if two different points have equal function values, we break ties based on the tag.

We apply the following logic, in order, to determine if this point is less than the other.

  • Case I: Tags are equal (i.e., comparing this point to itself. Return false.

  • Case II: This point does not have a valid function value. Return false.

  • Case III: The other point does not have a valid function value. Return true.

  • Case IV: This function value is less than the other. Return true.

  • Case V: The other function value is less than this one. Return false.

  • Case VI: This tag is less than the other tag. Return true.

  • Case VII: Default. Return false.

Definition at line 128 of file APPSPACK_Point.cpp.

References Cached, Evaluated, f, state, and tag.

ostream & APPSPACK::Point::leftshift ostream &  stream  )  const
 

Print out the point to the given stream.

Definition at line 165 of file APPSPACK_Point.cpp.

References f, APPSPACK::Print::formatPositiveDouble(), msg, state, step, tag, and x.

Referenced by operator<<().

void APPSPACK::Point::operator= const Point source  )  [private]
 

Disallowed.

bool APPSPACK::Point::isSufficientDecrease  )  const [private]
 

Check for sufficient decrease as compared to the parent's function value.

Definition at line 155 of file APPSPACK_Point.cpp.

References f, APPSPACK::Value::isSufficientDecrease(), parentValue, and rho.

Referenced by setCachedFunctionValue(), and setEvaluatedFunctionValue().


Member Data Documentation

int APPSPACK::Point::staticCount = 0 [static, private]
 

Static counter used to generate unique tags.

Definition at line 41 of file APPSPACK_Point.cpp.

Referenced by Point().

const Vector APPSPACK::Point::x [private]
 

The x vector.

Definition at line 227 of file APPSPACK_Point.hpp.

Referenced by getX(), and leftshift().

Value APPSPACK::Point::f [private]
 

The function value, f(x).

Definition at line 230 of file APPSPACK_Point.hpp.

Referenced by getF(), isSufficientDecrease(), leftshift(), operator<(), setCachedFunctionValue(), and setEvaluatedFunctionValue().

const int APPSPACK::Point::tag [private]
 

Integer tag value.

Definition at line 233 of file APPSPACK_Point.hpp.

Referenced by getTag(), leftshift(), and operator<().

const double APPSPACK::Point::step [private]
 

The step that was used to create this point.

Definition at line 236 of file APPSPACK_Point.hpp.

Referenced by getStep(), and leftshift().

string APPSPACK::Point::msg [private]
 

Message string.

Definition at line 239 of file APPSPACK_Point.hpp.

Referenced by leftshift(), setCachedFunctionValue(), and setEvaluatedFunctionValue().

const int APPSPACK::Point::parentTag [private]
 

Integer tag of parent.

Note:
If there is no parent, then the tag is -1
Definition at line 243 of file APPSPACK_Point.hpp.

Referenced by getParentTag().

const int APPSPACK::Point::idx [private]
 

Index of corresponding direction.

Definition at line 246 of file APPSPACK_Point.hpp.

Referenced by getIndex().

const Value APPSPACK::Point::parentValue [private]
 

Parent function value.

Definition at line 249 of file APPSPACK_Point.hpp.

Referenced by isSufficientDecrease().

const double APPSPACK::Point::alpha [private]
 

Value of the sufficient decrease parameter.

This is used in the calculation of rho.

This value is set in the Point constructors. A user specified value may be provided by specifying the the "Sufficient Decrease Factor" parameter in the Parameter::List passed to APPSPACK::Solver::Solver(); see Solver Parameters. Definition at line 260 of file APPSPACK_Point.hpp.

const double APPSPACK::Point::rho [private]
 

Value of $\rho$ used in sufficient decrease calculation.

The amount of decrease required is given by,

\[ \rho = \alpha \Delta^2 \]

Here $\alpha$ is alpha, and $\Delta$ is step. Definition at line 270 of file APPSPACK_Point.hpp.

Referenced by isSufficientDecrease().

State APPSPACK::Point::state [private]
 

Trial point state.

Definition at line 273 of file APPSPACK_Point.hpp.

Referenced by leftshift(), operator<(), setCachedFunctionValue(), setEvaluatedFunctionValue(), and setInfeasible().


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

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Wed Dec 14 18:41:05 2005 for APPSPACK 4.0.2 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2002