Go to the documentation of this file.
44 #ifndef __GECODE_MINIMODEL_HH__
45 #define __GECODE_MINIMODEL_HH__
49 #ifdef GECODE_HAS_SET_VARS
52 #ifdef GECODE_HAS_FLOAT_VARS
63 #if !defined(GECODE_STATIC_LIBS) && \
64 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
66 #ifdef GECODE_BUILD_MINIMODEL
67 #define GECODE_MINIMODEL_EXPORT __declspec( dllexport )
69 #define GECODE_MINIMODEL_EXPORT __declspec( dllimport )
74 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
76 #define GECODE_MINIMODEL_EXPORT __attribute__ ((visibility("default")))
80 #define GECODE_MINIMODEL_EXPORT
86 #ifndef GECODE_BUILD_MINIMODEL
87 #define GECODE_LIBRARY_NAME "MiniModel"
94 namespace MiniModel {}
103 #ifdef GECODE_HAS_SET_VARS
106 #ifdef GECODE_HAS_FLOAT_VARS
144 #ifdef GECODE_HAS_SET_VARS
147 #ifdef GECODE_HAS_FLOAT_VARS
688 #ifdef GECODE_HAS_FLOAT_VARS
1060 #ifdef GECODE_HAS_SET_VARS
1279 #ifdef GECODE_HAS_FLOAT_VARS
1284 #ifdef GECODE_HAS_SET_VARS
1356 #ifdef GECODE_HAS_FLOAT_VARS
1361 #ifdef GECODE_HAS_SET_VARS
1384 namespace MiniModel {
1403 std::string toString(
void)
const;
1420 const REG& operator =(
const REG&
r);
1425 REG& operator +=(
const REG&
r);
1429 REG& operator |=(
const REG&
r);
1435 REG operator ()(
unsigned int n,
unsigned int m);
1437 REG operator ()(
unsigned int n);
1439 template<
class Char,
class Traits>
1440 std::basic_ostream<Char,Traits>&
1441 print(std::basic_ostream<Char,Traits>& os)
const;
1451 template<
class Char,
class Traits>
1452 std::basic_ostream<Char,Traits>&
1469 abs(
const LinIntExpr& e);
1472 min(
const LinIntExpr&
x,
const LinIntExpr&
y);
1475 min(
const IntVarArgs&
x);
1478 max(
const LinIntExpr&
x,
const LinIntExpr&
y);
1481 max(
const IntVarArgs&
x);
1482 #ifdef GECODE_HAS_FLOAT_VARS
1485 operator *(
const FloatVar&,
const FloatVar&);
1488 operator *(
const FloatVar&,
const LinFloatExpr&);
1491 operator *(
const LinFloatExpr&,
const FloatVar&);
1504 sqr(
const LinIntExpr&
x);
1507 sqrt(
const LinIntExpr&
x);
1510 pow(
const LinIntExpr&
x,
int n);
1513 nroot(
const LinIntExpr&
x,
int n);
1516 element(
const IntVarArgs&
x,
const LinIntExpr&
y);
1519 element(
const BoolVarArgs&
x,
const LinIntExpr&
y);
1522 element(
const IntArgs&
x,
const LinIntExpr&
y);
1525 ite(
const BoolExpr&
b,
const LinIntExpr&
x,
const LinIntExpr&
y);
1528 #ifdef GECODE_HAS_FLOAT_VARS
1531 abs(
const LinFloatExpr& e);
1534 min(
const LinFloatExpr&
x,
const LinFloatExpr&
y);
1537 min(
const FloatVarArgs&
x);
1540 max(
const LinFloatExpr&
x,
const LinFloatExpr&
y);
1543 max(
const FloatVarArgs&
x);
1546 operator *(
const LinFloatExpr&
x,
const LinFloatExpr&
y);
1549 operator /(
const LinFloatExpr&
x,
const LinFloatExpr&
y);
1552 sqr(
const LinFloatExpr&
x);
1555 sqrt(
const LinFloatExpr&
x);
1558 pow(
const LinFloatExpr&
x,
int n);
1561 nroot(
const LinFloatExpr&
x,
int n);
1564 #ifdef GECODE_HAS_MPFR
1573 exp(
const LinFloatExpr&
x);
1576 log(
const LinFloatExpr&
x);
1587 asin(
const LinFloatExpr&
x);
1590 sin(
const LinFloatExpr&
x);
1593 acos(
const LinFloatExpr&
x);
1596 cos(
const LinFloatExpr&
x);
1599 atan(
const LinFloatExpr&
x);
1602 tan(
const LinFloatExpr&
x);
1629 #ifdef GECODE_HAS_FLOAT_VARS
1634 std::ceil(
f.min())));
1636 std::floor(
f.max())));
1642 #ifdef GECODE_HAS_SET_VARS
1876 #ifdef GECODE_HAS_SET_VARS
1956 operator const ArgsType(
void)
const;
2041 int width(
void)
const;
2082 template<
class Char,
class Traits,
class A>
2083 std::basic_ostream<Char,Traits>&
2089 template<
class Char,
class Traits,
class A>
2090 std::basic_ostream<Char,Traits>&
2125 #ifdef GECODE_HAS_SET_VARS
2187 sum(
const Matrix<IntArgs>& matrix);
2215 virtual void constrain(
const Space& best);
2217 virtual IntVar cost(
void)
const = 0;
2232 virtual void constrain(
const Space& best);
2234 virtual IntVar cost(
void)
const = 0;
2249 #ifdef GECODE_HAS_FLOAT_VARS
2271 virtual void constrain(
const Space& best);
2273 virtual FloatVar cost(
void)
const = 0;
2296 virtual void constrain(
const Space& best);
2298 virtual FloatVar cost(
void)
const = 0;
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl=IPL_DEF)
Post constraint .
FloatNum step
Step by which a next solution has to have lower cost.
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
FloatNum step
Step by which a next solution has to have lower cost.
const LinFloatExpr & operator=(const LinFloatExpr &e)
Assignment operator.
IntMinimizeSpace MinimizeSpace
Class for minimizing integer cost.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Post propagator for SetVar x
IntRelType
Relation types for integers.
SymmetryHandle rows_interchange(const Matrix< A > &m)
Interchangeable rows symmetry specification.
Post propagator for SetVar SetOpType SetVar y
Matrix(A a, int w, int h)
Basic constructor.
NodeType
Type of linear expression.
#define GECODE_VTABLE_EXPORT
@ NT_ADD
Addition of linear terms.
SymmetryHandle columns_interchange(const Matrix< A > &m)
Interchangeable columns symmetry specification.
Archive & operator>>(Archive &e, FloatNumBranch &nl)
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
@ NT_VAR_BOOL
Linear term with Boolean variable.
bool operator<(const FloatVal &x, const FloatVal &y)
int lubMax(void) const
Return maximum element of least upper bound.
@ IRT_GQ
Greater or equal ( )
@ NT_MUL
Multiplication by coefficient.
const SetExpr & operator=(const SetExpr &e)
Assignment operator.
SymmetryHandle diagonal_reflect(const Matrix< A > &m)
Reflect around main diagonal symmetry specification.
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Passing integer variables.
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
BoolVar expr(Home home, const BoolExpr &e, IntPropLevel ipl)
Post Boolean expression and return its value.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
unsigned int size(I &i)
Size of all ranges of range iterator i.
int width(void) const
Return the width of the matrix.
static const IntSet empty
Empty set.
Slice< A > row(int r) const
Access row r.
const int min
Smallest allowed integer in integer set.
Comparison relation (for two-sided comparisons)
@ NT_SUM
Sum of float variables.
SetExpr r
Right side of relation.
@ NT_LEXP
Linear expression.
@ NT_MISC
Other Boolean expression.
void atleast(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
IntMaximizeSpace MaximizeSpace
Class for maximizing integer cost.
static IntVar result(Home home, IntVar *x)
Return fresh variable if x is NULL, x otherwise.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
SetCmpRel(const SetExpr &l, SetRelType srt, const SetExpr &r)
Constructor.
void * ralloc(size_t s)
Allocate s bytes from heap.
@ NT_RLIN
Reified linear relation.
@ NT_VAR
Linear term with variable.
Class for maximizing integer cost.
Linear expressions over integer variables.
void exactly(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
const FloatNum min
Smallest allowed float value.
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
IntPropLevel
Propagation levels for integer propagators.
SymmetryHandle rows_reflect(const Matrix< A > &m)
Reflect rows symmetry specification.
FloatVal operator+(const FloatVal &x)
Regular expressions over integer values.
FloatRelType
Relation types for floats.
SetExpr operator|(const SetExpr &l, const SetExpr &r)
Union of set expressions.
BoolExpr operator^(const BoolExpr &l, const BoolExpr &r)
Exclusive-or of Boolean expressions.
void atmost(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
ValueType & operator()(int c, int r)
Access element (c, r) of the matrix.
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
LinIntExpr operator%(const LinIntExpr &e0, const LinIntExpr &e1)
Return expression for .
Implementation of the actual expression tree.
~LinIntExpr(void)
Destructor.
~BoolExpr(void)
Destructor.
@ NT_VAR_INT
Linear term with integer variable.
Gecode toplevel namespace
bool operator>(const FloatVal &x, const FloatVal &y)
@ NT_MUL
Multiplication by coefficient.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
const int max
Largest allowed integer in integer set.
static FloatVar result(Home home, FloatVar *x, FloatVar y)
Constrain x to be equal to y if x is not NULL.
@ NT_RLINFLOAT
Reified linear relation.
FloatVal operator*(const FloatVal &x, const FloatVal &y)
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or NULL if not non-linear.
BoolExpr operator!(const BoolExpr &e)
Negated Boolean expression.
Passing Boolean variables.
void rel(Home home, IntPropLevel ipl) const
Post propagators for relation.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
bool operator>=(const FloatVal &x, const FloatVal &y)
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
SymmetryHandle columns_reflect(const Matrix< A > &m)
Reflect columns symmetry specification.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
static IntVar result(Home home, IntVar *x, IntVar y)
Constrain x to be equal to y if x is not NULL.
@ NT_SUB
Subtraction of linear terms.
Linear relations over integer variables.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void post(Home home, bool t, IntPropLevel ipl) const
Post propagator for relation (if t is false for negated relation)
@ NT_ADD
Addition of linear terms.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Post propagator for SetVar SetOpType SetVar SetRelType r
double FloatNum
Floating point number base type.
Boolean integer variables.
virtual IntVar post(Home home, IntVar *ret, IntPropLevel ipl) const =0
Return variable constrained to be equal to the expression.
SetExpr(void)
Default constructor.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Base class for non-linear expressions over integer variables.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
@ NT_NONLIN
Non-linear expression.
@ NT_NONLIN
Non-linear expression.
BoolExpr operator&&(const BoolExpr &l, const BoolExpr &r)
Conjunction of Boolean expressions.
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
const int max
Largest allowed integer value.
NodeType
Type of Boolean expression.
FloatVal operator/(const FloatVal &x, const FloatVal &y)
static FloatVar result(Home home, FloatVar *x)
Return fresh variable if x is NULL, x otherwise.
Slice< A > slice(int fc, int tc, int fr, int tr) const
Access slice of the matrix.
@ NT_SUM_INT
Sum of integer variables.
SetRelType
Common relation types for sets.
SetExpr operator&(const SetExpr &l, const SetExpr &r)
Intersection of set expressions.
Class for minimizing integer cost.
SetExpr setunion(const SetVarArgs &x)
Union of set variables.
Slice(const Matrix< A > &a, int fc, int tc, int fr, int tr)
Construct slice.
NodeType
Type of set expression.
Base class for heap allocated objects.
bool operator!=(const FloatVal &x, const FloatVal &y)
virtual FloatVar post(Home home, FloatVar *ret) const =0
Return variable constrained to be equal to the expression.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void post(Home home, FloatRelType frt) const
Post propagator.
FloatVal operator-(const FloatVal &x)
Matrix-interface for arrays.
Heap heap
The single global heap.
Class for maximizing float cost.
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
bool operator<=(const FloatVal &x, const FloatVal &y)
int height(void) const
Return the height of the matrix.
void post(Home home, IntRelType irt, IntPropLevel ipl) const
Post propagator.
const ArgsType get_array(void) const
Return an Args-array of the contents of the matrix.
BoolVar expr(Home home, IntPropLevel ipl) const
Post propagators for expression.
void lex(Home home, const IntVarArgs &x, IntRelType r, const IntVarArgs &y, IntPropLevel ipl=IPL_DEF)
Post lexical order between x and y.
ArrayTraits< A >::ValueType ValueType
The type of elements of this array.
@ NT_SUM_BOOL
Sum of Boolean variables.
SetRel(void)
Default constructor.
A reference-counted pointer to a SymmetryObject.
Deterministic finite automaton (DFA)
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
Slice< A > col(int c) const
Access column c.
Node for Boolean expression
Slice & reverse(void)
Reverses the contents of the slice, and returns a reference to it.
virtual ~NonLinFloatExpr(void)
Destructor.
SetRelType srt
Which relation.
@ IPL_DEF
Simple propagation levels.
@ NT_CONST
Integer constant.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
#define GECODE_MINIMODEL_EXPORT
SetExpr setdunion(const SetVarArgs &x)
Disjoint union of set variables.
NodeType
Type of linear expression.
Base class for non-linear float expressions.
bool neg
Is atomic formula negative.
Traits of arrays in Gecode.
void post(Home home, bool t) const
Post propagators for relation (or negated relation if t is false)
@ NT_DUNION
Disjoint union.
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
const int min
Smallest allowed integer value.
Miscealloneous Boolean expressions.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
const BoolExpr & operator=(const BoolExpr &e)
Assignment operator.
LinIntExpr(void)
Default constructor.
Class for minimizing float cost.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
BoolExpr operator||(const BoolExpr &l, const BoolExpr &r)
Disjunction of Boolean expressions.
Gecode::FloatVal c(-8, 8)
void roots(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures)
BoolExpr(void)
Default constructor.
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
SetExpr l
Left side of relation.
int n
Number of negative literals for node type.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
@ NT_SUB
Subtraction of linear terms.
void rfree(void *p)
Free memory block starting at p.
Passing integer arguments.
LinFloatExpr(void)
Default constructor.
SetVar post(Home home) const
Post propagators for expression.
void post(Home home, bool t) const
Post propagator for relation (if t is false for negated relation)
~LinFloatExpr(void)
Destructor.
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
int p
Number of positive literals for node type.
virtual ~NonLinIntExpr(void)
Destructor.
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
Archive & operator<<(Archive &e, FloatNumBranch nl)
const FloatNum max
Largest allowed float value.
@ NT_CONST
Float value constant.
~SetExpr(void)
Destructor.
@ IRT_LQ
Less or equal ( )
@ NT_RSET
Reified set relation.
bool operator==(const FloatVal &x, const FloatVal &y)