Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
support-values.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 * Copyright:
7 * Christian Schulte, 2008
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.org
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 *
32 */
33
34#ifndef __GECODE_INT_SUPPORT_VALUES_HH__
35#define __GECODE_INT_SUPPORT_VALUES_HH__
36
37#include <gecode/int.hh>
38
39namespace Gecode { namespace Int {
40
47 template<class View, class A>
49 private:
51 A& a;
53 class RangePos {
54 public:
55 int min;
56 unsigned int pos;
57 };
59 class Unsupported {
60 private:
62 RangePos* rp;
64 unsigned int p;
66 SupportValues& sv;
68 void find(void);
69 public:
71
72
73 Unsupported(SupportValues& sv0);
75
77
78
79 bool operator ()(void) const;
81 void operator ++(void);
83
85
86
87 int val(void) const;
89 };
90
92 View x;
96 RangePos* rp_fst;
98 RangePos* rp_lst;
100 RangePos* rp;
102 int v;
104 int max;
105
107 bool _support(int n);
108 public:
110 SupportValues(A& a, View x);
112 ~SupportValues(void);
113
115
116
117 void reset(void);
119 bool operator ()(void) const;
121 void operator ++(void);
123
125
126
127 int val(void) const;
129
131
132
133 void support(void);
135 bool support(int n);
137 bool support(long long int n);
139 ModEvent tell(Space& home);
141 };
142
143}}
144
146
147#endif
148
149// STATISTICS: int-prop
150
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
Support value iterator and recorder
int val(void) const
Return current value.
void support(void)
Mark current (iterator) value as supported.
~SupportValues(void)
Destructor.
SupportValues(A &a, View x)
Initialize for view x.
ModEvent tell(Space &home)
Remove all unsupported values.
void operator++(void)
Move iterator to next value (if possible)
void reset(void)
Reset iterator.
bool operator()(void) const
Test whether iterator is still at a value or done.
Computation spaces.
Definition core.hpp:1742
Basic bitset support.
Gecode toplevel namespace
int ModEvent
Type for modification events.
Definition core.hpp:62