main page
modules
namespaces
classes
files
Gecode home
Generated on Mon Jul 27 2020 00:00:00 for Gecode by
doxygen
1.8.18
gecode
int
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
39
namespace
Gecode
{
namespace
Int {
40
47
template
<
class
View,
class
A>
48
class
SupportValues
{
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
Unsupported(
SupportValues
& sv0);
75
77
78
bool
operator ()
(
void
)
const
;
81
void
operator ++
(
void
);
83
85
86
int
val
(
void
)
const
;
89
};
90
92
View x;
94
Gecode::Support::BitSetBase
bs;
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
void
reset
(
void
);
119
bool
operator ()
(
void
)
const
;
121
void
operator ++
(
void
);
123
125
126
int
val
(
void
)
const
;
129
131
132
void
support
(
void
);
135
bool
support
(
int
n
);
137
bool
support
(
long
long
int
n
);
139
ModEvent
tell
(
Space
& home);
141
};
142
143
}}
144
145
#include <
gecode/int/support-values.hpp
>
146
147
#endif
148
149
// STATISTICS: int-prop
150
Gecode::Int::SupportValues::SupportValues
SupportValues(A &a, View x)
Initialize for view x.
Definition:
support-values.hpp:45
Gecode::Int::SupportValues::val
int val(void) const
Return current value.
Definition:
support-values.hpp:88
int.hh
Gecode::Int::SupportValues
Support value iterator and recorder
Definition:
support-values.hh:48
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Int::SupportValues::operator++
void operator++(void)
Move iterator to next value (if possible)
Definition:
support-values.hpp:72
Gecode
Gecode toplevel namespace
x
Node * x
Pointer to corresponding Boolean expression node.
Definition:
bool-expr.cpp:249
Gecode::Int::SupportValues::support
void support(void)
Mark current (iterator) value as supported.
Definition:
support-values.hpp:94
Gecode::Int::SupportValues::~SupportValues
~SupportValues(void)
Destructor.
Definition:
support-values.hpp:65
Gecode::Support::BitSetBase
Basic bitset support.
Definition:
bitset-base.hpp:190
Gecode::Int::SupportValues::operator()
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition:
support-values.hpp:82
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Gecode::Int::SupportValues::reset
void reset(void)
Reset iterator.
Definition:
support-values.hpp:38
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition:
core.hpp:62
Gecode::Int::SupportValues::tell
ModEvent tell(Space &home)
Remove all unsupported values.
Definition:
support-values.hpp:175
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition:
arithmetic.cpp:67
support-values.hpp
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:234
Gecode::Float::Arithmetic::pos
bool pos(const View &x)
Test whether x is postive.
Definition:
mult.hpp:41
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:232