Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | 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.

Parameters

These parameters are are stored in the Parameter::List that is passed to the Solver constructor. See Solver Parameters for full details on these parameters.

Definition at line 70 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::Linear &constraints_in, Combiner::Generic &combiner_in)
 Constructor.
 Solver (const Parameter::List &params_in, Executor::Interface &executor_in, const Constraints::Linear &constraints_in)
 Constructor.
void setup (const Parameter::List &params_in, Executor::Interface &executor_in, const Constraints::Linear &constraints_in)
 Constructor support.
 ~Solver ()
 Destructor.
Accessors (for after solve() is called)
const vector< double > & getBestX () const
 Return the x-vector corresponding to the best point.
double getBestF () const
 Return the finite function value (if any) associated with the best point.
const vector< double > & getBestVecF () const
 Returns instance of class Value associated with current 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::Linear &constraints, Combiner::Generic &combiner)
 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 processEvaluatedTrialPoints ()
Print Functions
void printInitializationInformation () const
void printBestPoint (const string label="") const
void writeSolutionFile (const string filename) const

Private Attributes

const Constraints::Linearconstraints
 Constraints.
Parameter::List params
 Parameters.
Print print
 Print.
Directions directions
 The search directions.
PointbestPointPtr
 Pointer to the best trial point thus far.
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.
bool useSnapTo
 Determines whether or not Constraints::Linear::snapToBoundary() is called.
Combiner::Generic combiner
 Default combiner.
bool useRandomOrder
 If true, APPSPACK will randomize the order in which points are generated.
Stopping Criteria
bool isFunctionTolerance
 Enforce function value tolerance.
double 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 76 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::Linear constraints_in,
Combiner::Generic combiner_in
 

Constructor.

Definition at line 45 of file APPSPACK_Solver.cpp.

References setup().

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

Constructor.

Definition at line 64 of file APPSPACK_Solver.cpp.

References setup().

APPSPACK::Solver::~Solver  ) 
 

Destructor.

Definition at line 124 of file APPSPACK_Solver.cpp.


Member Function Documentation

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

Constructor support.

Print

Definition at line 82 of file APPSPACK_Solver.cpp.

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

Referenced by Solver().

APPSPACK::Point * APPSPACK::Solver::initializeBestPointPtr Parameter::List params,
const Constraints::Linear constraints,
Combiner::Generic combiner
[static]
 

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

Definition at line 144 of file APPSPACK_Solver.cpp.

References APPSPACK::Constraints::Linear::assertFeasible(), APPSPACK::Vector::assign(), APPSPACK::Parameter::List::getDoubleParameter(), APPSPACK::Constraints::Linear::getNominalX(), APPSPACK::Parameter::List::getParameter(), APPSPACK::Constraints::Linear::getScaling(), APPSPACK::Parameter::List::getVectorParameter(), APPSPACK::Constraints::Linear::isFeasible(), APPSPACK::Parameter::List::isParameter(), APPSPACK::Parameter::List::isParameterDouble(), APPSPACK::Parameter::List::isParameterVector(), APPSPACK::Constraints::Linear::makeBoundsFeasible(), APPSPACK::Parameter::List::setParameter(), APPSPACK::Vector::size(), and APPSPACK::Constraints::Linear::snapToBoundary().

const vector< double > & APPSPACK::Solver::getBestX  )  const
 

Return the x-vector corresponding to the best point.

Definition at line 129 of file APPSPACK_Solver.cpp.

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

double APPSPACK::Solver::getBestF  )  const
 

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

Definition at line 134 of file APPSPACK_Solver.cpp.

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

const vector< double > & APPSPACK::Solver::getBestVecF  )  const
 

Returns instance of class Value associated with current best point.

Definition at line 139 of file APPSPACK_Solver.cpp.

References bestPointPtr, APPSPACK::Vector::getStlVector(), and APPSPACK::Point::getVecF().

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

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

Definition at line 205 of file APPSPACK_Solver.cpp.

References conveyor, directions, APPSPACK::Conveyor::getCounter(), APPSPACK::Parameter::List::getParameter(), iterate(), params, APPSPACK::Directions::print(), APPSPACK::Counter::print(), state, State, and writeSolutionFile().

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

Do a single APPS iteration.

Definition at line 241 of file APPSPACK_Solver.cpp.

References conveyor, APPSPACK::Conveyor::exchange(), exchangeList, generateTrialPoints(), processEvaluatedTrialPoints(), 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 via a call to Directions::computeNewDirections(), 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 253 of file APPSPACK_Solver.cpp.

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

Referenced by processEvaluatedTrialPoints(), and setup().

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

Trial points are generated corresponding to vectors in directions that are not converged and do not already have an associated trial point.

For each direction $d_i$ in directions, a new trial point $ x$ is computed satisfying

\[ x = x_{\rm best} + \Delta_{\rm max} d_i, \]

where $\Delta_{\rm max}$ denotes the maximum scalar in interval $[0,\Delta_i]$ such that $ x_{\rm best} + \Delta_{\rm max} d_i,$ is feasible.

If the user definable parameter useSnapTo = true, a call to Constraints::Linear::snapToBoundary() is made to determine if $ x $ is near a boundary point. If a nearby boundary point $x_b$ is found,

\[ x = x_b. \]

Trial point information is then saved and $ x $ is added to the new trial point list, exchangeList.

Note:
New search directions are created in processNewBestPoint() via a call to Directions::computeNewDirections().

A direction is considered converged if its corresponding step length is strictly smaller than Directions::stepTolerance.

Definition at line 282 of file APPSPACK_Solver.cpp.

References APPSPACK::Constraints::Linear::assertFeasible(), bestPointPtr, boundsTolerance, constraints, directions, exchangeList, APPSPACK::Directions::getDirection(), APPSPACK::Directions::getDirectionIndices(), APPSPACK::Directions::getStep(), APPSPACK::Point::getTag(), APPSPACK::Point::getX(), APPSPACK::Constraints::Linear::isFeasible(), APPSPACK::Constraints::Linear::maxStep(), APPSPACK::List::print(), APPSPACK::Directions::print(), APPSPACK::List::push(), APPSPACK::Vector::resize(), APPSPACK::Directions::setStepConverged(), APPSPACK::Directions::setTrueStepAndTag(), APPSPACK::Vector::size(), APPSPACK::Constraints::Linear::snapToBoundary(), and useRandomOrder.

Referenced by iterate().

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 350 of file APPSPACK_Solver.cpp.

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

Referenced by iterate().

void APPSPACK::Solver::writeSolutionFile const string  filename  )  const [private]
 

Writes solution to file specified by "Solution File" (see Solver Parameters).

Definition at line 442 of file APPSPACK_Solver.cpp.

References bestPointPtr, APPSPACK::Parameter::List::getParameter(), APPSPACK::Point::getVecF(), APPSPACK::Point::getX(), and params.

Referenced by solve().


Member Data Documentation

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

Constraints.

Definition at line 226 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints().

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

Parameters.

Definition at line 229 of file APPSPACK_Solver.hpp.

Referenced by setup(), solve(), and writeSolutionFile().

Print APPSPACK::Solver::print [private]
 

Print.

Definition at line 232 of file APPSPACK_Solver.hpp.

Directions APPSPACK::Solver::directions [private]
 

The search directions.

Definition at line 235 of file APPSPACK_Solver.hpp.

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

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

Pointer to the best trial point thus far.

Definition at line 238 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), getBestF(), getBestVecF(), getBestX(), processEvaluatedTrialPoints(), processNewBestPoint(), and writeSolutionFile().

Conveyor APPSPACK::Solver::conveyor [private]
 

Trial Point Evaluator.

Definition at line 241 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 244 of file APPSPACK_Solver.hpp.

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

State APPSPACK::Solver::state [private]
 

The state of the solver.

Definition at line 247 of file APPSPACK_Solver.hpp.

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

bool APPSPACK::Solver::isFunctionTolerance [private]
 

Enforce function value tolerance.

Definition at line 252 of file APPSPACK_Solver.hpp.

Referenced by setup().

double APPSPACK::Solver::functionTolerance [private]
 

Function value.

Definition at line 255 of file APPSPACK_Solver.hpp.

Referenced by setup().

bool APPSPACK::Solver::isMaxEvaluations [private]
 

Enforce function evaluation budget.

Definition at line 258 of file APPSPACK_Solver.hpp.

Referenced by setup().

int APPSPACK::Solver::maxEvaluations [private]
 

Function evaluation budget.

Definition at line 261 of file APPSPACK_Solver.hpp.

Referenced by setup().

double APPSPACK::Solver::boundsTolerance [private]
 

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

Definition at line 266 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), and setup().

Vector APPSPACK::Solver::tmpVector [private]
 

A temporary vector.

Definition at line 269 of file APPSPACK_Solver.hpp.

bool APPSPACK::Solver::useSnapTo [private]
 

Determines whether or not Constraints::Linear::snapToBoundary() is called.

If true, generated trial points will be sent to Constraints::Linear::snapToBoundary() prior to being added to the evaluation cue. If a boundary point is sufficiently near, the respective trial point will be redefined to be this point.

See also:
generateTrialPoints().

Definition at line 276 of file APPSPACK_Solver.hpp.

Combiner::Generic APPSPACK::Solver::combiner [private]
 

Default combiner.

Definition at line 279 of file APPSPACK_Solver.hpp.

bool APPSPACK::Solver::useRandomOrder [private]
 

If true, APPSPACK will randomize the order in which points are generated.

When points are generated and added to the queue in a fixed order, it is possible (when running in asynchronous mode) to initially optimize over a strict subspace. The drawback of this is that small-steps must be then taken to the true solution to avoid undoing the gains made in the initial subspace.

Definition at line 288 of file APPSPACK_Solver.hpp.

Referenced by generateTrialPoints(), and setup().


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

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002