main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Jan 28 2020 00:00:00 for Gecode by
doxygen
1.8.17
gecode
float
view
minus.hpp
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
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
6
*
7
* Copyright:
8
* Christian Schulte, 2003
9
* Vincent Barichard, 2012
10
*
11
* Last modified:
12
* $Date: 2012-04-06 13:04:47 +0200 (Fri, 06 Apr 2012) $ by $Author: schulte $
13
* $Revision: 12711 $
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
namespace
Gecode
{
namespace
Float {
41
42
/*
43
* Constructors and initialization
44
*
45
*/
46
forceinline
47
MinusView::MinusView
(
void
) {}
48
forceinline
49
MinusView::MinusView
(
const
FloatView
&
y
)
50
:
DerivedView
<
FloatView
>(
y
) {}
51
52
/*
53
* Value access
54
*
55
*/
56
forceinline
FloatVal
57
MinusView::domain
(
void
)
const
{
58
return
-
x
.domain();
59
}
60
forceinline
FloatNum
61
MinusView::min
(
void
)
const
{
62
return
-
x
.max();
63
}
64
forceinline
FloatNum
65
MinusView::max
(
void
)
const
{
66
return
-
x
.min();
67
}
68
forceinline
FloatNum
69
MinusView::med
(
void
)
const
{
70
return
-
x
.med();
71
}
72
forceinline
FloatVal
73
MinusView::val
(
void
)
const
{
74
return
-
x
.val();
75
}
76
77
forceinline
FloatNum
78
MinusView::size
(
void
)
const
{
79
return
x
.size();
80
}
81
82
83
/*
84
* Domain tests
85
*
86
*/
87
forceinline
bool
88
MinusView::zero_in
(
void
)
const
{
89
return
x
.zero_in();
90
}
91
forceinline
bool
92
MinusView::in
(
FloatNum
n
)
const
{
93
return
x
.in(-
n
);
94
}
95
forceinline
bool
96
MinusView::in
(
const
FloatVal
&
n
)
const
{
97
return
x
.in(-
n
);
98
}
99
100
101
/*
102
* Domain update by value
103
*
104
*/
105
forceinline
ModEvent
106
MinusView::lq
(
Space
& home,
int
n
) {
107
return
x
.gq(home,-
n
);
108
}
109
forceinline
ModEvent
110
MinusView::lq
(
Space
& home,
FloatNum
n
) {
111
return
x
.gq(home,-
n
);
112
}
113
forceinline
ModEvent
114
MinusView::lq
(
Space
& home,
FloatVal
n
) {
115
return
x
.gq(home,-
n
);
116
}
117
118
forceinline
ModEvent
119
MinusView::gq
(
Space
& home,
int
n
) {
120
return
x
.lq(home,-
n
);
121
}
122
forceinline
ModEvent
123
MinusView::gq
(
Space
& home,
FloatNum
n
) {
124
return
x
.lq(home,-
n
);
125
}
126
forceinline
ModEvent
127
MinusView::gq
(
Space
& home,
FloatVal
n
) {
128
return
x
.lq(home,-
n
);
129
}
130
131
forceinline
ModEvent
132
MinusView::eq
(
Space
& home,
int
n
) {
133
return
x
.eq(home,-
n
);
134
}
135
forceinline
ModEvent
136
MinusView::eq
(
Space
& home,
FloatNum
n
) {
137
return
x
.eq(home,-
n
);
138
}
139
forceinline
ModEvent
140
MinusView::eq
(
Space
& home,
const
FloatVal
&
n
) {
141
return
x
.eq(home,-
n
);
142
}
143
144
145
/*
146
* Delta information for advisors
147
*
148
*/
149
forceinline
FloatNum
150
MinusView::min
(
const
Delta
&
d
)
const
{
151
return
-
x
.max(
d
);
152
}
153
forceinline
FloatNum
154
MinusView::max
(
const
Delta
&
d
)
const
{
155
return
-
x
.min(
d
);
156
}
157
158
159
forceinline
ModEventDelta
160
MinusView::med
(
ModEvent
me) {
161
return
VarImpView<FloatVar>::med
(
me
);
162
}
163
164
}}
165
166
// STATISTICS: float-var
167
Gecode::y
Post propagator for SetVar SetOpType SetVar y
Definition:
set.hh:784
Gecode::Float::MinusView::max
FloatNum max(void) const
Return maximum of domain.
Definition:
minus.hpp:65
forceinline
#define forceinline
Definition:
config.hpp:173
Gecode::Float::MinusView::min
FloatNum min(void) const
Return minimum of domain.
Definition:
minus.hpp:61
Gecode::Float::MinusView::zero_in
bool zero_in(void) const
Test whether 0 is contained in domain.
Definition:
minus.hpp:88
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
Gecode::Float::MinusView::gq
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
Definition:
minus.hpp:119
Gecode::DerivedView
Base-class for derived views.
Definition:
view.hpp:222
Gecode
Gecode toplevel namespace
Gecode::DerivedView< FloatView >::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Gecode::Float::FloatView
Float view for float variables.
Definition:
view.hpp:56
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition:
core.hpp:281
Gecode::Float::MinusView::size
FloatNum size(void) const
Return size of domain (distance between maximum and minimum)
Definition:
minus.hpp:78
Gecode::Float::MinusView::eq
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
Definition:
minus.hpp:132
Gecode::Float::MinusView::in
bool in(FloatNum n) const
Test whether n is contained in domain.
Definition:
minus.hpp:92
Gecode::FloatNum
double FloatNum
Floating point number base type.
Definition:
float.hh:110
Gecode::Float::MinusView::domain
FloatVal domain(void) const
Return domain.
Definition:
minus.hpp:57
Gecode::Float::MinusView::MinusView
MinusView(void)
Default constructor.
Definition:
minus.hpp:47
Gecode::Float::MinusView::val
FloatVal val(void) const
Return assigned value.
Definition:
minus.hpp:73
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition:
core.hpp:142
Gecode::DerivedView< FloatView >::x
FloatView x
View from which this view is derived.
Definition:
view.hpp:230
Gecode::FloatVal
Float value type.
Definition:
float.hh:338
Gecode::VarImpView::med
static ModEventDelta med(ModEvent me)
Translate modification event me to modification event delta for view.
Gecode::Float::MinusView::lq
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
Definition:
minus.hpp:106
Test::Int::Distinct::d
Gecode::IntSet d(v, 7)
Gecode::Float::MinusView::med
FloatNum med(void) const
Return median of domain (closest representation)
Definition:
minus.hpp:69
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:238
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition:
core.hpp:169