Generated on Sat Feb 7 2015 02:01:17 for Gecode by doxygen 1.8.9.1
float.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, 2002
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  */
50  : VarImpView<FloatVar>(y.varimp()) {}
53  : VarImpView<FloatVar>(y) {}
54 
55  /*
56  * Value access
57  *
58  */
60  FloatView::domain(void) const {
61  return x->domain();
62  }
64  FloatView::min(void) const {
65  return x->min();
66  }
68  FloatView::max(void) const {
69  return x->max();
70  }
72  FloatView::med(void) const {
73  return x->med();
74  }
76  FloatView::val(void) const {
77  return x->val();
78  }
79 
81  FloatView::size(void) const {
82  return x->size();
83  }
84 
85 
86  /*
87  * Domain tests
88  *
89  */
90  forceinline bool
91  FloatView::zero_in(void) const {
92  return x->zero_in();
93  }
94  forceinline bool
96  return x->in(n);
97  }
98  forceinline bool
99  FloatView::in(const FloatVal& n) const {
100  return x->in(n);
101  }
102 
103 
104  /*
105  * Domain update by value
106  *
107  */
109  FloatView::lq(Space& home, int n) {
110  return x->lq(home,n);
111  }
114  return x->lq(home,n);
115  }
118  return x->lq(home,n);
119  }
120 
122  FloatView::gq(Space& home, int n) {
123  return x->gq(home,n);
124  }
127  return x->gq(home,n);
128  }
131  return x->gq(home,n);
132  }
133 
135  FloatView::eq(Space& home, int n) {
136  return x->eq(home,n);
137  }
140  return x->eq(home,n);
141  }
143  FloatView::eq(Space& home, const FloatVal& n) {
144  return x->eq(home,n);
145  }
146 
147 
148 
149  /*
150  * Delta information for advisors
151  *
152  */
154  FloatView::min(const Delta& d) const {
155  return FloatVarImp::min(d);
156  }
158  FloatView::max(const Delta& d) const {
159  return FloatVarImp::max(d);
160  }
161 
162 
165  return VarImpView<FloatVar>::med(me);
166  }
167 
168 }}
169 
170 // STATISTICS: float-var
171 
FloatNum min(void) const
Return minimum of domain.
Definition: float.hpp:71
FloatNum size(void) const
Return size of domain (distance between maximum and minimum)
Definition: float.hpp:81
static ModEventDelta med(ModEvent me)
Translate modification event me to modification event delta for view.
Definition: view.hpp:484
FloatVal val(void) const
Return assigned value.
Definition: float.hpp:76
FloatNum min(void) const
Return minimum of domain.
Definition: float.hpp:64
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
Definition: float.hpp:122
bool zero_in(void) const
Test whether 0 is contained in domain.
Definition: float.hpp:104
int ModEvent
Type for modification events.
Definition: core.hpp:146
bool zero_in(void) const
Test whether 0 is contained in domain.
Definition: float.hpp:91
Computation spaces.
Definition: core.hpp:1362
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
Definition: float.hpp:135
Gecode::IntSet d(v, 7)
FloatNum size(void) const
Return width of domain (distance between maximum and minimum)
Definition: float.hpp:93
FloatView(void)
Default constructor.
Definition: float.hpp:47
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
FloatNum med(void) const
Return median of domain (closest representation)
Definition: float.hpp:83
bool in(FloatNum n) const
Test whether n is contained in domain.
Definition: float.hpp:108
Float variable implementation.
Definition: var-imp.hpp:80
bool in(FloatNum n) const
Test whether n is contained in domain.
Definition: float.hpp:95
Base-class for variable implementation views.
Definition: view.hpp:117
FloatVal val(void) const
Return value of domain (only if assigned)
Definition: float.hpp:79
FloatVal domain(void) const
Return domain.
Definition: float.hpp:60
Float value type.
Definition: float.hh:321
ModEvent eq(Space &home, FloatNum n)
Restrict domain values to be equal to n.
Definition: float.hpp:189
Generic domain change information to be supplied to advisors.
Definition: core.hpp:275
FloatVal domain(void) const
Return domain.
Definition: float.hpp:67
FloatNum med(void) const
Return median of domain (closest representation)
Definition: float.hpp:72
#define forceinline
Definition: config.hpp:132
Float variables.
Definition: float.hh:857
FloatNum max(void) const
Return maximum of domain.
Definition: float.hpp:68
ModEvent gq(Space &home, FloatNum n)
Restrict domain values to be greater or equal than n.
Definition: float.hpp:137
Gecode toplevel namespace
FloatNum max(void) const
Return maximum of domain.
Definition: float.hpp:75
VarImpType * x
Pointer to variable implementation.
Definition: view.hpp:125
int ModEventDelta
Modification event deltas.
Definition: core.hpp:173
double FloatNum
Floating point number base type.
Definition: float.hh:108
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
Definition: float.hpp:109
ModEvent lq(Space &home, FloatNum n)
Restrict domain values to be less or equal than n.
Definition: float.hpp:163