Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
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 * This file is part of Gecode, the generic constraint
16 * development environment:
17 * http://www.gecode.org
18 *
19 * Permission is hereby granted, free of charge, to any person obtaining
20 * a copy of this software and associated documentation files (the
21 * "Software"), to deal in the Software without restriction, including
22 * without limitation the rights to use, copy, modify, merge, publish,
23 * distribute, sublicense, and/or sell copies of the Software, and to
24 * permit persons to whom the Software is furnished to do so, subject to
25 * the following conditions:
26 *
27 * The above copyright notice and this permission notice shall be
28 * included in all copies or substantial portions of the Software.
29 *
30 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 *
38 */
39
40#ifndef __GECODE_TEST_BRANCH_HH__
41#define __GECODE_TEST_BRANCH_HH__
42
43#include <gecode/kernel.hh>
44
45#include <gecode/int.hh>
46
47#ifdef GECODE_HAS_SET_VARS
48#include <gecode/set.hh>
49#endif
50
51#ifdef GECODE_HAS_FLOAT_VARS
52#include <gecode/float.hh>
53#endif
54
55#include "test/test.hh"
56
57namespace Test {
58
60 namespace Branch {
61
66 class IntTest : public Base {
67 protected:
69 int arity;
72 public:
74 IntTest(const std::string& s, int a, const Gecode::IntSet& d);
76 virtual bool run(void);
78 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) = 0;
79 };
80
85 class BoolTest : public Base {
86 protected:
88 int arity;
89 public:
91 BoolTest(const std::string& s, int a);
93 virtual bool run(void);
95 virtual void post(Gecode::Space& home, Gecode::BoolVarArray& x) = 0;
96 };
97
98#ifdef GECODE_HAS_SET_VARS
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#endif
118
119#ifdef GECODE_HAS_FLOAT_VARS
124 class FloatTest : public Base {
125 protected:
127 int arity;
132 public:
134 FloatTest(const std::string& s, int a, const Gecode::FloatVal& d, int nbs);
136 virtual bool run(void);
138 virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) = 0;
139 };
140#endif
141
142 }
143
144}
145
146#endif
147
148// STATISTICS: test-branch
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
Boolean variable array.
Definition int.hh:808
Float value type.
Definition float.hh:334
Float variable array.
Definition float.hh:1030
Integer sets.
Definition int.hh:174
Integer variable array.
Definition int.hh:763
Set variable array
Definition set.hh:570
Computation spaces.
Definition core.hpp:1742
Base class for all tests to be run
Definition test.hh:103
Base class for tests for branching on Boolean variables
Definition branch.hh:85
BoolTest(const std::string &s, int a)
Construct and register test.
Definition branch.cpp:604
int arity
Number of variables.
Definition branch.hh:88
virtual bool run(void)
Perform test.
Definition branch.cpp:609
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post propagators on variables x.
Base class for tests for branching on float variables
Definition branch.hh:124
Gecode::FloatVal dom
Domain of variables.
Definition branch.hh:129
int arity
Number of variables.
Definition branch.hh:127
int nbSols
Maximum number of solutions searched during solving.
Definition branch.hh:131
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d, int nbs)
Construct and register test.
Definition branch.cpp:898
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post propagators on variables x.
virtual bool run(void)
Perform test.
Definition branch.cpp:903
Base class for tests for branching on integer variables
Definition branch.hh:66
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition branch.cpp:430
int arity
Number of variables.
Definition branch.hh:69
virtual bool run(void)
Perform test.
Definition branch.cpp:435
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post propagators on variables x.
Gecode::IntSet dom
Domain of variables.
Definition branch.hh:71
Base class for tests for branching on set variables
Definition branch.hh:103
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post propagators on variables x.
int arity
Number of variables.
Definition branch.hh:106
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition branch.cpp:735
virtual bool run(void)
Perform test.
Definition branch.cpp:740
Gecode::IntSet dom
Domain of variables.
Definition branch.hh:108
General test support.
Definition afc.cpp:39