• Main Page
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

maptype.h

Go to the documentation of this file.
00001 /// @addtogroup unifexp
00002 /// @{
00003 
00004 /////////////////////////////////////////////////////////////////////////////
00005 ///
00006 /// @file maptype.h
00007 ///
00008 /// This file contains the definition of an abstract map type.
00009 ///
00010 /// @author Pawel Pilarczyk
00011 ///
00012 /////////////////////////////////////////////////////////////////////////////
00013 
00014 // Copyright (C) 2007 by Pawel Pilarczyk.
00015 //
00016 // This file is part of my research program package.  This is free software;
00017 // you can redistribute it and/or modify it under the terms of the GNU
00018 // General Public License as published by the Free Software Foundation;
00019 // either version 2 of the License, or (at your option) any later version.
00020 //
00021 // This software is distributed in the hope that it will be useful,
00022 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 // GNU General Public License for more details.
00025 //
00026 // You should have received a copy of the GNU General Public License along
00027 // with this software; see the file "license.txt".  If not, write to the
00028 // Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00029 // MA 02111-1307, USA.
00030 
00031 // Started on March 8, 2007. Last revision: May 1, 2007.
00032 
00033 #ifndef _maptype_h_
00034 #define _maptype_h_
00035 
00036 #include <vector>
00037 #include <string>
00038 #include <iostream>
00039 
00040 
00041 namespace unifexp {
00042 
00043 // --------------------------------------------------
00044 // -------------------- map type --------------------
00045 // --------------------------------------------------
00046 
00047 /// This is an abstract map type.
00048 /// Each specific map class must inherit from this class.
00049 template <class numType>
00050 class mapType
00051 {
00052 public:
00053         /// The constructor.
00054         mapType ();
00055 
00056         /// The virtual destructor.
00057         virtual ~mapType ();
00058 
00059         /// Returns the name of the object.
00060         virtual std::string name () const = 0;
00061 
00062         /// Sets the parameters of the map.
00063         void setParam (const numType &_paramMin, const numType &_paramMax);
00064 
00065         /// Returns the number of critical points.
00066         virtual int countCritical () const = 0;
00067 
00068         /// Returns the subsequent critical points.
00069         virtual numType criticalPoint (int n) const = 0;
00070 
00071         /// Returns the left bound of the domain of the map.
00072         virtual numType leftBound () const = 0;
00073 
00074         /// Returns the right bound of the domain of the map.
00075         virtual numType rightBound () const = 0;
00076 
00077         /// Computes an enclosure of the image of the given interval.
00078         virtual void image (const numType &x1, const numType &x2,
00079                 numType &y1, numType &y2) const = 0;
00080 
00081         /// Computes the minimal log of the derivative over those points
00082         /// in the interval [x1,x2] whose images may fall into [y1,y2]
00083         virtual numType minLogDerivative
00084                 (const numType &x1, const numType &x2,
00085                 const numType &y1, const numType &y2) const = 0;
00086 
00087 protected:
00088         /// The minimal parameter of the map.
00089         numType paramMin;
00090 
00091         /// The maximal parameter of the map.
00092         numType paramMax;
00093 
00094 private:
00095         /// Copy constructor not allowed.
00096         mapType (const mapType<numType> &);
00097 
00098         /// Assignment operator not allowed.
00099         mapType<numType> &operator = (const mapType<numType> &);
00100 
00101 }; /* class mapType */
00102 
00103 // --------------------------------------------------
00104 
00105 template <class numType>
00106 inline mapType<numType>::mapType ()
00107 {
00108         return;
00109 } /* mapType::mapType */
00110 
00111 template <class numType>
00112 inline mapType<numType>::~mapType ()
00113 {
00114         return;
00115 } /* mapType::~mapType */
00116 
00117 template <class numType>
00118 inline mapType<numType>::mapType (const mapType<numType> &)
00119 {
00120         throw "Copy constructor not implemented for map types.";
00121         return;
00122 } /* mapType::mapType */
00123 
00124 template <class numType>
00125 inline mapType<numType> &mapType<numType>::operator =
00126         (const mapType<numType> &)
00127 {
00128         throw "Assignment operator not implemented for map types.";
00129         return *this;
00130 } /* mapType::operator = */
00131 
00132 template <class numType>
00133 inline void mapType<numType>::setParam (const numType &_paramMin,
00134         const numType &_paramMax)
00135 {
00136         paramMin = _paramMin;
00137         paramMax = _paramMax;
00138         if (_paramMin > _paramMax)
00139         {
00140                 paramMin = _paramMax;
00141                 paramMax = _paramMin;
00142         }
00143         return;
00144 } /* mapType::setParam */
00145 
00146 
00147 } // namespace unifexp
00148 
00149 #endif // _maptype_h_
00150 
00151 /// @}
00152 

Generated on Sun Feb 3 2013 12:40:31 for The Uniform Expansion Software by  doxygen 1.7.2