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.hpp

Go to the documentation of this file.
00001 // $Id: APPSPACK_Solver.hpp,v 1.31.2.1 2007/01/14 22:09:44 jgriffi Exp $ 
00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Solver.hpp,v $ 
00003 
00004 //@HEADER
00005 // ************************************************************************
00006 // 
00007 //          APPSPACK: Asynchronous Parallel Pattern Search
00008 //                 Copyright (2003) Sandia Corporation
00009 // 
00010 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00011 // license for use of this work by or on behalf of the U.S. Government.
00012 // 
00013 // This library is free software; you can redistribute it and/or modify
00014 // it under the terms of the GNU Lesser General Public License as
00015 // published by the Free Software Foundation; either version 2.1 of the
00016 // License, or (at your option) any later version.
00017 //  
00018 // This library is distributed in the hope that it will be useful, but
00019 // WITHOUT ANY WARRANTY; without even the implied warranty of
00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021 // Lesser General Public License for more details.
00022 //                                                                                 
00023 // You should have received a copy of the GNU Lesser General Public
00024 // License along with this library; if not, write to the Free Software
00025 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00026 // USA.                                                                           .
00027 // 
00028 // Questions? Contact Tammy Kolda (tgkolda@sandia.gov) 
00029 // 
00030 // ************************************************************************
00031 //@HEADER
00032 
00038 #ifndef APPSPACK_SOLVER_HPP
00039 #define APPSPACK_SOLVER_HPP
00040 
00041 #include "APPSPACK_Point.hpp"
00042 #include "APPSPACK_Conveyor.hpp"
00043 #include "APPSPACK_Directions.hpp"
00044 #include "APPSPACK_List.hpp"
00045 #include "APPSPACK_Parameter_List.hpp"
00046 #include "APPSPACK_Print.hpp"
00047 #include "APPSPACK_Constraints_Linear.hpp"
00048 #include "APPSPACK_Combiner_Generic.hpp"
00049 
00050 namespace APPSPACK
00051 {
00052 
00054 
00070 class Solver
00071 {
00072   
00073 public:
00074   
00076   enum State {
00077     Continue,                   
00078     StepConverged,              
00079     FunctionConverged,          
00080     EvaluationsExhausted        
00081   };
00082   
00084   Solver(const Parameter::List& params_in, 
00085          Executor::Interface& executor_in, 
00086          const Constraints::Linear& constraints_in,
00087          Combiner::Generic& combiner_in);
00088   
00090   Solver(const Parameter::List& params_in, 
00091          Executor::Interface& executor_in, 
00092          const Constraints::Linear& constraints_in);
00093 
00095   void setup(const Parameter::List& params_in, 
00096              Executor::Interface& executor_in, 
00097              const Constraints::Linear& constraints_in);
00098   
00101   static Point* initializeBestPointPtr(Parameter::List& params, 
00102                                        const Constraints::Linear& constraints,
00103                                        Combiner::Generic& combiner);
00104 
00106   ~Solver();
00107 
00108 
00109   // --------------------------------------------------------------------------------
00110 
00112   
00114   const vector<double>& getBestX() const;
00115 
00117   double getBestF() const;
00118 
00120   const vector<double>& getBestVecF() const;
00121   
00123 
00124   // --------------------------------------------------------------------------------
00125 
00127 
00129   APPSPACK::Solver::State solve();
00130 
00132   APPSPACK::Solver::State iterate();
00133 
00135 
00136 private:
00137 
00158   void processNewBestPoint(Point* newBestPointPtr = NULL);
00159 
00194   void generateTrialPoints();
00195 
00211   void processEvaluatedTrialPoints();
00212 
00214 
00215   void printInitializationInformation() const;
00216   void printBestPoint(const string label = "") const;
00217 
00220   void writeSolutionFile(const string filename) const;
00222 
00223 private:
00224 
00226   const Constraints::Linear& constraints;
00227 
00229   Parameter::List params;
00230 
00232   Print print;
00233 
00235   Directions directions;
00236   
00238   Point* bestPointPtr;
00239 
00241   Conveyor conveyor;
00242 
00244   List exchangeList;
00245 
00247   State state;
00248 
00250 
00252   bool isFunctionTolerance;
00253 
00255   double functionTolerance;
00256 
00258   bool isMaxEvaluations;
00259 
00261   int maxEvaluations;
00262 
00264 
00266   double boundsTolerance;
00267 
00269   Vector tmpVector;
00270 
00272 
00276   bool useSnapTo;
00277 
00279   Combiner::Generic combiner;
00280 
00282 
00288   bool useRandomOrder;
00289 };
00290 
00291 }
00292 
00294 ostream& operator<<(ostream& stream, APPSPACK::Solver::State state);
00295 
00296 #endif

 

© Sandia Corporation | Site Contact | Privacy and Security

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