/usr/include/gecode/set/var/set.hpp is in libgecode-dev 4.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
* Christian Schulte <schulte@gecode.org>
* Gabor Szokoli <szokoli@gecode.org>
*
* Copyright:
* Guido Tack, 2004
* Christian Schulte, 2004
* Gabor Szokoli, 2004
*
* Last modified:
* $Date: 2010-08-31 16:19:34 +0200 (Tue, 31 Aug 2010) $ by $Author: schulte $
* $Revision: 11366 $
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode {
/*
* Constructors and access
*
*/
forceinline
SetVar::SetVar(void) {}
forceinline
SetVar::SetVar(const SetVar& y)
: VarImpVar<Set::SetVarImp>(y.varimp()) {}
forceinline
SetVar::SetVar(const Set::SetView& y)
: VarImpVar<Set::SetVarImp>(y.varimp()) {}
/*
* Variable information
*
*/
forceinline unsigned int
SetVar::glbSize(void) const { return x->glbSize(); }
forceinline unsigned int
SetVar::lubSize(void) const { return x->lubSize(); }
forceinline unsigned int
SetVar::unknownSize(void) const { return x->lubSize()-x->glbSize(); }
forceinline bool
SetVar::contains(int i) const { return x->knownIn(i); }
forceinline bool
SetVar::notContains(int i) const { return x->knownOut(i); }
forceinline unsigned int
SetVar::cardMin(void) const { return x->cardMin(); }
forceinline unsigned int
SetVar::cardMax(void) const { return x->cardMax(); }
forceinline int
SetVar::lubMin(void) const { return x->lubMin(); }
forceinline int
SetVar::lubMax(void) const { return x->lubMax(); }
forceinline int
SetVar::glbMin(void) const { return x->glbMin(); }
forceinline int
SetVar::glbMax(void) const { return x->glbMax(); }
/*
* Range and value iterators for set variables
*
*/
forceinline
SetVarGlbRanges::SetVarGlbRanges(void) {}
forceinline
SetVarGlbRanges::SetVarGlbRanges(const SetVar& s)
: iter(s.varimp()) {}
forceinline
bool
SetVarGlbRanges::operator ()(void) const { return iter(); }
forceinline
void
SetVarGlbRanges::operator ++(void) { ++iter; }
forceinline
int
SetVarGlbRanges::min(void) const { return iter.min(); }
forceinline
int
SetVarGlbRanges::max(void) const { return iter.max(); }
forceinline
unsigned int
SetVarGlbRanges::width(void) const { return iter.width(); }
forceinline
SetVarLubRanges::SetVarLubRanges(void) {}
forceinline
SetVarLubRanges::SetVarLubRanges(const SetVar& s)
: iter(s.varimp()) {}
forceinline
bool
SetVarLubRanges::operator ()(void) const { return iter(); }
forceinline
void
SetVarLubRanges::operator ++(void) { ++iter; }
forceinline
int
SetVarLubRanges::min(void) const { return iter.min(); }
forceinline
int
SetVarLubRanges::max(void) const { return iter.max(); }
forceinline
unsigned int
SetVarLubRanges::width(void) const { return iter.width(); }
forceinline
SetVarUnknownRanges::SetVarUnknownRanges(void) {}
forceinline
SetVarUnknownRanges::SetVarUnknownRanges(const SetVar& s) {
iter.init(s.varimp());
}
forceinline
bool
SetVarUnknownRanges::operator ()(void) const { return iter(); }
forceinline
void
SetVarUnknownRanges::operator ++(void) { ++iter; }
forceinline
int
SetVarUnknownRanges::min(void) const { return iter.min(); }
forceinline
int
SetVarUnknownRanges::max(void) const { return iter.max(); }
forceinline
unsigned int
SetVarUnknownRanges::width(void) const { return iter.width(); }
forceinline
SetVarGlbValues::SetVarGlbValues(const SetVar& x) {
SetVarGlbRanges ivr(x);
iter.init(ivr);
}
forceinline bool
SetVarGlbValues::operator ()(void) const {
return iter();
}
forceinline void
SetVarGlbValues::operator ++(void) {
++iter;
}
forceinline int
SetVarGlbValues::val(void) const {
return iter.val();
}
forceinline
SetVarLubValues::SetVarLubValues(const SetVar& x) {
SetVarLubRanges ivr(x);
iter.init(ivr);
}
forceinline bool
SetVarLubValues::operator ()(void) const {
return iter();
}
forceinline void
SetVarLubValues::operator ++(void) {
++iter;
}
forceinline int
SetVarLubValues::val(void) const {
return iter.val();
}
forceinline
SetVarUnknownValues::SetVarUnknownValues(const SetVar& x) {
SetVarUnknownRanges ivr(x);
iter.init(ivr);
}
forceinline bool
SetVarUnknownValues::operator ()(void) const {
return iter();
}
forceinline void
SetVarUnknownValues::operator ++(void) {
++iter;
}
forceinline int
SetVarUnknownValues::val(void) const {
return iter.val();
}
}
// STATISTICS: set-var
|