Generated on Thu Apr 11 13:58:54 2019 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  *  This file is part of Gecode, the generic constraint
00012  *  development environment:
00013  *     http://www.gecode.org
00014  *
00015  *  Permission is hereby granted, free of charge, to any person obtaining
00016  *  a copy of this software and associated documentation files (the
00017  *  "Software"), to deal in the Software without restriction, including
00018  *  without limitation the rights to use, copy, modify, merge, publish,
00019  *  distribute, sublicense, and/or sell copies of the Software, and to
00020  *  permit persons to whom the Software is furnished to do so, subject to
00021  *  the following conditions:
00022  *
00023  *  The above copyright notice and this permission notice shall be
00024  *  included in all copies or substantial portions of the Software.
00025  *
00026  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00027  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00028  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00029  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00030  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00031  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00032  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00033  *
00034  */
00035 
00036 #ifndef __GECODE_FLOAT_BRANCH_HH__
00037 #define __GECODE_FLOAT_BRANCH_HH__
00038 
00039 #include <gecode/float.hh>
00040 
00046 namespace Gecode { namespace Float { namespace Branch {
00047 
00066   class MeritMin : public MeritBase<FloatView,double> {
00067   public:
00069     MeritMin(Space& home, const VarBranch<Var>& vb);
00071     MeritMin(Space& home, MeritMin& m);
00073     double operator ()(const Space& home, FloatView x, int i);
00074   };
00075 
00082   class MeritMax : public MeritBase<FloatView,double> {
00083   public:
00085     MeritMax(Space& home, const VarBranch<Var>& vb);
00087     MeritMax(Space& home, MeritMax& m);
00089     double operator ()(const Space& home, FloatView x, int i);
00090   };
00091 
00098   class MeritSize : public MeritBase<FloatView,double> {
00099   public:
00101     MeritSize(Space& home, const VarBranch<Var>& vb);
00103     MeritSize(Space& home, MeritSize& m);
00105     double operator ()(const Space& home, FloatView x, int i);
00106   };
00107 
00114   class MeritDegreeSize : public MeritBase<FloatView,double> {
00115   public:
00117     MeritDegreeSize(Space& home, const VarBranch<Var>& vb);
00119     MeritDegreeSize(Space& home, MeritDegreeSize& m);
00121     double operator ()(const Space& home, FloatView x, int i);
00122   };
00123 
00130   class MeritAFCSize : public MeritBase<FloatView,double> {
00131   protected:
00133     AFC afc;
00134   public:
00136     MeritAFCSize(Space& home, const VarBranch<Var>& vb);
00138     MeritAFCSize(Space& home, MeritAFCSize& m);
00140     double operator ()(const Space& home, FloatView x, int i);
00142     bool notice(void) const;
00144     void dispose(Space& home);
00145   };
00146 
00153   class MeritActionSize : public MeritBase<FloatView,double> {
00154   protected:
00156     Action action;
00157   public:
00159     MeritActionSize(Space& home, const VarBranch<Var>& vb);
00161     MeritActionSize(Space& home, MeritActionSize& m);
00163     double operator ()(const Space& home, FloatView x, int i);
00165     bool notice(void) const;
00167     void dispose(Space& home);
00168   };
00169 
00176   class MeritCHBSize : public MeritBase<FloatView,double> {
00177   protected:
00179     CHB chb;
00180   public:
00182     MeritCHBSize(Space& home, const VarBranch<Var>& vb);
00184     MeritCHBSize(Space& home, MeritCHBSize& m);
00186     double operator ()(const Space& home, FloatView x, int i);
00188     bool notice(void) const;
00190     void dispose(Space& home);
00191   };
00192 
00193 }}}
00194 
00195 #include <gecode/float/branch/merit.hpp>
00196 
00197 namespace Gecode { namespace Float { namespace Branch {
00198 
00200   GECODE_FLOAT_EXPORT
00201   ViewSel<FloatView>* viewsel(Space& home, const FloatVarBranch& fvb);
00202 
00203 }}}
00204 
00205 namespace Gecode { namespace Float { namespace Branch {
00206 
00225   class ValSelLq : public ValSel<FloatView,FloatNumBranch> {
00226   public:
00228     ValSelLq(Space& home, const ValBranch<Var>& vb);
00230     ValSelLq(Space& home, ValSelLq& vs);
00232     FloatNumBranch val(const Space& home, FloatView x, int i);
00233   };
00234 
00241   class ValSelGq : public ValSel<FloatView,FloatNumBranch> {
00242   public:
00244     ValSelGq(Space& home, const ValBranch<Var>& vb);
00246     ValSelGq(Space& home, ValSelGq& vs);
00248     FloatNumBranch val(const Space& home, FloatView x, int i);
00249   };
00250 
00257   class ValSelRnd : public ValSel<FloatView,FloatNumBranch> {
00258   protected:
00260     Rnd r;
00261   public:
00263     ValSelRnd(Space& home, const ValBranch<Var>& vb);
00265     ValSelRnd(Space& home, ValSelRnd& vs);
00267     FloatNumBranch val(const Space& home, FloatView x, int i);
00269     bool notice(void) const;
00271     void dispose(Space& home);
00272   };
00273 
00274 }}}
00275 
00276 #include <gecode/float/branch/val-sel.hpp>
00277 
00278 namespace Gecode { namespace Float { namespace Branch {
00279 
00298   class ValCommitLqGq  : public ValCommit<FloatView,FloatVal> {
00299   public:
00301     ValCommitLqGq(Space& home, const ValBranch<Var>& vb);
00303     ValCommitLqGq(Space& home, ValCommitLqGq& vc);
00305     ModEvent commit(Space& home, unsigned int a, FloatView x, int i,
00306                     FloatNumBranch n);
00308     NGL* ngl(Space& home, unsigned int a, FloatView x, FloatNumBranch n) const;
00310     void print(const Space& home, unsigned int a, FloatView x, int i,
00311                FloatNumBranch n,
00312                std::ostream& o) const;
00313   };
00314 
00315 }}}
00316 
00317 #include <gecode/float/branch/val-commit.hpp>
00318 
00319 namespace Gecode { namespace Float { namespace Branch {
00320 
00322   GECODE_FLOAT_EXPORT
00323   ValSelCommitBase<FloatView,FloatNumBranch>*
00324   valselcommit(Space& home, const FloatValBranch& svb);
00325 
00327   GECODE_FLOAT_EXPORT
00328   ValSelCommitBase<FloatView,FloatNumBranch>*
00329   valselcommit(Space& home, const FloatAssign& ia);
00330 
00331 }}}
00332 
00333 #endif
00334 
00335 // STATISTICS: float-branch