main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Mar 24 2020 14:04:04 for Gecode by
doxygen
1.8.17
gecode
int
val-set.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, 2011
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_VALSET_HH__
35
#define __GECODE_INT_VALSET_HH__
36
37
#include <
gecode/int.hh
>
38
39
namespace
Gecode
{
namespace
Int {
40
44
class
ValSet
{
45
protected
:
47
RangeList
*
fst
;
49
RangeList
*
lst
;
51
int
n
;
52
public
:
54
ValSet
(
void
);
56
void
add
(
Space
& home,
int
v
);
58
int
size
(
void
)
const
;
60
bool
empty
(
void
)
const
;
62
int
min
(
void
)
const
;
64
int
max
(
void
)
const
;
66
template
<
class
View>
67
Iter::Ranges::CompareStatus
compare
(View
x
)
const
;
69
template
<
class
View>
70
bool
subset
(View
x
)
const
;
72
void
update
(
Space
& home,
ValSet
& vs);
74
void
flush
(
void
);
76
void
dispose
(
Space
& home);
78
class
Ranges
{
80
const
RangeList
* c;
81
public
:
83
84
Ranges
(
const
ValSet
& vs);
87
89
90
bool
operator ()
(
void
)
const
;
93
void
operator ++
(
void
);
95
97
98
int
min
(
void
)
const
;
101
int
max
(
void
)
const
;
103
unsigned
int
width
(
void
)
const
;
105
};
106
};
107
108
}}
109
110
#include <
gecode/int/val-set.hpp
>
111
112
#endif
113
114
// STATISTICS: int-other
val-set.hpp
Gecode::Int::ValSet::max
int max(void) const
Return largest value (provided the set is not empty)
Definition:
val-set.hpp:96
Gecode::x
Post propagator for SetVar x
Definition:
set.hh:767
Gecode::Int::ValSet::Ranges::Ranges
Ranges(const ValSet &vs)
Initialize.
Definition:
val-set.hpp:132
Gecode::Int::ValSet::Ranges::operator()
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition:
val-set.hpp:136
Gecode::Int::ValSet
Class for storing values of already assigned views.
Definition:
val-set.hh:44
int.hh
Gecode::Int::ValSet::empty
bool empty(void) const
Test whether set is empty.
Definition:
val-set.hpp:86
Gecode::Int::ValSet::lst
RangeList * lst
Last element of range list.
Definition:
val-set.hh:49
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode
Gecode toplevel namespace
Gecode::Int::ValSet::size
int size(void) const
Return size (number of values)
Definition:
val-set.hpp:81
Gecode::Int::ValSet::Ranges
Iterator over ranges.
Definition:
val-set.hh:78
Gecode::Int::ValSet::flush
void flush(void)
Flush entries.
Definition:
val-set.hpp:121
Gecode::Int::ValSet::dispose
void dispose(Space &home)
Dispose value set.
Definition:
val-set.hpp:126
Gecode::Int::ValSet::update
void update(Space &home, ValSet &vs)
Update value set during cloning.
Definition:
val-set.hpp:101
Gecode::Int::ValSet::n
int n
Number of stored values (integer precision is sufficient)
Definition:
val-set.hh:51
Gecode::Int::ValSet::Ranges::max
int max(void) const
Return largest value of range.
Definition:
val-set.hpp:150
Gecode::Int::ValSet::compare
Iter::Ranges::CompareStatus compare(View x) const
Compare view x with value set.
Definition:
val-set.hpp:161
Test::Int::Distinct::v
const int v[7]
Definition:
distinct.cpp:259
Gecode::Iter::Ranges::CompareStatus
CompareStatus
Comapre two iterators with each other.
Definition:
ranges-operations.hpp:60
Gecode::Int::ValSet::min
int min(void) const
Return smallest value (provided the set is not empty)
Definition:
val-set.hpp:91
Gecode::Int::ValSet::ValSet
ValSet(void)
Initialize.
Definition:
val-set.hpp:41
Gecode::Int::ValSet::Ranges::operator++
void operator++(void)
Move iterator to next range (if possible)
Definition:
val-set.hpp:141
Gecode::Int::ValSet::Ranges::width
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition:
val-set.hpp:155
Gecode::Int::ValSet::Ranges::min
int min(void) const
Return smallest value of range.
Definition:
val-set.hpp:146
Gecode::RangeList
Lists of ranges (intervals)
Definition:
range-list.hpp:49
Gecode::Int::ValSet::subset
bool subset(View x) const
Whether all values of x are included in the value set.
Definition:
val-set.hpp:171
Gecode::Int::ValSet::add
void add(Space &home, int v)
Add value v to value set.
Definition:
val-set.hpp:45
Gecode::Int::ValSet::fst
RangeList * fst
First element of range list.
Definition:
val-set.hh:47