Generated on Sat Oct 20 2018 12:43:45 for Gecode by doxygen 1.8.13
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  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #ifndef __GECODE_TEST_ASSIGN_HH__
39 #define __GECODE_TEST_ASSIGN_HH__
40 
41 #include <gecode/kernel.hh>
42 #include <gecode/int.hh>
43 #ifdef GECODE_HAS_SET_VARS
44 #include <gecode/set.hh>
45 #endif
46 #ifdef GECODE_HAS_FLOAT_VARS
47 #include <gecode/float.hh>
48 #endif
49 
50 #include "test/test.hh"
51 
52 namespace Test {
53 
55  namespace Assign {
56 
61  class IntTest : public Base {
62  protected:
64  int arity;
67  public:
69  IntTest(const std::string& s, int a, const Gecode::IntSet& d);
71  virtual bool run(void);
73  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) = 0;
74  };
75 
80  class BoolTest : public Base {
81  protected:
83  int arity;
84  public:
86  BoolTest(const std::string& s, int a);
88  virtual bool run(void);
90  virtual void post(Gecode::Space& home, Gecode::BoolVarArray& x) = 0;
91  };
92 
93 #ifdef GECODE_HAS_SET_VARS
94 
99  class SetTest : public Base {
100  protected:
102  int arity;
105  public:
107  SetTest(const std::string& s, int a, const Gecode::IntSet& d);
109  virtual bool run(void);
111  virtual void post(Gecode::Space& home, Gecode::SetVarArray& x) = 0;
112  };
113 
114 #endif
115 
116 #ifdef GECODE_HAS_FLOAT_VARS
117 
122  class FloatTest : public Base {
123  protected:
125  int arity;
128  public:
130  FloatTest(const std::string& s, int a, const Gecode::FloatVal& d);
132  virtual bool run(void);
134  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) = 0;
135  };
136 
137 #endif
138 
139  }
140 
141 }
142 
143 #endif
144 
145 // STATISTICS: test-branch
Gecode::FloatVal dom
Domain of variables.
Definition: assign.hh:127
virtual bool run(void)
Perform test.
Definition: assign.cpp:176
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post assignment on variables x.
BoolTest
Boolean tests.
Definition: view.hpp:1751
Integer variable array.
Definition: int.hh:763
Float variable array.
Definition: float.hh:1030
Computation spaces.
Definition: core.hpp:1701
Gecode::IntSet d(v, 7)
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
int arity
Number of variables.
Definition: assign.hh:83
int arity
Number of variables.
Definition: assign.hh:125
Base class for all tests to be run
Definition: test.hh:103
Base class for tests for assigning integer variables
Definition: assign.hh:61
Integer sets.
Definition: int.hh:174
Boolean variable array.
Definition: int.hh:808
General test support.
Definition: afc.cpp:39
Float value type.
Definition: float.hh:334
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:249
Base class for tests for branching on Boolean variables
Definition: assign.hh:80
Base class for tests for branching on float variables
Definition: assign.hh:122
Set variable array
Definition: set.hh:570
int arity
Number of variables.
Definition: assign.hh:64
Gecode::IntSet dom
Domain of variables.
Definition: assign.hh:66
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.
Base class for tests for branching on set variables
Definition: assign.hh:99
int arity
Number of variables.
Definition: assign.hh:102
Gecode::IntSet dom
Upper bound of variable domains.
Definition: assign.hh:104