Generated on Fri Oct 19 11:24:57 2018 for Gecode by doxygen 1.6.3

var-imp.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Filip Konvicka <filip.konvicka@logis.cz>
00005  *     Lubomir Moric <lubomir.moric@logis.cz>
00006  *     Vincent Barichard <Vincent.Barichard@univ-angers.fr>
00007  *
00008  *  Contributing authors:
00009  *     Christian Schulte <schulte@gecode.org>
00010  *
00011  *  Copyright:
00012  *     LOGIS, s.r.o., 2008
00013  *     Christian Schulte, 2010
00014  *     Vincent Barichard, 2012
00015  *
00016  *  This file is part of Gecode, the generic constraint
00017  *  development environment:
00018  *     http://www.gecode.org
00019  *
00020  *  Permission is hereby granted, free of charge, to any person obtaining
00021  *  a copy of this software and associated documentation files (the
00022  *  "Software"), to deal in the Software without restriction, including
00023  *  without limitation the rights to use, copy, modify, merge, publish,
00024  *  distribute, sublicense, and/or sell copies of the Software, and to
00025  *  permit persons to whom the Software is furnished to do so, subject to
00026  *  the following conditions:
00027  *
00028  *  The above copyright notice and this permission notice shall be
00029  *  included in all copies or substantial portions of the Software.
00030  *
00031  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00032  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00033  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00034  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00035  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00036  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00037  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00038  *
00039  */
00040 
00041 #include <cmath>
00042 
00043 namespace Gecode { namespace Float {
00044 
00045   class FloatVarImp;
00046 
00048   class FloatDelta : public Delta {
00049     friend class FloatVarImp;
00050   private:
00051     FloatNum _min; 
00052     FloatNum _max; 
00053   public:
00055     FloatDelta(void);
00057     FloatDelta(FloatNum min, FloatNum max);
00058   private:
00060     FloatNum min(void) const;
00062     FloatNum max(void) const;
00063   };
00064 
00065 }}
00066 
00067 #include <gecode/float/var-imp/delta.hpp>
00068 
00069 namespace Gecode { namespace Float {
00070 
00076   class FloatVarImp : public FloatVarImpBase {
00077   protected:
00079     FloatVal dom;
00081     FloatVarImp(Space& home, FloatVarImp& x);
00082   public:
00084     FloatVarImp(Space& home, const FloatVal& d);
00085 
00087 
00088 
00089     FloatVal domain(void) const;
00091     FloatNum min(void) const;
00093     FloatNum max(void) const;
00095     FloatVal val(void) const;
00097     FloatNum med(void) const;
00098 
00100     FloatNum size(void) const;
00102 
00104 
00105 
00106     bool assigned(void) const;
00107 
00109     bool zero_in(void) const;
00111     bool in(FloatNum n) const;
00113     bool in(const FloatVal& n) const;
00115 
00117 
00118 
00119     ModEvent eq(Space& home, FloatNum n);
00121     ModEvent eq(Space& home, const FloatVal& n);
00123     ModEvent lq(Space& home, FloatNum n);
00125     ModEvent lq(Space& home, const FloatVal& n);
00127     ModEvent gq(Space& home, FloatNum n);
00129     ModEvent gq(Space& home, const FloatVal& n);
00131 
00133 
00134 
00142     GECODE_FLOAT_EXPORT void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
00144     GECODE_FLOAT_EXPORT void reschedule(Space& home, Propagator& p, PropCond pc);
00153     GECODE_FLOAT_EXPORT void subscribe(Space& home, Advisor& a, bool fail);
00155 
00157 
00158 
00159     static ModEventDelta med(ModEvent me);
00161 
00162 
00163   private:
00165     GECODE_FLOAT_EXPORT FloatVarImp* perform_copy(Space& home);
00166   public:
00168 
00169 
00170     FloatVarImp* copy(Space& home);
00172 
00174 
00175 
00176     static FloatNum min(const Delta& d);
00178     static FloatNum max(const Delta& d);
00180   };
00181 
00182 }}
00183 
00184 #include <gecode/float/var-imp/float.hpp>
00185 
00186 // STATISTICS: float-var
00187