Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
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
52namespace 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
Boolean variable array.
Definition int.hh:820
Float value type.
Definition float.hh:334
Float variable array.
Definition float.hh:1033
Integer sets.
Definition int.hh:174
Integer variable array.
Definition int.hh:772
Set variable array
Definition set.hh:573
Computation spaces.
Definition core.hpp:1744
virtual bool run(void)
Perform test.
BoolTest(const std::string &s, int a)
Construct and register test.
int arity
Number of variables.
Definition assign.hh:83
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post assignment on variables x.
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d)
Construct and register test.
Gecode::FloatVal dom
Domain of variables.
Definition assign.hh:127
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post assignment on variables x.
int arity
Number of variables.
Definition assign.hh:125
virtual bool run(void)
Perform test.
virtual bool run(void)
Perform test.
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Gecode::IntSet dom
Domain of variables.
Definition assign.hh:66
int arity
Number of variables.
Definition assign.hh:64
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post assignment on variables x.
int arity
Number of variables.
Definition assign.hh:102
Gecode::IntSet dom
Upper bound of variable domains.
Definition assign.hh:104
virtual bool run(void)
Perform test.
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post assignment on variables x.
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Base(const std::string &s)
Create and register test with name s.
Definition test.cpp:59
Tests for assignments.
Definition assign.cpp:42
General test support.
Definition afc.cpp:39