reify.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2011
*
* 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 {
/*
* The reification class
*
*/
forceinline
Reify::Reify(void)
: rm(RM_EQV) {}
forceinline
Reify::Reify(BoolVar x0, ReifyMode rm0)
: x(x0), rm(rm0) {}
forceinline BoolVar
Reify::var(void) const {
return x;
}
forceinline void
Reify::var(BoolVar x0) {
x = x0;
}
forceinline ReifyMode
Reify::mode(void) const {
return rm;
}
forceinline void
Reify::mode(ReifyMode rm0) {
rm = rm0;
}
/*
* Reification convenience functions
*
*/
forceinline Reify
eqv(BoolVar x) {
return Reify(x,RM_EQV);
}
forceinline Reify
imp(BoolVar x) {
return Reify(x,RM_IMP);
}
forceinline Reify
pmi(BoolVar x) {
return Reify(x,RM_PMI);
}
}
// STATISTICS: int-post
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::Reify
Reification specification.
Definition int.hh:876
Gecode::Reify::x
BoolVar x
The Boolean control variable.
Definition int.hh:879
Gecode::Reify::var
BoolVar var(void) const
Return Boolean control variable.
Definition reify.hpp:48
Gecode::Reify::Reify
Reify(void)
Default constructor without proper initialization.
Definition reify.hpp:42
Gecode::Reify::mode
ReifyMode mode(void) const
Return reification mode.
Definition reify.hpp:56
Gecode::Reify::rm
ReifyMode rm
The reification mode.
Definition int.hh:881
Gecode::imp
Reify imp(BoolVar x)
Use implication for reification.
Definition reify.hpp:73
Gecode::eqv
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition reify.hpp:69
Gecode::ReifyMode
ReifyMode
Mode for reification.
Definition int.hh:848
Gecode::pmi
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition reify.hpp:77
Gecode::RM_IMP
@ RM_IMP
Implication for reification.
Definition int.hh:862
Gecode::RM_PMI
@ RM_PMI
Inverse implication for reification.
Definition int.hh:869
Gecode::RM_EQV
@ RM_EQV
Equivalence for reification (default).
Definition int.hh:855
Gecode
Gecode toplevel namespace
forceinline
#define forceinline
Definition config.hpp:187