/usr/include/gecode/set/branch.hh is in libgecode-dev 4.2.1-1.
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 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Gabor Szokoli <szokoli@gecode.org>
*
* Copyright:
* Guido Tack, 2004
* Christian Schulte, 2004
* Gabor Szokoli, 2004
*
* Last modified:
* $Date: 2013-07-04 17:03:13 +0200 (Thu, 04 Jul 2013) $ by $Author: schulte $
* $Revision: 13801 $
*
* 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.
*
*/
#ifndef __GECODE_SET_BRANCH_HH__
#define __GECODE_SET_BRANCH_HH__
#include <gecode/set.hh>
/**
* \namespace Gecode::Set::Branch
* \brief %Set branchings
*/
namespace Gecode { namespace Set { namespace Branch {
/**
* \defgroup FuncSetViewSel Merit-based set view selection for branchers
*
* Contains merit-based view selection strategies on set
* views that can be used together with the generic view/value
* brancher classes.
*
* All merit-based set view selection classes require
* \code #include <gecode/set/branch.hh> \endcode
* \ingroup Other
*/
/**
* \brief Merit class for mimimum of set views
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetViewSel
*/
class MeritMin : public MeritBase<SetView,int> {
public:
/// Constructor for initialization
MeritMin(Space& home, const VarBranch& vb);
/// Constructor for cloning
MeritMin(Space& home, bool shared, MeritMin& m);
/// Return minimum as merit for view \a x at position \a i
int operator ()(const Space& home, SetView x, int i);
};
/**
* \brief Merit class for maximum of set view
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetViewSel
*/
class MeritMax : public MeritBase<SetView,int> {
public:
/// Constructor for initialization
MeritMax(Space& home, const VarBranch& vb);
/// Constructor for cloning
MeritMax(Space& home, bool shared, MeritMax& m);
/// Return maximum as merit for view \a x at position \a i
int operator ()(const Space& home, SetView x, int i);
};
/**
* \brief Merit class for size of set view
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetViewSel
*/
class MeritSize : public MeritBase<SetView,unsigned int> {
public:
/// Constructor for initialization
MeritSize(Space& home, const VarBranch& vb);
/// Constructor for cloning
MeritSize(Space& home, bool shared, MeritSize& m);
/// Return size as merit for view \a x at position \a i
unsigned int operator ()(const Space& home, SetView x, int i);
};
/**
* \brief Merit class for size over degree
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetViewSel
*/
class MeritDegreeSize : public MeritBase<SetView,double> {
public:
/// Constructor for initialization
MeritDegreeSize(Space& home, const VarBranch& vb);
/// Constructor for cloning
MeritDegreeSize(Space& home, bool shared, MeritDegreeSize& m);
/// Return size over degree as merit for view \a x at position \a i
double operator ()(const Space& home, SetView x, int i);
};
/**
* \brief Merit class for size over afc
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetViewSel
*/
class MeritAFCSize : public MeritBase<SetView,double> {
protected:
/// AFC information
AFC afc;
public:
/// Constructor for initialization
MeritAFCSize(Space& home, const VarBranch& vb);
/// Constructor for cloning
MeritAFCSize(Space& home, bool shared, MeritAFCSize& m);
/// Return size over AFC as merit for view \a x at position \a i
double operator ()(const Space& home, SetView x, int i);
/// Whether dispose must always be called (that is, notice is needed)
bool notice(void) const;
/// Dispose view selection
void dispose(Space& home);
};
/**
* \brief Merit class for size over activity
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetViewSel
*/
class MeritActivitySize : public MeritBase<SetView,double> {
protected:
/// Activity information
Activity activity;
public:
/// Constructor for initialization
MeritActivitySize(Space& home, const VarBranch& vb);
/// Constructor for cloning
MeritActivitySize(Space& home, bool shared, MeritActivitySize& m);
/// Return size over activity as merit for view \a x at position \a i
double operator ()(const Space& home, SetView x, int i);
/// Whether dispose must always be called (that is, notice is needed)
bool notice(void) const;
/// Dispose view selection
void dispose(Space& home);
};
}}}
#include <gecode/set/branch/merit.hpp>
namespace Gecode { namespace Set { namespace Branch {
/// Return view selectors for set views
GECODE_SET_EXPORT
ViewSel<SetView>* viewsel(Space& home, const SetVarBranch& svb);
}}}
namespace Gecode { namespace Set { namespace Branch {
/**
* \defgroup FuncSetValSel Set value selection for brancher
*
* Contains a description of value selection strategies on set
* views that can be used together with the generic view/value
* branchers.
*
* All value selection classes require
* \code #include <gecode/set/branch.hh> \endcode
* \ingroup Other
*/
/**
* \brief Value selection class for mimimum of view
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetValSel
*/
class ValSelMin : public ValSel<SetView,int> {
public:
/// Constructor for initialization
ValSelMin(Space& home, const ValBranch& vb);
/// Constructor for cloning
ValSelMin(Space& home, bool shared, ValSelMin& vs);
/// Return value of view \a x at position \a i
int val(const Space& home, SetView x, int i);
};
/**
* \brief Value selection class for maximum of view
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetValSel
*/
class ValSelMax : public ValSel<SetView,int> {
public:
/// Constructor for initialization
ValSelMax(Space& home, const ValBranch& vb);
/// Constructor for cloning
ValSelMax(Space& home, bool shared, ValSelMax& vs);
/// Return value of view \a x at position \a i
int val(const Space& home, SetView x, int i);
};
/**
* \brief Value selection class for median of view
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetValSel
*/
class ValSelMed : public ValSel<SetView,int> {
public:
/// Constructor for initialization
ValSelMed(Space& home, const ValBranch& vb);
/// Constructor for cloning
ValSelMed(Space& home, bool shared, ValSelMed& vs);
/// Return value of view \a x at position \a i
int val(const Space& home, SetView x, int i);
};
/**
* \brief Value selection class for random value of view
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetValSel
*/
class ValSelRnd : public ValSel<SetView,int> {
protected:
/// The used random number generator
Rnd r;
public:
/// Constructor for initialization
ValSelRnd(Space& home, const ValBranch& vb);
/// Constructor for cloning
ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
/// Return value of view \a x at position \a i
int val(const Space& home, SetView x, int i);
/// Whether dispose must always be called (that is, notice is needed)
bool notice(void) const;
/// Delete value selection
void dispose(Space& home);
};
}}}
#include <gecode/set/branch/val-sel.hpp>
namespace Gecode { namespace Set { namespace Branch {
/// No-good literal for inclusion
class IncNGL : public ViewValNGL<SetView,int,PC_SET_ANY> {
public:
/// Constructor for creation
IncNGL(Space& home, SetView x, int n);
/// Constructor for cloning \a ngl
IncNGL(Space& home, bool share, IncNGL& ngl);
/// Test the status of the no-good literal
GECODE_SET_EXPORT
virtual NGL::Status status(const Space& home) const;
/// Propagate the negation of the no-good literal
GECODE_SET_EXPORT
virtual ExecStatus prune(Space& home);
/// Create copy
GECODE_SET_EXPORT
virtual NGL* copy(Space& home, bool share);
};
/// No-good literal for exclusion
class ExcNGL : public ViewValNGL<SetView,int,PC_SET_ANY> {
public:
/// Constructor for creation
ExcNGL(Space& home, SetView x, int n);
/// Constructor for cloning \a ngl
ExcNGL(Space& home, bool share, ExcNGL& ngl);
/// Test the status of the no-good literal
GECODE_SET_EXPORT
virtual NGL::Status status(const Space& home) const;
/// Propagate the negation of the no-good literal
GECODE_SET_EXPORT
virtual ExecStatus prune(Space& home);
/// Create copy
GECODE_SET_EXPORT
virtual NGL* copy(Space& home, bool share);
};
}}}
#include <gecode/set/branch/ngl.hpp>
namespace Gecode { namespace Set { namespace Branch {
/**
* \defgroup FuncSetValCommit Set value commit classes
*
* Contains the value commit classes for set
* views that can be used together with the generic view/value
* branchers.
*
* All value commit classes require
* \code #include <gecode/set/branch.hh> \endcode
* \ingroup Other
*/
/**
* \brief Value commit class for inclusion
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetValCommit
*/
class ValCommitInc : public ValCommit<SetView,int> {
public:
/// Constructor for initialization
ValCommitInc(Space& home, const ValBranch& vb);
/// Constructor for cloning
ValCommitInc(Space& home, bool shared, ValCommitInc& vc);
/// Commit view \a x at position \a i to value \a n for alternative \a a
ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
/// Create no-good literal for alternative \a a
NGL* ngl(Space& home, unsigned int a, View x, int n) const;
/// Print on \a o the alternative \a with view \a x at position \a i and value \a n
void print(const Space& home, unsigned int a, SetView x, int i, int n,
std::ostream& o) const;
};
/**
* \brief Value commit class for exclusion
*
* Requires \code #include <gecode/set/branch.hh> \endcode
* \ingroup FuncSetValCommit
*/
class ValCommitExc : public ValCommit<SetView,int> {
public:
/// Constructor for initialization
ValCommitExc(Space& home, const ValBranch& vb);
/// Constructor for cloning
ValCommitExc(Space& home, bool shared, ValCommitExc& vc);
/// Commit view \a x at position \a i to value \a n for alternative \a a
ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
/// Create no-good literal for alternative \a a
NGL* ngl(Space& home, unsigned int a, View x, int n) const;
/// Print on \a o the alternative \a with view \a x at position \a i and value \a n
void print(const Space& home, unsigned int a, SetView x, int i, int n,
std::ostream& o) const;
};
}}}
#include <gecode/set/branch/val-commit.hpp>
namespace Gecode { namespace Set { namespace Branch {
/// Return value and commit for set views
GECODE_SET_EXPORT
ValSelCommitBase<SetView,int>*
valselcommit(Space& home, const SetValBranch& svb);
/// Return value and commit for set views
GECODE_SET_EXPORT
ValSelCommitBase<SetView,int>*
valselcommit(Space& home, const SetAssign& ia);
}}}
#endif
// STATISTICS: set-branch
|