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;
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
FloatVal operator -(const FloatVal &x)
const BoolExpr & operator=(const BoolExpr &e)
Assignment operator.
Class for minimizing integer cost.
BoolExpr operator &&(const BoolExpr &l, const BoolExpr &r)
Conjunction of Boolean expressions.
SetRelType srt
Which relation.
SetRelType
Common relation types for sets.
void lex(Home home, const IntVarArgs &x, IntRelType r, const IntVarArgs &y, IntPropLevel ipl=IPL_DEF)
Post lexical order between x and y.
Slice< A > col(int c) const
Access column c.
const SetExpr & operator=(const SetExpr &e)
Assignment operator.
virtual ~NonLinFloatExpr(void)
Destructor.
const int min
Smallest allowed integer in integer set.
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatVal operator *(const FloatVal &x, const FloatVal &y)
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
const FloatNum max
Largest allowed float value.
virtual ~NonLinIntExpr(void)
Destructor.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
FloatVal operator/(const FloatVal &x, const FloatVal &y)
void rfree(void *p)
Free memory block starting at p.
bool operator >=(const FloatVal &x, const FloatVal &y)
Regular expressions over integer values.
Linear term with Boolean variable.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
FloatNum step
Step by which a next solution has to have lower cost.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Node for Boolean expression
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Linear relations over integer variables.
void atmost(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
BoolExpr operator ^(const BoolExpr &l, const BoolExpr &r)
Exclusive-or of Boolean expressions.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
int height(void) const
Return the height of the matrix.
Base class for non-linear expressions over integer variables.
void * ralloc(size_t s)
Allocate s bytes from heap.
Slice< A > slice(int fc, int tc, int fr, int tr) const
Access slice of the matrix.
Addition of linear terms.
void roots(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
SymmetryHandle columns_interchange(const Matrix< A > &m)
Interchangeable columns symmetry specification.
~BoolExpr(void)
Destructor.
Multiplication by coefficient.
Linear term with variable.
void post(Home home, bool t) const
Post propagator for relation (if t is false for negated relation)
Comparison relation (for two-sided comparisons)
const int max
Largest allowed integer in integer set.
virtual FloatVar post(Home home, FloatVar *ret) const =0
Return variable constrained to be equal to the expression.
IntMinimizeSpace MinimizeSpace
Class for minimizing integer cost.
Linear term with integer variable.
Class for maximizing float cost.
const int max
Largest allowed integer value.
const int min
Smallest allowed integer value.
void atleast(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
ArrayTraits< A >::ValueType ValueType
The type of elements of this array.
SetRel(void)
Default constructor.
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
void rel(Home home, IntPropLevel ipl) const
Post propagators for relation.
SetExpr setdunion(const SetVarArgs &x)
Disjoint union of set variables.
static IntVar result(Home home, IntVar *x)
Return fresh variable if x is NULL, x otherwise.
IntMaximizeSpace MaximizeSpace
Class for maximizing integer cost.
int lubMax(void) const
Return maximum element of least upper bound.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
Miscealloneous Boolean expressions.
static FloatVar result(Home home, FloatVar *x)
Return fresh variable if x is NULL, x otherwise.
Deterministic finite automaton (DFA)
int p
Number of positive literals for node type.
const FloatNum min
Smallest allowed float value.
SetExpr operator &(const SetExpr &l, const SetExpr &r)
Intersection of set expressions.
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
int n
Number of negative literals for node type.
Slice & reverse(void)
Reverses the contents of the slice, and returns a reference to it.
Base class for non-linear float expressions.
Matrix(A a, int w, int h)
Basic constructor.
A reference-counted pointer to a SymmetryObject.
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
IntRelType
Relation types for integers.
FloatVal operator+(const FloatVal &x)
static IntVar result(Home home, IntVar *x, IntVar y)
Constrain x to be equal to y if x is not NULL.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatRelType
Relation types for floats.
void post(Home home, bool t) const
Post propagators for relation (or negated relation if t is false)
Simple propagation levels.
SetExpr(void)
Default constructor.
SetExpr r
Right side of relation.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
unsigned int size(I &i)
Size of all ranges of range iterator i.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
static FloatVar result(Home home, FloatVar *x, FloatVar y)
Constrain x to be equal to y if x is not NULL.
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
LinIntExpr(void)
Default constructor.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
Subtraction of linear terms.
void post(Home home, IntRelType irt, IntPropLevel ipl) const
Post propagator.
NodeType
Type of set expression.
NodeType
Type of linear expression.
LinFloatExpr(void)
Default constructor.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
~LinFloatExpr(void)
Destructor.
SetExpr setunion(const SetVarArgs &x)
Union of set variables.
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
SetExpr l
Left side of relation.
Passing integer variables.
bool operator >(const FloatVal &x, const FloatVal &y)
Passing integer arguments.
NodeType
Type of linear expression.
Passing Boolean variables.
int width(void) const
Return the width of the matrix.
static const IntSet empty
Empty set.
Multiplication by coefficient.
BoolVar expr(Home home, const BoolExpr &e, IntPropLevel ipl)
Post Boolean expression and return its value.
SymmetryHandle columns_reflect(const Matrix< A > &m)
Reflect columns symmetry specification.
Other Boolean expression.
Boolean integer variables.
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
Post propagator for SetVar SetOpType SetVar SetRelType r
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
IntPropLevel
Propagation levels for integer propagators.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
virtual IntVar post(Home home, IntVar *ret, IntPropLevel ipl) const =0
Return variable constrained to be equal to the expression.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
const LinFloatExpr & operator=(const LinFloatExpr &e)
Assignment operator.
Post propagator for SetVar SetOpType SetVar y
Class for maximizing integer cost.
NodeType
Type of Boolean expression.
~LinIntExpr(void)
Destructor.
SymmetryHandle diagonal_reflect(const Matrix< A > &m)
Reflect around main diagonal symmetry specification.
Sum of integer variables.
Linear expressions over integer variables.
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Slice< A > row(int r) const
Access row r.
SetCmpRel(const SetExpr &l, SetRelType srt, const SetExpr &r)
Constructor.
Heap heap
The single global heap.
BoolExpr operator !(const BoolExpr &e)
Negated Boolean expression.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
Sum of Boolean variables.
SymmetryHandle rows_interchange(const Matrix< A > &m)
Interchangeable rows symmetry specification.
ValueType & operator()(int c, int r)
Access element (c, r) of the matrix.
Subtraction of linear terms.
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl=IPL_DEF)
Post constraint .
Post propagator for SetVar x
Archive & operator<<(Archive &e, FloatNumBranch nl)
Implementation of the actual expression tree.
#define GECODE_MINIMODEL_EXPORT
Matrix-interface for arrays.
SetExpr operator|(const SetExpr &l, const SetExpr &r)
Union of set expressions.
bool operator<(const FloatVal &x, const FloatVal &y)
bool operator==(const FloatVal &x, const FloatVal &y)
Addition of linear terms.
Traits of arrays in Gecode.
bool operator<=(const FloatVal &x, const FloatVal &y)
void post(Home home, bool t, IntPropLevel ipl) const
Post propagator for relation (if t is false for negated relation)
Class for minimizing float cost.
LinIntExpr operator %(const LinIntExpr &e0, const LinIntExpr &e1)
Return expression for .
Gecode toplevel namespace
Slice(const Matrix< A > &a, int fc, int tc, int fr, int tr)
Construct slice.
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
ArgsType const get_array(void) const
Return an Args-array of the contents of the matrix.
#define GECODE_VTABLE_EXPORT
BoolVar expr(Home home, IntPropLevel ipl) const
Post propagators for expression.
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or NULL if not non-linear.
bool operator !=(const FloatVal &x, const FloatVal &y)
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Home class for posting propagators
Base class for heap allocated objects.
~SetExpr(void)
Destructor.
double FloatNum
Floating point number base type.
void exactly(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures)
FloatNum step
Step by which a next solution has to have lower cost.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
SetVar post(Home home) const
Post propagators for expression.
BoolExpr operator||(const BoolExpr &l, const BoolExpr &r)
Disjunction of Boolean expressions.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
SymmetryHandle rows_reflect(const Matrix< A > &m)
Reflect rows symmetry specification.
bool neg
Is atomic formula negative.
void post(Home home, FloatRelType frt) const
Post propagator.
BoolExpr(void)
Default constructor.
Archive & operator >>(Archive &e, FloatNumBranch &nl)