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

Go to the documentation of this file.
00001 // $Id: APPSPACK_Parameter_Entry.hpp,v 1.13 2006/06/30 01:42:08 tgkolda Exp $ 
00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Parameter_Entry.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_PARAMETER_ENTRY_HPP
00039 #define APPSPACK_PARAMETER_ENTRY_HPP
00040 
00041 #include "APPSPACK_Common.hpp"          // class data element (string)
00042 #include "APPSPACK_Vector.hpp"
00043 #include "APPSPACK_Matrix.hpp"
00044 
00045 namespace APPSPACK {
00046 
00048 namespace Parameter {
00049 
00050 class List; // another parameter type (forward declaration)
00051 
00064 class Entry {
00065 
00066 public:
00067 
00075   
00077   Entry();
00078   
00080   Entry(const Entry& source);
00081 
00083   Entry(bool value, bool isCreatedByGet = false);
00084 
00086   Entry(int value, bool isCreatedByGet = false);
00087 
00089   Entry(double value, bool isCreatedByGet = false);
00090 
00092   Entry(const string& value, bool isCreatedByGet = false);
00093 
00095   Entry(const Vector& value, bool isCreatedByGet = false);
00096 
00098   ~Entry();
00099 
00101 
00103 
00105   Entry& operator=(const Entry& source);
00106 
00108   
00113 
00114   List& setList(bool isCreatedByGet = false);
00116   List& getListValue();
00118   const List& getListValue() const;
00120 
00129 
00130   void setValue(bool value, bool isCreatedByGet = false);
00132   void setValue(int value, bool isCreatedByGet = false);
00134   void setValue(double value, bool isCreatedByGet = false);
00136   void setValue(const char* value, bool isCreatedByGet = false);
00138   void setValue(const string& value, bool isCreatedByGet = false);
00140   void setValue(const Vector& value, bool isCreatedByGet = false);
00142   void setValue(const Matrix& value, bool isCreatedByGet = false);
00144 
00151 
00152   bool isBool() const;
00154   bool isInt() const;
00156   bool isDouble() const;
00158   bool isString() const;
00160   bool isList() const;
00162   bool isVector() const;
00164   bool isMatrix() const;
00166   
00176 
00177   bool getBoolValue() const;
00179   int getIntValue() const;
00181   double getDoubleValue() const;
00183   const string& getStringValue() const;
00185   const Vector& getVectorValue() const;
00187   const Matrix& getMatrixValue() const;
00189 
00200 
00201   void pack() const;
00203   void unpack();
00204   
00206 
00208 
00210 
00216   ostream& leftshift(ostream& stream) const;
00217 
00219 
00220 private:
00221 
00223   void reset();
00224   
00226   enum EntryType { 
00228     APPSPACK_NONE, 
00230     APPSPACK_BOOL, 
00232     APPSPACK_INT, 
00234     APPSPACK_DOUBLE, 
00236     APPSPACK_STRING,
00238     APPSPACK_LIST,
00240     APPSPACK_VECTOR,
00242     APPSPACK_MATRIX
00243   };
00244 
00246   EntryType type;
00247 
00249   bool bval;
00250 
00252   int ival;
00253 
00255   double dval;
00256 
00258   string sval;
00259 
00261   List* lval;           
00262 
00264   Vector vectorval;
00265 
00267   Matrix matrixval;
00268 
00270   mutable bool isGotten;
00271 
00273   mutable bool isSetByGet;
00274 
00275 };
00276 
00277 } // namespace Parameter
00278 } // namespace APPSPACK
00279 
00281 ostream& operator<<(ostream& stream, const APPSPACK::Parameter::Entry& e);
00282 
00283 #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