Generated on Fri Mar 20 15:55:58 2015 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: 2013-07-04 17:03:13 +0200 (Thu, 04 Jul 2013) $ by $Author: schulte $
00013  *     $Revision: 13801 $
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& 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& 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& 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& 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& 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 MeritActivitySize : public MeritBase<FloatView,double> {
00158   protected:
00160     Activity activity;
00161   public:
00163     MeritActivitySize(Space& home, const VarBranch& vb);
00165     MeritActivitySize(Space& home, bool shared, MeritActivitySize& m);
00167     double operator ()(const Space& home, FloatView x, int i);
00169     bool notice(void) const;
00171     void dispose(Space& home);
00172   };
00173 
00174 }}}
00175 
00176 #include <gecode/float/branch/merit.hpp>
00177 
00178 namespace Gecode { namespace Float { namespace Branch {
00179 
00181   GECODE_FLOAT_EXPORT
00182   ViewSel<FloatView>* viewsel(Space& home, const FloatVarBranch& fvb);
00183 
00184 }}}
00185 
00186 namespace Gecode { namespace Float { namespace Branch {
00187 
00206   class ValSelLq : public ValSel<FloatView,FloatNumBranch> {
00207   public:
00209     ValSelLq(Space& home, const ValBranch& vb);
00211     ValSelLq(Space& home, bool shared, ValSelLq& vs);
00213     FloatNumBranch val(const Space& home, FloatView x, int i);
00214   };
00215 
00222   class ValSelGq : public ValSel<FloatView,FloatNumBranch> {
00223   public:
00225     ValSelGq(Space& home, const ValBranch& vb);
00227     ValSelGq(Space& home, bool shared, ValSelGq& vs);
00229     FloatNumBranch val(const Space& home, FloatView x, int i);
00230   };
00231 
00238   class ValSelRnd : public ValSel<FloatView,FloatNumBranch> {
00239   protected:
00241     Rnd r;
00242   public:
00244     ValSelRnd(Space& home, const ValBranch& vb);
00246     ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
00248     FloatNumBranch val(const Space& home, FloatView x, int i);
00250     bool notice(void) const;
00252     void dispose(Space& home);
00253   };
00254 
00255 }}}
00256 
00257 #include <gecode/float/branch/val-sel.hpp>
00258 
00259 namespace Gecode { namespace Float { namespace Branch {
00260 
00279   class ValCommitLqGq  : public ValCommit<FloatView,FloatVal> {
00280   public:
00282     ValCommitLqGq(Space& home, const ValBranch& vb);
00284     ValCommitLqGq(Space& home, bool shared, ValCommitLqGq& vc);
00286     ModEvent commit(Space& home, unsigned int a, FloatView x, int i, 
00287                     FloatNumBranch n);
00289     NGL* ngl(Space& home, unsigned int a, FloatView x, FloatNumBranch n) const;
00291     void print(const Space& home, unsigned int a, FloatView x, int i, 
00292                FloatNumBranch n,
00293                std::ostream& o) const;
00294   };
00295 
00296 }}}
00297 
00298 #include <gecode/float/branch/val-commit.hpp>
00299 
00300 namespace Gecode { namespace Float { namespace Branch {
00301 
00303   GECODE_FLOAT_EXPORT
00304   ValSelCommitBase<FloatView,FloatNumBranch>* 
00305   valselcommit(Space& home, const FloatValBranch& svb);
00306 
00308   GECODE_FLOAT_EXPORT
00309   ValSelCommitBase<FloatView,FloatNumBranch>* 
00310   valselcommit(Space& home, const FloatAssign& ia);
00311 
00312 }}}
00313 
00314 #endif
00315 
00316 // STATISTICS: float-branch