Generated on Tue Apr 18 10:21:42 2017 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  *  Last modified:
00017  *     $Date: 2017-02-21 06:45:56 +0100 (Tue, 21 Feb 2017) $ by $Author: schulte $
00018  *     $Revision: 15465 $
00019  *
00020  *  This file is part of Gecode, the generic constraint
00021  *  development environment:
00022  *     http://www.gecode.org
00023  *
00024  *  Permission is hereby granted, free of charge, to any person obtaining
00025  *  a copy of this software and associated documentation files (the
00026  *  "Software"), to deal in the Software without restriction, including
00027  *  without limitation the rights to use, copy, modify, merge, publish,
00028  *  distribute, sublicense, and/or sell copies of the Software, and to
00029  *  permit persons to whom the Software is furnished to do so, subject to
00030  *  the following conditions:
00031  *
00032  *  The above copyright notice and this permission notice shall be
00033  *  included in all copies or substantial portions of the Software.
00034  *
00035  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00036  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00037  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00038  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00039  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00040  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00041  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00042  *
00043  */
00044 
00045 #include <cmath>
00046 
00047 namespace Gecode { namespace Float {
00048 
00049   class FloatVarImp;
00050 
00052   class FloatDelta : public Delta {
00053     friend class FloatVarImp;
00054   private:
00055     FloatNum _min; 
00056     FloatNum _max; 
00057   public:
00059     FloatDelta(void);
00061     FloatDelta(FloatNum min, FloatNum max);
00062   private:
00064     FloatNum min(void) const;
00066     FloatNum max(void) const;
00067   };
00068 
00069 }}
00070 
00071 #include <gecode/float/var-imp/delta.hpp>
00072 
00073 namespace Gecode { namespace Float {
00074 
00080   class FloatVarImp : public FloatVarImpBase {
00081   protected:
00083     FloatVal dom;
00085     FloatVarImp(Space& home, bool share, FloatVarImp& x);
00086   public:
00088     FloatVarImp(Space& home, const FloatVal& d);
00089 
00091 
00092 
00093     FloatVal domain(void) const;
00095     FloatNum min(void) const;
00097     FloatNum max(void) const;
00099     FloatVal val(void) const;
00101     FloatNum med(void) const;
00102 
00104     FloatNum size(void) const;
00106 
00108 
00109 
00110     bool assigned(void) const;
00111 
00113     bool zero_in(void) const;
00115     bool in(FloatNum n) const;
00117     bool in(const FloatVal& n) const;
00119 
00121 
00122 
00123     ModEvent eq(Space& home, FloatNum n);
00125     ModEvent eq(Space& home, const FloatVal& n);
00127     ModEvent lq(Space& home, FloatNum n);
00129     ModEvent lq(Space& home, const FloatVal& n);
00131     ModEvent gq(Space& home, FloatNum n);
00133     ModEvent gq(Space& home, const FloatVal& n);
00135 
00137 
00138 
00146     GECODE_FLOAT_EXPORT void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
00148     GECODE_FLOAT_EXPORT void reschedule(Space& home, Propagator& p, PropCond pc);
00157     GECODE_FLOAT_EXPORT void subscribe(Space& home, Advisor& a, bool fail);
00159 
00161 
00162 
00163     static ModEventDelta med(ModEvent me);
00165 
00166 
00167   private:
00169     GECODE_FLOAT_EXPORT FloatVarImp* perform_copy(Space& home, bool share);
00170   public:
00172 
00173 
00174     FloatVarImp* copy(Space& home, bool share);
00176 
00178 
00179 
00180     static FloatNum min(const Delta& d);
00182     static FloatNum max(const Delta& d);
00184   };
00185 
00186 }}
00187 
00188 #include <gecode/float/var-imp/float.hpp>
00189 
00190 // STATISTICS: float-var
00191