00001 /* @HEADER@ */ 00002 // ************************************************************************ 00003 // 00004 // Sundance 00005 // Copyright (2005) Sandia Corporation 00006 // 00007 // Copyright (year first published) Sandia Corporation. Under the terms 00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 00009 // retains certain rights in this software. 00010 // 00011 // This library is free software; you can redistribute it and/or modify 00012 // it under the terms of the GNU Lesser General Public License as 00013 // published by the Free Software Foundation; either version 2.1 of the 00014 // License, or (at your option) any later version. 00015 // 00016 // This library is distributed in the hope that it will be useful, but 00017 // WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00024 // USA 00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 00026 // Sandia National Laboratories, Livermore, California, USA 00027 // 00028 // ************************************************************************ 00029 /* @HEADER@ */ 00030 00031 #ifndef SUNDANCE_FUNCTORDOMAIN_H 00032 #define SUNDANCE_FUNCTORDOMAIN_H 00033 00034 #include "SundanceDefs.hpp" 00035 00036 #ifndef DOXYGEN_DEVELOPER_ONLY 00037 00038 namespace Sundance 00039 { 00040 using namespace Teuchos; 00041 00042 class FunctorDomain 00043 { 00044 public: 00045 FunctorDomain(); 00046 00047 virtual ~FunctorDomain(){;} 00048 00049 virtual bool hasLowerBound() const {return false;} 00050 00051 virtual double lowerBound() const ; 00052 00053 virtual bool hasUpperBound() const {return false;} 00054 00055 virtual double upperBound() const ; 00056 00057 virtual bool hasExcludedPoint() const {return false;} 00058 00059 virtual double excludedPoint() const ; 00060 00061 }; 00062 00063 class UnboundedDomain : public FunctorDomain 00064 { 00065 public: 00066 UnboundedDomain(); 00067 }; 00068 00069 00070 class PositiveDomain : public FunctorDomain 00071 { 00072 public: 00073 PositiveDomain(); 00074 00075 bool hasLowerBound() const {return true;} 00076 00077 double lowerBound() const {return 0.0;} 00078 }; 00079 00080 00081 class BoundedDomain : public FunctorDomain 00082 { 00083 public: 00084 BoundedDomain(const double& lower, const double& upper); 00085 00086 bool hasLowerBound() const {return true;} 00087 00088 double lowerBound() const {return lower_;} 00089 00090 bool hasUpperBound() const {return true;} 00091 00092 double upperBound() const {return upper_;} 00093 00094 private: 00095 double lower_; 00096 00097 double upper_; 00098 }; 00099 00100 00101 class LowerBoundedDomain : public FunctorDomain 00102 { 00103 public: 00104 LowerBoundedDomain(const double& lower); 00105 00106 bool hasLowerBound() const {return true;} 00107 00108 double lowerBound() const {return lower_;} 00109 00110 private: 00111 double lower_; 00112 }; 00113 00114 class NonzeroDomain : public FunctorDomain 00115 { 00116 public: 00117 NonzeroDomain(); 00118 00119 bool hasExcludedPoint() const {return true;} 00120 00121 double excludedPoint() const {return 0.0;} 00122 }; 00123 00124 } 00125 00126 00127 #endif /* DOXYGEN_DEVELOPER_ONLY */ 00128 #endif