00001 // $Id: APPSPACK_Cache_Manager.hpp,v 1.9 2006/06/30 19:15:20 tgkolda Exp $ 00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Cache_Manager.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 00037 #ifndef APPSPACK_CACHE_MANAGER_HPP 00038 #define APPSPACK_CACHE_MANAGER_HPP 00039 00040 #include "APPSPACK_Vector.hpp" 00041 #include "APPSPACK_Cache_SplayTree.hpp" 00042 #include "APPSPACK_Cache_Point.hpp" 00043 #include "APPSPACK_Parameter_List.hpp" 00044 00045 namespace APPSPACK 00046 { 00047 00049 00077 namespace Cache 00078 { 00079 00085 class Manager 00086 { 00087 00088 public: 00089 00091 Manager(APPSPACK::Parameter::List& params, const Vector& scaling); 00092 00094 ~Manager(); 00095 00097 bool insert(const Vector& x, const Vector& f); 00098 00100 bool isCached(const Vector& x, Vector& f); 00101 00102 private: 00103 00105 void parseInputFile(APPSPACK::Parameter::List& params); 00106 00108 void processInputLine(string& line); 00109 00111 void openOutputFile(APPSPACK::Parameter::List& params); 00112 00114 void writeToOutputFile(const Vector& x, const Vector& f); 00115 00117 void closeOutputFile(); 00118 private: 00119 00121 SplayTree<Cache::Point>* treeptr; 00122 00124 bool isFout; 00125 00127 ofstream fout; 00128 00130 int precision; 00131 }; 00132 } // namespace Cache 00133 } // namespace APPSPACK 00134 #endif
![]()
© Sandia Corporation | Site Contact | Privacy and Security
![]()
Generated on Fri Feb 16 10:33:34 2007 for APPSPACK 5.0.1 by
1.3.9.1 written by Dimitri van Heesch,
© 1997-2002