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