Generated on Tue Apr 18 10:21:35 2017 for Gecode by doxygen 1.6.3

branch.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *     Vincent Barichard <Vincent.Barichard@univ-angers.fr>
00006  *
00007  *  Copyright:
00008  *     Christian Schulte, 2012
00009  *     Vincent Barichard, 2012
00010  *
00011  *  Last modified:
00012  *     $Date: 2017-02-28 08:29:39 +0100 (Tue, 28 Feb 2017) $ by $Author: schulte $
00013  *     $Revision: 15527 $
00014  *
00015  *  This file is part of Gecode, the generic constraint
00016  *  development environment:
00017  *     http://www.gecode.org
00018  *
00019  *  Permission is hereby granted, free of charge, to any person obtaining
00020  *  a copy of this software and associated documentation files (the
00021  *  "Software"), to deal in the Software without restriction, including
00022  *  without limitation the rights to use, copy, modify, merge, publish,
00023  *  distribute, sublicense, and/or sell copies of the Software, and to
00024  *  permit persons to whom the Software is furnished to do so, subject to
00025  *  the following conditions:
00026  *
00027  *  The above copyright notice and this permission notice shall be
00028  *  included in all copies or substantial portions of the Software.
00029  *
00030  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00031  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00032  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00033  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00034  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00035  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00036  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00037  *
00038  */
00039 
00040 #ifndef __GECODE_FLOAT_BRANCH_HH__
00041 #define __GECODE_FLOAT_BRANCH_HH__
00042 
00043 #include <gecode/float.hh>
00044 
00050 namespace Gecode { namespace Float { namespace Branch {
00051 
00070   class MeritMin : public MeritBase<FloatView,double> {
00071   public:
00073     MeritMin(Space& home, const VarBranch<Var>& vb);
00075     MeritMin(Space& home, bool shared, MeritMin& m);
00077     double operator ()(const Space& home, FloatView x, int i);
00078   };
00079 
00086   class MeritMax : public MeritBase<FloatView,double> {
00087   public:
00089     MeritMax(Space& home, const VarBranch<Var>& vb);
00091     MeritMax(Space& home, bool shared, MeritMax& m);
00093     double operator ()(const Space& home, FloatView x, int i);
00094   };
00095 
00102   class MeritSize : public MeritBase<FloatView,double> {
00103   public:
00105     MeritSize(Space& home, const VarBranch<Var>& vb);
00107     MeritSize(Space& home, bool shared, MeritSize& m);
00109     double operator ()(const Space& home, FloatView x, int i);
00110   };
00111 
00118   class MeritDegreeSize : public MeritBase<FloatView,double> {
00119   public:
00121     MeritDegreeSize(Space& home, const VarBranch<Var>& vb);
00123     MeritDegreeSize(Space& home, bool shared, MeritDegreeSize& m);
00125     double operator ()(const Space& home, FloatView x, int i);
00126   };
00127 
00134   class MeritAFCSize : public MeritBase<FloatView,double> {
00135   protected:
00137     AFC afc;
00138   public:
00140     MeritAFCSize(Space& home, const VarBranch<Var>& vb);
00142     MeritAFCSize(Space& home, bool shared, MeritAFCSize& m);
00144     double operator ()(const Space& home, FloatView x, int i);
00146     bool notice(void) const;
00148     void dispose(Space& home);
00149   };
00150 
00157   class MeritActionSize : public MeritBase<FloatView,double> {
00158   protected:
00160     Action action;
00161   public:
00163     MeritActionSize(Space& home, const VarBranch<Var>& vb);
00165     MeritActionSize(Space& home, bool shared, MeritActionSize& m);
00167     double operator ()(const Space& home, FloatView x, int i);
00169     bool notice(void) const;
00171     void dispose(Space& home);
00172   };
00173 
00180   class MeritCHBSize : public MeritBase<FloatView,double> {
00181   protected:
00183     CHB chb;
00184   public:
00186     MeritCHBSize(Space& home, const VarBranch<Var>& vb);
00188     MeritCHBSize(Space& home, bool shared, MeritCHBSize& m);
00190     double operator ()(const Space& home, FloatView x, int i);
00192     bool notice(void) const;
00194     void dispose(Space& home);
00195   };
00196 
00197 }}}
00198 
00199 #include <gecode/float/branch/merit.hpp>
00200 
00201 namespace Gecode { namespace Float { namespace Branch {
00202 
00204   GECODE_FLOAT_EXPORT
00205   ViewSel<FloatView>* viewsel(Space& home, const FloatVarBranch& fvb);
00206 
00207 }}}
00208 
00209 namespace Gecode { namespace Float { namespace Branch {
00210 
00229   class ValSelLq : public ValSel<FloatView,FloatNumBranch> {
00230   public:
00232     ValSelLq(Space& home, const ValBranch<Var>& vb);
00234     ValSelLq(Space& home, bool shared, ValSelLq& vs);
00236     FloatNumBranch val(const Space& home, FloatView x, int i);
00237   };
00238 
00245   class ValSelGq : public ValSel<FloatView,FloatNumBranch> {
00246   public:
00248     ValSelGq(Space& home, const ValBranch<Var>& vb);
00250     ValSelGq(Space& home, bool shared, ValSelGq& vs);
00252     FloatNumBranch val(const Space& home, FloatView x, int i);
00253   };
00254 
00261   class ValSelRnd : public ValSel<FloatView,FloatNumBranch> {
00262   protected:
00264     Rnd r;
00265   public:
00267     ValSelRnd(Space& home, const ValBranch<Var>& vb);
00269     ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
00271     FloatNumBranch val(const Space& home, FloatView x, int i);
00273     bool notice(void) const;
00275     void dispose(Space& home);
00276   };
00277 
00278 }}}
00279 
00280 #include <gecode/float/branch/val-sel.hpp>
00281 
00282 namespace Gecode { namespace Float { namespace Branch {
00283 
00302   class ValCommitLqGq  : public ValCommit<FloatView,FloatVal> {
00303   public:
00305     ValCommitLqGq(Space& home, const ValBranch<Var>& vb);
00307     ValCommitLqGq(Space& home, bool shared, ValCommitLqGq& vc);
00309     ModEvent commit(Space& home, unsigned int a, FloatView x, int i,
00310                     FloatNumBranch n);
00312     NGL* ngl(Space& home, unsigned int a, FloatView x, FloatNumBranch n) const;
00314     void print(const Space& home, unsigned int a, FloatView x, int i,
00315                FloatNumBranch n,
00316                std::ostream& o) const;
00317   };
00318 
00319 }}}
00320 
00321 #include <gecode/float/branch/val-commit.hpp>
00322 
00323 namespace Gecode { namespace Float { namespace Branch {
00324 
00326   GECODE_FLOAT_EXPORT
00327   ValSelCommitBase<FloatView,FloatNumBranch>*
00328   valselcommit(Space& home, const FloatValBranch& svb);
00329 
00331   GECODE_FLOAT_EXPORT
00332   ValSelCommitBase<FloatView,FloatNumBranch>*
00333   valselcommit(Space& home, const FloatAssign& ia);
00334 
00335 }}}
00336 
00337 #endif
00338 
00339 // STATISTICS: float-branch