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::Solver Class Reference

#include <APPSPACK_Solver.hpp>

Collaboration diagram for APPSPACK::Solver:

Collaboration graph
[legend]
List of all members.

Detailed Description

The solver itself.

Definition at line 54 of file APPSPACK_Solver.hpp.

Public Types

enum  State { Continue, StepConverged, FunctionConverged, EvaluationsExhausted }
 State of the solver. More...

Public Member Functions

 Solver (const Parameter::List &params_in, Executor::Interface &executor_in, const Constraints::Interface &constraints_in)
 Constructor.
 ~Solver ()
 Destructor.
Accessors (for after solve() is called)
const VectorgetBestX () const
 Return the x-vector corresponding to the best point.
bool isBestF () const
 Retun true is there is a finite function value associated with the best point.
double getBestF () const
 Return the finite function value (if any) associated with the best point.
Manipulators
APPSPACK::Solver::State solve ()
 Find the minimum of the function that was set up in the constructor.
APPSPACK::Solver::State iterate ()
 Do a single APPS iteration.

Static Public Member Functions

PointinitializeBestPointPtr (Parameter::List &params, const Constraints::Interface &constraints)
 Called by the Solver constructor to parse the parameter list and create the initial best point.

Private Member Functions

void processNewBestPoint (Point *newBestPointPtr=NULL)
void generateTrialPoints ()
void createTrialPoint (int idx)
void processEvaluatedTrialPoints ()
Print Functions
void printInitializationInformation () const
void printBestPoint (const string label="") const

Private Attributes

const Constraints::Interfaceconstraints
 Constraints.
Parameter::List params
 Parameters.
Print print
 Print.
PointbestPointPtr
 Pointer to the best trial point thus far.
Directions directions
 The search directions.
Conveyor conveyor
 Trial Point Evaluator.
List exchangeList
 List of trial points to be processed in some way.
State state
 The state of the solver.
double boundsTolerance
 Tolerance for saying whether or not we are on a boundary.
Vector tmpVector
 A temporary vector.
double epsMach
 Machine epsilon.
Stopping Criteria
bool isFunctionTolerance
 Enforce function value tolerance.
Value functionTolerance
 Function value.
bool isMaxEvaluations
 Enforce function evaluation budget.
int maxEvaluations
 Function evaluation budget.


Member Enumeration Documentation

enum APPSPACK::Solver::State
 

State of the solver.

Enumeration values:
Continue  Default state.
StepConverged  Step length converged.
FunctionConverged  Function tolerance converged.
EvaluationsExhausted  Number of function evaluations exhausted.
Definition at line 60 of file APPSPACK_Solver.hpp.

Referenced by iterate(), and solve().


Constructor & Destructor Documentation

APPSPACK::Solver::Solver const Parameter::List params_in,
Executor::Interface executor_in,
const Constraints::Interface constraints_in
 

Constructor.

Print Definition at line 41 of file APPSPACK_Solver.cpp.

References boundsTolerance, epsMach, functionTolerance, APPSPACK::Parameter::List::getDoubleParameter(), APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::getValueParameter(), isFunctionTolerance, isMaxEvaluations, APPSPACK::Parameter::List::isParameter(), APPSPACK::Parameter::List::isParameterDouble(), APPSPACK::Parameter::List::isParameterValue(), maxEvaluations, params, and processNewBestPoint().

APPSPACK::Solver::~Solver  ) 
 

Destructor.

Definition at line 102 of file APPSPACK_Solver.cpp.

References bestPointPtr.


Member Function Documentation

APPSPACK::Point * APPSPACK::Solver::initializeBestPointPtr Parameter::List params,
const Constraints::Interface constraints
[static]
 

Called by the Solver constructor to parse the parameter list and create the initial best point.

Definition at line 123 of file APPSPACK_Solver.cpp.

References APPSPACK::Parameter::List::getDoubleParameter(), APPSPACK::Constraints::Interface::getIsLower(), APPSPACK::Constraints::Interface::getIsUpper(), APPSPACK::Constraints::Interface::getLower(), APPSPACK::Parameter::List::getParameter(), APPSPACK::Constraints::Interface::getScaling(), APPSPACK::Constraints::Interface::getUpper(), APPSPACK::Parameter::List::getValueParameter(), APPSPACK::Parameter::List::isParameter(), APPSPACK::Parameter::List::isParameterDouble(), APPSPACK::Parameter::List::isParameterValue(), and APPSPACK::Vector.

const APPSPACK::Vector & APPSPACK::Solver::getBestX  )  const
 

Return the x-vector corresponding to the best point.

Definition at line 107 of file APPSPACK_Solver.cpp.

References bestPointPtr, APPSPACK::Point::getX(), and APPSPACK::Vector.

bool APPSPACK::Solver::isBestF  )  const
 

Retun true is there is a finite function value associated with the best point.

Definition at line 112 of file APPSPACK_Solver.cpp.

References bestPointPtr, APPSPACK::Point::getF(), and APPSPACK::Value::getIsValue().

double APPSPACK::Solver::getBestF  )  const
 

Return the finite function value (if any) associated with the best point.

Definition at line 117 of file APPSPACK_Solver.cpp.

References bestPointPtr, APPSPACK::Point::getF(), and APPSPACK::Value::getValue().

APPSPACK::Solver::State APPSPACK::Solver::solve  ) 
 

Find the minimum of the function that was set up in the constructor.

Definition at line 201 of file APPSPACK_Solver.cpp.

References Continue, conveyor, directions, APPSPACK::Conveyor::getCounter(), iterate(), APPSPACK::Counter::print(), APPSPACK::Directions::print(), state, and State.

APPSPACK::Solver::State APPSPACK::Solver::iterate  ) 
 

Do a single APPS iteration.

Definition at line 220 of file APPSPACK_Solver.cpp.

References conveyor, APPSPACK::Conveyor::exchange(), exchangeList, generateTrialPoints(), processEvaluatedTrialPoints(), state, and State.

Referenced by solve().

void APPSPACK::Solver::processNewBestPoint Point newBestPointPtr = NULL  )  [private]
 

Process a new best point - Delete the old point (if any) and replace it with the new.

If the function tolerance convergence test is being employed, we check for convergence at this point, and return if convergence is detected.

Otherwise, we generate new search directions, re-initialize the #step array, and reset various bookkeeping variables (#trueStep and #tag).

All the steps start the same, and they are calculated as follows:

\[ {\rm step}_{\rm new} = \max \{ {\rm step}_{\rm best}, 2 * {\rm stepTolerance} \} \]

Definition at line 232 of file APPSPACK_Solver.cpp.

References bestPointPtr, APPSPACK::Directions::computeNewDirections(), directions, FunctionConverged, functionTolerance, APPSPACK::Point::getF(), isFunctionTolerance, APPSPACK::Directions::print(), and state.

Referenced by processEvaluatedTrialPoints(), and Solver().

void APPSPACK::Solver::generateTrialPoints  )  [private]
 

Generate trial points for any directions that are not converged and do not already have an associated trial point.

Note that a direction is considered converged if its corresponding step length is strictly smaller than #stepTolerance. Definition at line 261 of file APPSPACK_Solver.cpp.

References bestPointPtr, constraints, directions, epsMach, exchangeList, APPSPACK::Directions::getDirection(), APPSPACK::Directions::getDirectionIndices(), APPSPACK::Constraints::Interface::getIsLower(), APPSPACK::Constraints::Interface::getIsUpper(), APPSPACK::Constraints::Interface::getLower(), APPSPACK::Directions::getStep(), APPSPACK::Point::getTag(), APPSPACK::Constraints::Interface::getUpper(), APPSPACK::Point::getX(), APPSPACK::List::print(), APPSPACK::Directions::print(), APPSPACK::List::push(), APPSPACK::Directions::setTrueStepAndTag(), tmpVector, and APPSPACK::Vector.

Referenced by iterate().

void APPSPACK::Solver::createTrialPoint int  idx  )  [private]
 

Create a new trial point corresponding to the direction with the given index, idx. Let $d_i$ (see directions) denote the given direction and $\Delta_i$ (see #steps) the corresponding step length. Then we calculate the new trial point as:

\[ x = x_{\rm best} + \Delta_i d_i \]

If this point is infeasible, then we reset $\Delta_i$ to the longest possible step according to the following formula. Let $a^T x = b$ denote a linear constraint that is violated. Then

\[ \tilde \Delta_i = \frac{b - a^T x_{\rm best}}{a^T d_i} \]

The value of $\tilde \Delta_i$ is stored in #trueSteps, and the trial point is then calculated as:

\[ x = x_{\rm best} + \tilde \Delta_i d_i \]

void APPSPACK::Solver::processEvaluatedTrialPoints  )  [private]
 

Process a list of trial points that has been returned from the UberEvaluator.

First, check to see if the best of all these points is better than the current best point. If so, replace that best point (see processNewBestPoint()) and throw away the rest of the list.

Otherwise, process each point and delete it.

Finally, check if all the directions have converged and check if we have exhausted the maximum number of function evaluations. Definition at line 356 of file APPSPACK_Solver.cpp.

References APPSPACK::List::best(), bestPointPtr, Continue, conveyor, directions, EvaluationsExhausted, exchangeList, APPSPACK::Conveyor::getCounter(), APPSPACK::Point::getIndex(), APPSPACK::Counter::getNumEvaluations(), APPSPACK::Point::getParentTag(), APPSPACK::Point::getTag(), APPSPACK::List::isEmpty(), isMaxEvaluations, APPSPACK::Directions::isStepConverged(), maxEvaluations, APPSPACK::List::pop(), APPSPACK::List::popBest(), APPSPACK::List::print(), processNewBestPoint(), APPSPACK::Conveyor::prune(), APPSPACK::List::prune(), APPSPACK::Directions::reduceStep(), state, and StepConverged.

Referenced by iterate().


Member Data Documentation

const Constraints::Interface& APPSPACK::Solver::constraints [private]
 

Constraints.

Definition at line 198 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints().

Parameter::List APPSPACK::Solver::params [private]
 

Parameters.

Definition at line 201 of file APPSPACK_Solver.hpp.

Referenced by Solver().

Print APPSPACK::Solver::print [private]
 

Print.

Definition at line 204 of file APPSPACK_Solver.hpp.

Point* APPSPACK::Solver::bestPointPtr [private]
 

Pointer to the best trial point thus far.

Definition at line 207 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), getBestF(), getBestX(), isBestF(), processEvaluatedTrialPoints(), processNewBestPoint(), and ~Solver().

Directions APPSPACK::Solver::directions [private]
 

The search directions.

Definition at line 210 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), processEvaluatedTrialPoints(), processNewBestPoint(), and solve().

Conveyor APPSPACK::Solver::conveyor [private]
 

Trial Point Evaluator.

Definition at line 213 of file APPSPACK_Solver.hpp.

Referenced by iterate(), processEvaluatedTrialPoints(), and solve().

List APPSPACK::Solver::exchangeList [private]
 

List of trial points to be processed in some way.

Definition at line 216 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), iterate(), and processEvaluatedTrialPoints().

State APPSPACK::Solver::state [private]
 

The state of the solver.

Definition at line 219 of file APPSPACK_Solver.hpp.

Referenced by iterate(), processEvaluatedTrialPoints(), processNewBestPoint(), and solve().

bool APPSPACK::Solver::isFunctionTolerance [private]
 

Enforce function value tolerance.

Definition at line 224 of file APPSPACK_Solver.hpp.

Referenced by processNewBestPoint(), and Solver().

Value APPSPACK::Solver::functionTolerance [private]
 

Function value.

Definition at line 227 of file APPSPACK_Solver.hpp.

Referenced by processNewBestPoint(), and Solver().

bool APPSPACK::Solver::isMaxEvaluations [private]
 

Enforce function evaluation budget.

Definition at line 230 of file APPSPACK_Solver.hpp.

Referenced by processEvaluatedTrialPoints(), and Solver().

int APPSPACK::Solver::maxEvaluations [private]
 

Function evaluation budget.

Definition at line 233 of file APPSPACK_Solver.hpp.

Referenced by processEvaluatedTrialPoints(), and Solver().

double APPSPACK::Solver::boundsTolerance [private]
 

Tolerance for saying whether or not we are on a boundary.

Definition at line 238 of file APPSPACK_Solver.hpp.

Referenced by Solver().

Vector APPSPACK::Solver::tmpVector [private]
 

A temporary vector.

Definition at line 241 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints().

double APPSPACK::Solver::epsMach [private]
 

Machine epsilon.

Definition at line 244 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), and Solver().


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