Generated on Sat Feb 7 2015 02:01:15 for Gecode by doxygen 1.8.9.1
branch.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Mikael Lagerkvist <lagerkvist@gecode.org>
5  * Christian Schulte <schulte@gecode.org>
6  *
7  * Contributing authors:
8  * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
9  *
10  * Copyright:
11  * Mikael Lagerkvist, 2006
12  * Christian Schulte, 2009
13  * Vincent Barichard, 2012
14  *
15  * Last modified:
16  * $Date: 2012-04-05 12:00:11 +0200 (Thu, 05 Apr 2012) $ by $Author: vbarichard $
17  * $Revision: 12703 $
18  *
19  * This file is part of Gecode, the generic constraint
20  * development environment:
21  * http://www.gecode.org
22  *
23  * Permission is hereby granted, free of charge, to any person obtaining
24  * a copy of this software and associated documentation files (the
25  * "Software"), to deal in the Software without restriction, including
26  * without limitation the rights to use, copy, modify, merge, publish,
27  * distribute, sublicense, and/or sell copies of the Software, and to
28  * permit persons to whom the Software is furnished to do so, subject to
29  * the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be
32  * included in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41  *
42  */
43 
44 #ifndef __GECODE_TEST_BRANCH_HH__
45 #define __GECODE_TEST_BRANCH_HH__
46 
47 #include <gecode/kernel.hh>
48 
49 #include <gecode/int.hh>
50 
51 #ifdef GECODE_HAS_SET_VARS
52 #include <gecode/set.hh>
53 #endif
54 
55 #ifdef GECODE_HAS_FLOAT_VARS
56 #include <gecode/float.hh>
57 #endif
58 
59 #include "test/test.hh"
60 
61 namespace Test {
62 
64  namespace Branch {
65 
70  class IntTest : public Base {
71  protected:
73  int arity;
76  public:
78  IntTest(const std::string& s, int a, const Gecode::IntSet& d);
80  virtual bool run(void);
82  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) = 0;
83  };
84 
89  class BoolTest : public Base {
90  protected:
92  int arity;
93  public:
95  BoolTest(const std::string& s, int a);
97  virtual bool run(void);
99  virtual void post(Gecode::Space& home, Gecode::BoolVarArray& x) = 0;
100  };
101 
102 #ifdef GECODE_HAS_SET_VARS
103 
107  class SetTest : public Base {
108  protected:
110  int arity;
113  public:
115  SetTest(const std::string& s, int a, const Gecode::IntSet& d);
117  virtual bool run(void);
119  virtual void post(Gecode::Space& home, Gecode::SetVarArray& x) = 0;
120  };
121 #endif
122 
123 #ifdef GECODE_HAS_FLOAT_VARS
124 
128  class FloatTest : public Base {
129  protected:
131  int arity;
135  int nbSols;
136  public:
138  FloatTest(const std::string& s, int a, const Gecode::FloatVal& d, int nbs);
140  virtual bool run(void);
142  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) = 0;
143  };
144 #endif
145 
146  }
147 
148 }
149 
150 #endif
151 
152 // STATISTICS: test-branch
Base class for tests for branching on Boolean variables
Definition: branch.hh:89
virtual bool run(void)
Perform test.
Definition: branch.cpp:402
Gecode::FloatVal dom
Domain of variables.
Definition: branch.hh:133
int arity
Number of variables.
Definition: branch.hh:92
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition: branch.cpp:737
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post propagators on variables x.
BoolTest(const std::string &s, int a)
Construct and register test.
Definition: branch.cpp:565
int nbSols
Maximum number of solutions searched during solving.
Definition: branch.hh:135
Gecode::IntSet dom
Domain of variables.
Definition: branch.hh:75
virtual bool run(void)
Perform test.
Definition: branch.cpp:742
Integer variable array.
Definition: int.hh:741
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post propagators on variables x.
virtual bool run(void)
Perform test.
Definition: branch.cpp:570
int arity
Number of variables.
Definition: branch.hh:110
Float variable array.
Definition: float.hh:1016
Computation spaces.
Definition: core.hpp:1362
Gecode::IntSet d(v, 7)
Base class for tests for branching on float variables
Definition: branch.hh:128
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition: branch.cpp:397
Base class for all tests to be run
Definition: test.hh:107
Gecode::IntSet dom
Domain of variables.
Definition: branch.hh:112
Integer sets.
Definition: int.hh:171
Boolean variable array.
Definition: int.hh:786
virtual bool run(void)
Perform test.
Definition: branch.cpp:895
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post propagators on variables x.
General test support.
Definition: afc.cpp:43
Base class for tests for branching on integer variables
Definition: branch.hh:70
Float value type.
Definition: float.hh:321
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
int arity
Number of variables.
Definition: branch.hh:73
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post propagators on variables x.
Set variable array
Definition: set.hh:571
Base class for tests for branching on set variables
Definition: branch.hh:107
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d, int nbs)
Construct and register test.
Definition: branch.cpp:890
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
int arity
Number of variables.
Definition: branch.hh:131