minimodel.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
* Matthias Balzer <matthias.balzer@itwm.fraunhofer.de>
* Mikael Lagerkvist <lagerkvist@gecode.org>
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
*
* Copyright:
* Christian Schulte, 2004
* Fraunhofer ITWM, 2017
* Guido Tack, 2004
* Mikael Lagerkvist, 2005
* Vincent Barichard, 2012
*
* 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_MINIMODEL_HH__
#define __GECODE_MINIMODEL_HH__
#include <gecode/kernel.hh>
#include <gecode/int.hh>
#ifdef GECODE_HAS_SET_VARS
#include <gecode/set.hh>
#endif
#ifdef GECODE_HAS_FLOAT_VARS
#include <gecode/float.hh>
#endif
#include <iostream>
/*
* Support for DLLs under Windows
*
*/
#if !defined(GECODE_STATIC_LIBS) && \
(defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
#ifdef GECODE_BUILD_MINIMODEL
#define GECODE_MINIMODEL_EXPORT __declspec( dllexport )
#else
#define GECODE_MINIMODEL_EXPORT __declspec( dllimport )
#endif
#else
#ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
#define GECODE_MINIMODEL_EXPORT __attribute__ ((visibility("default")))
#else
#define GECODE_MINIMODEL_EXPORT
#endif
#endif
// Configure auto-linking
#ifndef GECODE_BUILD_MINIMODEL
#define GECODE_LIBRARY_NAME "MiniModel"
#include <gecode/support/auto-link.hpp>
#endif
namespace Gecode {
namespace MiniModel {}
}
#include <gecode/minimodel/exception.hpp>
namespace Gecode {
class IntPropLevels {
protected:
IntPropLevel _linear2 : _IPL_BITS;
IntPropLevel _linear : _IPL_BITS;
IntPropLevel _abs : _IPL_BITS;
IntPropLevel _max2 : _IPL_BITS;
IntPropLevel _max : _IPL_BITS;
IntPropLevel _min2 : _IPL_BITS;
IntPropLevel _min : _IPL_BITS;
IntPropLevel _mult : _IPL_BITS;
IntPropLevel _div : _IPL_BITS;
IntPropLevel _mod : _IPL_BITS;
IntPropLevel _sqr : _IPL_BITS;
IntPropLevel _sqrt : _IPL_BITS;
IntPropLevel _pow : _IPL_BITS;
IntPropLevel _nroot : _IPL_BITS;
IntPropLevel _element : _IPL_BITS;
IntPropLevel _ite : _IPL_BITS;
public:
IntPropLevels(IntPropLevel ipl=IPL_DEF);
IntPropLevel linear2(void) const;
IntPropLevels& linear2(IntPropLevel ipl);
IntPropLevel linear(void) const;
IntPropLevels& linear(IntPropLevel ipl);
IntPropLevel abs(void) const;
IntPropLevels& abs(IntPropLevel ipl);
IntPropLevel max2(void) const;
IntPropLevels& max2(IntPropLevel ipl);
IntPropLevel max(void) const;
IntPropLevels& max(IntPropLevel ipl);
IntPropLevel min2(void) const;
IntPropLevels& min2(IntPropLevel ipl);
IntPropLevel min(void) const;
IntPropLevels& min(IntPropLevel ipl);
IntPropLevel mult(void) const;
IntPropLevels& mult(IntPropLevel ipl);
IntPropLevel div(void) const;
IntPropLevels& div(IntPropLevel ipl);
IntPropLevel mod(void) const;
IntPropLevels& mod(IntPropLevel ipl);
IntPropLevel sqr(void) const;
IntPropLevels& sqr(IntPropLevel ipl);
IntPropLevel sqrt(void) const;
IntPropLevels& sqrt(IntPropLevel ipl);
IntPropLevel pow(void) const;
IntPropLevels& pow(IntPropLevel ipl);
IntPropLevel nroot(void) const;
IntPropLevels& nroot(IntPropLevel ipl);
IntPropLevel element(void) const;
IntPropLevels& element(IntPropLevel ipl);
IntPropLevel ite(void) const;
IntPropLevels& ite(IntPropLevel ipl);
GECODE_MINIMODEL_EXPORT
static const IntPropLevels def;
};
}
#include <gecode/minimodel/ipl.hpp>
namespace Gecode {
class LinIntRel;
#ifdef GECODE_HAS_SET_VARS
class SetExpr;
#endif
#ifdef GECODE_HAS_FLOAT_VARS
class LinFloatExpr;
#endif
class NonLinIntExpr {
public:
virtual IntVar post(Home home, IntVar* ret,
const IntPropLevels& ipls) const = 0;
virtual void post(Home home, IntRelType irt, int c,
const IntPropLevels& ipls) const = 0;
virtual void post(Home home, IntRelType irt, int c,
BoolVar b, const IntPropLevels& ipls) const = 0;
virtual ~NonLinIntExpr(void);
static IntVar result(Home home, IntVar* x);
static IntVar result(Home home, IntVar* x, IntVar y);
void* operator new(size_t s);
void operator delete(void* p, size_t s);
};
}
#include <gecode/minimodel/int-expr.hpp>
namespace Gecode {
class LinIntExpr {
friend class LinIntRel;
#ifdef GECODE_HAS_SET_VARS
friend class SetExpr;
#endif
#ifdef GECODE_HAS_FLOAT_VARS
friend class LinFloatExpr;
#endif
public:
enum NodeType {
NT_CONST,
NT_VAR_INT,
NT_VAR_BOOL,
NT_NONLIN,
NT_SUM_INT,
NT_SUM_BOOL,
NT_ADD,
NT_SUB,
NT_MUL
};
private:
class Node;
Node* n;
public:
GECODE_MINIMODEL_EXPORT
LinIntExpr(void);
GECODE_MINIMODEL_EXPORT
LinIntExpr(int c);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const IntVar& x, int a=1);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const BoolVar& x, int a=1);
GECODE_MINIMODEL_EXPORT
explicit LinIntExpr(const IntVarArgs& x);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const IntArgs& a, const IntVarArgs& x);
GECODE_MINIMODEL_EXPORT
explicit LinIntExpr(const BoolVarArgs& x);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const IntArgs& a, const BoolVarArgs& x);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const LinIntExpr& e);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const LinIntExpr& e0, NodeType t, const LinIntExpr& e1);
GECODE_MINIMODEL_EXPORT
LinIntExpr(const LinIntExpr& e0, NodeType t, int c);
GECODE_MINIMODEL_EXPORT
LinIntExpr(int a, const LinIntExpr& e);
GECODE_MINIMODEL_EXPORT
explicit LinIntExpr(NonLinIntExpr* e);
GECODE_MINIMODEL_EXPORT
const LinIntExpr& operator =(const LinIntExpr& e);
GECODE_MINIMODEL_EXPORT
void post(Home home, IntRelType irt, const IntPropLevels& ipls) const;
GECODE_MINIMODEL_EXPORT
void post(Home home, IntRelType irt, const BoolVar& b,
const IntPropLevels& ipls) const;
GECODE_MINIMODEL_EXPORT
IntVar post(Home home, const IntPropLevels& ipls) const;
GECODE_MINIMODEL_EXPORT
NonLinIntExpr* nle(void) const;
GECODE_MINIMODEL_EXPORT
~LinIntExpr(void);
};
class BoolExpr;
class LinIntRel {
friend class BoolExpr;
private:
LinIntExpr e;
IntRelType irt;
static IntRelType neg(IntRelType irt);
LinIntRel(void);
public:
LinIntRel(const LinIntExpr& l, IntRelType irt, const LinIntExpr& r);
LinIntRel(const LinIntExpr& l, IntRelType irt, int r);
LinIntRel(int l, IntRelType irt, const LinIntExpr& r);
void post(Home home, bool t, const IntPropLevels& ipls) const;
void post(Home home, const BoolVar& b, bool t, const IntPropLevels& ipls) const;
};
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(int, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(int, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(int, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const IntVar&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const BoolVar&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const LinIntExpr&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const IntVar&, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const IntVar&, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const BoolVar&, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const BoolVar&, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const IntVar&, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const BoolVar&, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const LinIntExpr&, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const LinIntExpr&, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator +(const LinIntExpr&, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(int, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(int, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(int, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const IntVar&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const BoolVar&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const LinIntExpr&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const IntVar&, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const IntVar&, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const BoolVar&, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const BoolVar&, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const IntVar&, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const BoolVar&, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const LinIntExpr&, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const LinIntExpr&, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const LinIntExpr&, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator -(const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(int, const IntVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(int, const BoolVar&);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(const IntVar&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(const BoolVar&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(const LinIntExpr&, int);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(int, const LinIntExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const IntVarArgs& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const IntArgs& a, const IntVarArgs& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const BoolVarArgs& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const IntArgs& a, const BoolVarArgs& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const IntArgs& args);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(int l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(int l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(int l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const IntVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const BoolVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const LinIntExpr& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const IntVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const IntVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const BoolVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const BoolVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const IntVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const BoolVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const LinIntExpr& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const LinIntExpr& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator ==(const LinIntExpr& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(int l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(int l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(int l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const IntVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const BoolVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const LinIntExpr& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const IntVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const IntVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const BoolVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const BoolVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const IntVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const BoolVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const LinIntExpr& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const LinIntExpr& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator !=(const LinIntExpr& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(int l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(int l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(int l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const IntVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const BoolVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const LinIntExpr& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const IntVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const IntVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const BoolVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const BoolVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const IntVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const BoolVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const LinIntExpr& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const LinIntExpr& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <(const LinIntExpr& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(int l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(int l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(int l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const IntVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const BoolVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const LinIntExpr& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const IntVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const IntVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const BoolVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const BoolVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const IntVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const BoolVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const LinIntExpr& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const LinIntExpr& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator <=(const LinIntExpr& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(int l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(int l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(int l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const IntVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const BoolVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const LinIntExpr& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const IntVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const IntVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const BoolVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const BoolVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const IntVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const BoolVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const LinIntExpr& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const LinIntExpr& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >(const LinIntExpr& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(int l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(int l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(int l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const IntVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const BoolVar& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const LinIntExpr& l, int r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const IntVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const IntVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const BoolVar& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const BoolVar& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const IntVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const BoolVar& l, const LinIntExpr& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const LinIntExpr& l, const IntVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const LinIntExpr& l, const BoolVar& r);
GECODE_MINIMODEL_EXPORT LinIntRel
operator >=(const LinIntExpr& l, const LinIntExpr& r);
#ifdef GECODE_HAS_FLOAT_VARS
class NonLinFloatExpr {
public:
virtual FloatVar post(Home home, FloatVar* ret) const = 0;
virtual void post(Home home, FloatRelType frt, FloatVal c) const = 0;
virtual void post(Home home, FloatRelType frt, FloatVal c,
BoolVar b) const = 0;
virtual ~NonLinFloatExpr(void);
static FloatVar result(Home home, FloatVar* x);
static FloatVar result(Home home, FloatVar* x, FloatVar y);
void* operator new(size_t s);
void operator delete(void* p, size_t s);
};
}
#include <gecode/minimodel/float-expr.hpp>
namespace Gecode {
class LinFloatExpr {
friend class LinFloatRel;
public:
enum NodeType {
NT_CONST,
NT_VAR,
NT_NONLIN,
NT_SUM,
NT_ADD,
NT_SUB,
NT_MUL
};
private:
class Node;
Node* n;
public:
GECODE_MINIMODEL_EXPORT
LinFloatExpr(void);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const FloatVal& c);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const FloatVar& x);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const FloatVar& x, FloatVal a);
GECODE_MINIMODEL_EXPORT
explicit LinFloatExpr(const FloatVarArgs& x);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const FloatValArgs& a, const FloatVarArgs& x);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const LinFloatExpr& e);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const LinFloatExpr& e0, NodeType t, const LinFloatExpr& e1);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(const LinFloatExpr& e0, NodeType t, const FloatVal& c);
GECODE_MINIMODEL_EXPORT
LinFloatExpr(FloatVal a, const LinFloatExpr& e);
GECODE_MINIMODEL_EXPORT
explicit LinFloatExpr(NonLinFloatExpr* e);
GECODE_MINIMODEL_EXPORT
const LinFloatExpr& operator =(const LinFloatExpr& e);
GECODE_MINIMODEL_EXPORT
void post(Home home, FloatRelType frt) const;
GECODE_MINIMODEL_EXPORT
void post(Home home, FloatRelType frt, const BoolVar& b) const;
GECODE_MINIMODEL_EXPORT
FloatVar post(Home home) const;
GECODE_MINIMODEL_EXPORT
NonLinFloatExpr* nlfe(void) const;
GECODE_MINIMODEL_EXPORT
~LinFloatExpr(void);
};
class BoolExpr;
class LinFloatRel {
friend class BoolExpr;
private:
LinFloatExpr e;
FloatRelType frt;
static FloatRelType neg(FloatRelType frt);
LinFloatRel(void);
public:
LinFloatRel(const LinFloatExpr& l, FloatRelType frt, const LinFloatExpr& r);
LinFloatRel(const LinFloatExpr& l, FloatRelType frt, FloatVal r);
LinFloatRel(FloatVal l, FloatRelType frt, const LinFloatExpr& r);
void post(Home home, bool t) const;
void post(Home home, const BoolVar& b, bool t) const;
};
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const FloatVal&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const FloatVal&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const FloatVar&, const FloatVal&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const LinFloatExpr&, const FloatVal&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const FloatVar&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const FloatVar&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const LinFloatExpr&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator +(const LinFloatExpr&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const FloatVal&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const FloatVal&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const FloatVar&, const FloatVal&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const LinFloatExpr&, const FloatVal&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const FloatVar&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const FloatVar&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const LinFloatExpr&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const LinFloatExpr&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator -(const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const FloatVal&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const FloatVar&, const FloatVal&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const LinFloatExpr&, const FloatVal&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const FloatVal&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
sum(const FloatVarArgs& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
sum(const FloatValArgs& a, const FloatVarArgs& x);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const FloatVal& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const FloatVal& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const FloatVar& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const LinFloatExpr& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const FloatVar& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const FloatVar& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const LinFloatExpr& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator ==(const LinFloatExpr& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const FloatVal& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const FloatVal& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const FloatVar& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const LinFloatExpr& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const FloatVar& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const FloatVar& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const LinFloatExpr& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator !=(const LinFloatExpr& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const FloatVal& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const FloatVal& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const FloatVar& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const LinFloatExpr& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const FloatVar& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const FloatVar& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const LinFloatExpr& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <(const LinFloatExpr& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const FloatVal& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const FloatVal& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const FloatVar& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const LinFloatExpr& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const FloatVar& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const FloatVar& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const LinFloatExpr& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator <=(const LinFloatExpr& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const FloatVal& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const FloatVal& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const FloatVar& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const LinFloatExpr& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const FloatVar& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const FloatVar& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const LinFloatExpr& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >(const LinFloatExpr& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const FloatVal& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const FloatVal& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const FloatVar& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const LinFloatExpr& l, const FloatVal& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const FloatVar& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const FloatVar& l, const LinFloatExpr& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const LinFloatExpr& l, const FloatVar& r);
GECODE_MINIMODEL_EXPORT LinFloatRel
operator >=(const LinFloatExpr& l, const LinFloatExpr& r);
#endif
#ifdef GECODE_HAS_SET_VARS
class SetExpr {
public:
enum NodeType {
NT_VAR,
NT_CONST,
NT_LEXP,
NT_CMPL,
NT_INTER,
NT_UNION,
NT_DUNION
};
class Node;
private:
Node* n;
public:
SetExpr(void);
GECODE_MINIMODEL_EXPORT
SetExpr(const SetExpr& e);
GECODE_MINIMODEL_EXPORT
SetExpr(const SetExpr& l, NodeType t, const SetExpr& r);
GECODE_MINIMODEL_EXPORT
SetExpr(const SetVar& x);
GECODE_MINIMODEL_EXPORT
explicit SetExpr(const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT
SetExpr(const IntSet& s);
GECODE_MINIMODEL_EXPORT
SetExpr(const SetExpr& e, NodeType t);
GECODE_MINIMODEL_EXPORT
SetVar post(Home home) const;
GECODE_MINIMODEL_EXPORT
void post(Home home, SetRelType srt, const SetExpr& e) const;
GECODE_MINIMODEL_EXPORT
void post(Home home, BoolVar b, bool t,
SetRelType srt, const SetExpr& e) const;
GECODE_MINIMODEL_EXPORT
const SetExpr& operator =(const SetExpr& e);
GECODE_MINIMODEL_EXPORT
~SetExpr(void);
};
class SetCmpRel {
public:
SetExpr l;
SetExpr r;
SetRelType srt;
SetCmpRel(const SetExpr& l, SetRelType srt, const SetExpr& r);
};
class SetRel {
private:
SetExpr _e0;
SetRelType _srt;
SetExpr _e1;
public:
SetRel(void);
SetRel(const SetExpr& e0, SetRelType srt, const SetExpr& e1);
SetRel(const SetCmpRel& r);
void post(Home home, bool t) const;
void post(Home home, BoolVar b, bool t) const;
};
GECODE_MINIMODEL_EXPORT SetExpr
singleton(const LinIntExpr&);
GECODE_MINIMODEL_EXPORT SetExpr
operator -(const SetExpr&);
GECODE_MINIMODEL_EXPORT SetExpr
operator &(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetExpr
operator |(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetExpr
operator +(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetExpr
operator -(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetExpr
inter(const SetVarArgs&);
GECODE_MINIMODEL_EXPORT SetExpr
setunion(const SetVarArgs&);
GECODE_MINIMODEL_EXPORT SetExpr
setdunion(const SetVarArgs&);
GECODE_MINIMODEL_EXPORT LinIntExpr
cardinality(const SetExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
min(const SetExpr&);
GECODE_MINIMODEL_EXPORT LinIntExpr
max(const SetExpr&);
GECODE_MINIMODEL_EXPORT SetRel
operator ==(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetRel
operator !=(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetCmpRel
operator <=(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator <=(const SetCmpRel&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetCmpRel
operator >=(const SetExpr&, const SetExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator >=(const SetCmpRel&, const SetExpr&);
GECODE_MINIMODEL_EXPORT SetRel
operator ||(const SetExpr&, const SetExpr&);
#endif
class BoolExpr {
public:
enum NodeType {
NT_VAR,
NT_NOT,
NT_AND,
NT_OR,
NT_EQV,
NT_RLIN,
NT_RLINFLOAT,
NT_RSET,
NT_MISC
};
class GECODE_VTABLE_EXPORT Misc : public HeapAllocated {
public:
Misc(void);
virtual void post(Home home, BoolVar b, bool neg,
const IntPropLevels& ipls) = 0;
virtual GECODE_MINIMODEL_EXPORT ~Misc(void);
};
class Node;
private:
Node* n;
public:
GECODE_MINIMODEL_EXPORT
BoolExpr(void);
GECODE_MINIMODEL_EXPORT
BoolExpr(const BoolExpr& e);
GECODE_MINIMODEL_EXPORT
BoolExpr(const BoolExpr& l, NodeType t, const BoolExpr& r);
GECODE_MINIMODEL_EXPORT
BoolExpr(const BoolVar& x);
GECODE_MINIMODEL_EXPORT
BoolExpr(const BoolExpr& e, NodeType t);
GECODE_MINIMODEL_EXPORT
BoolExpr(const LinIntRel& rl);
#ifdef GECODE_HAS_FLOAT_VARS
GECODE_MINIMODEL_EXPORT
BoolExpr(const LinFloatRel& rfl);
#endif
#ifdef GECODE_HAS_SET_VARS
GECODE_MINIMODEL_EXPORT
BoolExpr(const SetRel& rs);
GECODE_MINIMODEL_EXPORT
BoolExpr(const SetCmpRel& rs);
#endif
GECODE_MINIMODEL_EXPORT
explicit BoolExpr(Misc* m);
GECODE_MINIMODEL_EXPORT
BoolVar expr(Home home, const IntPropLevels& ipls) const;
GECODE_MINIMODEL_EXPORT
void rel(Home home, const IntPropLevels& ipls) const;
GECODE_MINIMODEL_EXPORT
const BoolExpr& operator =(const BoolExpr& e);
GECODE_MINIMODEL_EXPORT
~BoolExpr(void);
};
GECODE_MINIMODEL_EXPORT BoolExpr
operator !(const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator &&(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator ||(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator ^(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator !=(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator ==(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator >>(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
operator <<(const BoolExpr&, const BoolExpr&);
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const IntVar& x, int n);
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const IntVar& x, int l, int m);
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const IntVar& x, const IntSet& s);
#ifdef GECODE_HAS_SET_VARS
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const SetVar& x, SetRelType rt, int i);
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const SetVar& x, SetRelType rt, int i, int j);
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const SetVar& x, SetRelType rt, const IntSet& s);
#endif
#ifdef GECODE_HAS_FLOAT_VARS
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const FloatVar& x, const FloatVal& n);
GECODE_MINIMODEL_EXPORT BoolExpr
dom(const FloatVar& x, FloatNum l, FloatNum u);
#endif
#ifdef GECODE_HAS_SET_VARS
GECODE_MINIMODEL_EXPORT BoolExpr
operator ==(const SetExpr& s, const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT BoolExpr
operator ==(const LinIntExpr& x, const SetExpr& s);
BoolExpr
operator ==(const LinIntExpr&, IntSet) = delete;
BoolExpr
operator ==(IntSet, const LinIntExpr&) = delete;
GECODE_MINIMODEL_EXPORT BoolExpr
operator !=(const SetExpr& s, const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT BoolExpr
operator !=(const LinIntExpr& x, const SetExpr& s);
BoolExpr
operator !=(const LinIntExpr&, IntSet) = delete;
BoolExpr
operator !=(IntSet, const LinIntExpr&) = delete;
GECODE_MINIMODEL_EXPORT BoolExpr
operator <=(const SetExpr& s, const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT BoolExpr
operator <=(const LinIntExpr& x, const SetExpr& s);
BoolExpr
operator <=(const LinIntExpr&, IntSet) = delete;
BoolExpr
operator <=(IntSet, const LinIntExpr&) = delete;
GECODE_MINIMODEL_EXPORT BoolExpr
operator <(const SetExpr& s, const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT BoolExpr
operator <(const LinIntExpr& x, const SetExpr& s);
BoolExpr
operator <(const LinIntExpr&, IntSet) = delete;
BoolExpr
operator <(IntSet, const LinIntExpr&) = delete;
GECODE_MINIMODEL_EXPORT BoolExpr
operator >=(const SetExpr& s, const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT BoolExpr
operator >=(const LinIntExpr& x, const SetExpr& s);
BoolExpr
operator >=(const LinIntExpr&, IntSet) = delete;
BoolExpr
operator >=(IntSet, const LinIntExpr&) = delete;
GECODE_MINIMODEL_EXPORT BoolExpr
operator >(const SetExpr& s, const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT BoolExpr
operator >(const LinIntExpr& x, const SetExpr& s);
BoolExpr
operator >(const LinIntExpr&, IntSet) = delete;
BoolExpr
operator >(IntSet, const LinIntExpr&) = delete;
#endif
GECODE_MINIMODEL_EXPORT IntVar
expr(Home home, const LinIntExpr& e,
const IntPropLevels& ipls=IntPropLevels::def);
#ifdef GECODE_HAS_FLOAT_VARS
GECODE_MINIMODEL_EXPORT FloatVar
expr(Home home, const LinFloatExpr& e);
#endif
#ifdef GECODE_HAS_SET_VARS
GECODE_MINIMODEL_EXPORT SetVar
expr(Home home, const SetExpr& e);
#endif
GECODE_MINIMODEL_EXPORT BoolVar
expr(Home home, const BoolExpr& e,
const IntPropLevels& ipls=IntPropLevels::def);
GECODE_MINIMODEL_EXPORT void
rel(Home home, const BoolExpr& e,
const IntPropLevels& ipls=IntPropLevels::def);
}
#include <gecode/minimodel/int-rel.hpp>
#include <gecode/minimodel/float-rel.hpp>
#include <gecode/minimodel/bool-expr.hpp>
#include <gecode/minimodel/set-expr.hpp>
#include <gecode/minimodel/set-rel.hpp>
namespace Gecode {
namespace MiniModel {
class ExpInfo;
}
class GECODE_MINIMODEL_EXPORT REG {
friend class MiniModel::ExpInfo;
private:
class Exp;
Exp* e;
REG(Exp* e);
std::string toString(void) const;
public:
REG(void);
REG(int s);
REG(const IntArgs& x);
REG(const REG& r);
const REG& operator =(const REG& r);
REG operator +(const REG& r);
REG& operator +=(const REG& r);
REG operator |(const REG& r);
REG& operator |=(const REG& r);
REG operator *(void);
REG operator +(void);
REG operator ()(unsigned int n, unsigned int m);
REG operator ()(unsigned int n);
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
print(std::basic_ostream<Char,Traits>& os) const;
operator DFA(void);
~REG(void);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const REG& r);
}
#include <gecode/minimodel/reg.hpp>
namespace Gecode {
GECODE_MINIMODEL_EXPORT LinIntExpr
operator *(const LinIntExpr& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator /(const LinIntExpr& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
operator %(const LinIntExpr& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
abs(const LinIntExpr& e);
GECODE_MINIMODEL_EXPORT LinIntExpr
min(const LinIntExpr& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
min(const IntVarArgs& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
max(const LinIntExpr& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
max(const IntVarArgs& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
sqr(const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
sqrt(const LinIntExpr& x);
GECODE_MINIMODEL_EXPORT LinIntExpr
pow(const LinIntExpr& x, int n);
GECODE_MINIMODEL_EXPORT LinIntExpr
nroot(const LinIntExpr& x, int n);
GECODE_MINIMODEL_EXPORT LinIntExpr
element(const IntVarArgs& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT BoolExpr
element(const BoolVarArgs& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
element(const IntArgs& x, const LinIntExpr& y);
GECODE_MINIMODEL_EXPORT LinIntExpr
ite(const BoolExpr& b, const LinIntExpr& x, const LinIntExpr& y);
#ifdef GECODE_HAS_FLOAT_VARS
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const FloatVar&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const FloatVar&, const LinFloatExpr&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const LinFloatExpr&, const FloatVar&);
GECODE_MINIMODEL_EXPORT LinFloatExpr
abs(const LinFloatExpr& e);
GECODE_MINIMODEL_EXPORT LinFloatExpr
min(const LinFloatExpr& x, const LinFloatExpr& y);
GECODE_MINIMODEL_EXPORT LinFloatExpr
min(const FloatVarArgs& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
max(const LinFloatExpr& x, const LinFloatExpr& y);
GECODE_MINIMODEL_EXPORT LinFloatExpr
max(const FloatVarArgs& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator *(const LinFloatExpr& x, const LinFloatExpr& y);
GECODE_MINIMODEL_EXPORT LinFloatExpr
operator /(const LinFloatExpr& x, const LinFloatExpr& y);
GECODE_MINIMODEL_EXPORT LinFloatExpr
sqr(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
sqrt(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
pow(const LinFloatExpr& x, int n);
GECODE_MINIMODEL_EXPORT LinFloatExpr
nroot(const LinFloatExpr& x, int n);
#ifdef GECODE_HAS_MPFR
GECODE_MINIMODEL_EXPORT LinFloatExpr
exp(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
log(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
asin(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
sin(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
acos(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
cos(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
atan(const LinFloatExpr& x);
GECODE_MINIMODEL_EXPORT LinFloatExpr
tan(const LinFloatExpr& x);
#endif
#endif
}
namespace Gecode {
BoolVar
channel(Home home, IntVar x, IntPropLevel ipl=IPL_DEF);
IntVar
channel(Home home, BoolVar b, IntPropLevel ipl=IPL_DEF);
#ifdef GECODE_HAS_FLOAT_VARS
IntVar
channel(Home home, FloatVar f);
#endif
#ifdef GECODE_HAS_SET_VARS
SetVar
channel(Home home, const IntVarArgs& x, IntPropLevel ipl=IPL_DEF);
#endif
}
#include <gecode/minimodel/channel.hpp>
namespace Gecode {
void
atmost(Home home, const IntVarArgs& x, int n, int m,
IntPropLevel ipl=IPL_DEF);
void
atmost(Home home, const IntVarArgs& x, IntVar y, int m,
IntPropLevel ipl=IPL_DEF);
void
atmost(Home home, const IntVarArgs& x, const IntArgs& y, int m,
IntPropLevel ipl=IPL_DEF);
void
atmost(Home home, const IntVarArgs& x, int n, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
atmost(Home home, const IntVarArgs& x, IntVar y, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
atmost(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
atleast(Home home, const IntVarArgs& x, int n, int m,
IntPropLevel ipl=IPL_DEF);
void
atleast(Home home, const IntVarArgs& x, IntVar y, int m,
IntPropLevel ipl=IPL_DEF);
void
atleast(Home home, const IntVarArgs& x, const IntArgs& y, int m,
IntPropLevel ipl=IPL_DEF);
void
atleast(Home home, const IntVarArgs& x, int n, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
atleast(Home home, const IntVarArgs& x, IntVar y, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
atleast(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
exactly(Home home, const IntVarArgs& x, int n, int m,
IntPropLevel ipl=IPL_DEF);
void
exactly(Home home, const IntVarArgs& x, IntVar y, int m,
IntPropLevel ipl=IPL_DEF);
void
exactly(Home home, const IntVarArgs& x, const IntArgs& y, int m,
IntPropLevel ipl=IPL_DEF);
void
exactly(Home home, const IntVarArgs& x, int n, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
exactly(Home home, const IntVarArgs& x, IntVar y, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
exactly(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
IntPropLevel ipl=IPL_DEF);
void
lex(Home home, const IntVarArgs& x, IntRelType r, const IntVarArgs& y,
IntPropLevel ipl=IPL_DEF);
void
lex(Home home, const BoolVarArgs& x, IntRelType r, const BoolVarArgs& y,
IntPropLevel ipl=IPL_DEF);
void
values(Home home, const IntVarArgs& x, IntSet y,
IntPropLevel ipl=IPL_DEF);
#ifdef GECODE_HAS_SET_VARS
void
channel(Home home, const IntVarArgs& x, SetVar y);
void
range(Home home, const IntVarArgs& x, SetVar y, SetVar z);
void
roots(Home home, const IntVarArgs& x, SetVar y, SetVar z);
#endif
}
#include <gecode/minimodel/aliases.hpp>
namespace Gecode {
template<class> class Matrix;
template<class A>
class Slice {
public:
typedef typename ArrayTraits<A>::ArgsType ArgsType;
private:
ArgsType _r;
int _fc,
_tc,
_fr,
_tr;
public:
Slice(const Matrix<A>& a, int fc, int tc, int fr, int tr);
Slice& reverse(void);
operator ArgsType(void);
operator Matrix<ArgsType>(void);
operator const ArgsType(void) const;
operator const Matrix<ArgsType>(void) const;
};
template<class A>
typename Slice<A>::ArgsType
operator+(const Slice<A>& x, const Slice<A>& y);
template<class A>
typename Slice<A>::ArgsType
operator+(const Slice<A>& x, const typename ArrayTraits<A>::ArgsType& y);
template<class A>
typename Slice<A>::ArgsType
operator+(const typename ArrayTraits<A>::ArgsType& x, const Slice<A>& y);
template<class A>
typename Slice<A>::ArgsType
operator+(const Slice<A>& x, const typename ArrayTraits<A>::ValueType& y);
template<class A>
typename Slice<A>::ArgsType
operator+(const typename ArrayTraits<A>::ValueType& x, const Slice<A>& y);
template<class A>
class Matrix {
public:
typedef typename ArrayTraits<A>::ValueType ValueType;
typedef typename ArrayTraits<A>::ArgsType ArgsType;
private:
typedef typename ArrayTraits<A>::StorageType StorageType;
StorageType _a;
int _w;
int _h;
public:
Matrix(A a, int w, int h);
Matrix(A a, int n);
int width(void) const;
int height(void) const;
ArgsType const get_array(void) const;
ValueType& operator ()(int c, int r);
const ValueType& operator ()(int c, int r) const;
Slice<A> slice(int fc, int tc, int fr, int tr) const;
Slice<A> row(int r) const;
Slice<A> col(int c) const;
};
template<class Char, class Traits, class A>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const Matrix<A>& m);
template<class Char, class Traits, class A>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const Slice<A>& s);
void element(Home home, const Matrix<IntArgs>& m, IntVar x, IntVar y,
IntVar z, IntPropLevel ipl=IPL_DEF);
void element(Home home, const Matrix<IntArgs>& m, IntVar x, IntVar y,
BoolVar z, IntPropLevel ipl=IPL_DEF);
void element(Home home, const Matrix<IntVarArgs>& m, IntVar x, IntVar y,
IntVar z, IntPropLevel ipl=IPL_DEF);
void element(Home home, const Matrix<BoolVarArgs>& m, IntVar x, IntVar y,
BoolVar z, IntPropLevel ipln=IPL_DEF);
#ifdef GECODE_HAS_SET_VARS
void element(Home home, const Matrix<IntSetArgs>& m, IntVar x, IntVar y,
SetVar z);
void element(Home home, const Matrix<SetVarArgs>& m, IntVar x, IntVar y,
SetVar z);
#endif
template<class A>
SymmetryHandle rows_interchange(const Matrix<A>& m);
template<class A>
SymmetryHandle columns_interchange(const Matrix<A>& m);
template<class A>
SymmetryHandle rows_reflect(const Matrix<A>& m);
template<class A>
SymmetryHandle columns_reflect(const Matrix<A>& m);
template<class A>
SymmetryHandle diagonal_reflect(const Matrix<A>& m);
}
#include <gecode/minimodel/matrix.hpp>
#include <gecode/minimodel/ldsb.hpp>
namespace Gecode {
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const Slice<IntArgs>& slice);
GECODE_MINIMODEL_EXPORT LinIntExpr
sum(const Matrix<IntArgs>& matrix);
}
namespace Gecode {
class GECODE_VTABLE_EXPORT IntMinimizeSpace : public Space {
public:
IntMinimizeSpace(void);
IntMinimizeSpace(IntMinimizeSpace& s);
GECODE_MINIMODEL_EXPORT
virtual void constrain(const Space& best);
virtual IntVar cost(void) const = 0;
};
class GECODE_VTABLE_EXPORT IntMaximizeSpace : public Space {
public:
IntMaximizeSpace(void);
IntMaximizeSpace(IntMaximizeSpace& s);
GECODE_MINIMODEL_EXPORT
virtual void constrain(const Space& best);
virtual IntVar cost(void) const = 0;
};
class GECODE_VTABLE_EXPORT IntLexMinimizeSpace : public Space {
public:
IntLexMinimizeSpace(void);
IntLexMinimizeSpace(IntLexMinimizeSpace& s);
GECODE_MINIMODEL_EXPORT
virtual void constrain(const Space& best);
virtual IntVarArgs cost(void) const = 0;
};
class GECODE_VTABLE_EXPORT IntLexMaximizeSpace : public Space {
public:
IntLexMaximizeSpace(void);
IntLexMaximizeSpace(IntLexMaximizeSpace& s);
GECODE_MINIMODEL_EXPORT
virtual void constrain(const Space& best);
virtual IntVarArgs cost(void) const = 0;
};
#ifdef GECODE_HAS_FLOAT_VARS
class GECODE_VTABLE_EXPORT FloatMinimizeSpace : public Space {
protected:
FloatNum step;
public:
FloatMinimizeSpace(FloatNum s=0.0);
FloatMinimizeSpace(FloatMinimizeSpace& s);
GECODE_MINIMODEL_EXPORT
virtual void constrain(const Space& best);
virtual FloatVar cost(void) const = 0;
};
class GECODE_VTABLE_EXPORT FloatMaximizeSpace : public Space {
protected:
FloatNum step;
public:
FloatMaximizeSpace(FloatNum s=0.0);
FloatMaximizeSpace(FloatMaximizeSpace& s);
GECODE_MINIMODEL_EXPORT
virtual void constrain(const Space& best);
virtual FloatVar cost(void) const = 0;
};
#endif
}
#include <gecode/minimodel/optimize.hpp>
#endif
// IFDEF: GECODE_HAS_INT_VARS
// STATISTICS: minimodel-any
aliases.hpp
auto-link.hpp
bool-expr.hpp
Gecode::ArrayTraits
Traits of arrays in Gecode.
Definition array.hpp:94
Gecode::BoolExpr::Misc
Miscealloneous Boolean expressions.
Definition minimodel.hh:1344
Gecode::BoolExpr::Misc::Misc
Misc(void)
Default constructor.
Definition bool-expr.hpp:42
Gecode::BoolExpr::Misc::post
virtual void post(Home home, BoolVar b, bool neg, const IntPropLevels &ipls)=0
Gecode::BoolExpr::Node
Node for Boolean expression
Definition bool-expr.cpp:43
Gecode::BoolExpr
Boolean expressions.
Definition minimodel.hh:1329
Gecode::BoolExpr::BoolExpr
BoolExpr(void)
Default constructor.
Definition bool-expr.cpp:114
Gecode::BoolExpr::NodeType
NodeType
Type of Boolean expression.
Definition minimodel.hh:1332
Gecode::BoolExpr::NT_RLINFLOAT
@ NT_RLINFLOAT
Reified linear relation.
Definition minimodel.hh:1339
Gecode::BoolExpr::NT_AND
@ NT_AND
Conjunction.
Definition minimodel.hh:1335
Gecode::BoolExpr::NT_EQV
@ NT_EQV
Equivalence.
Definition minimodel.hh:1337
Gecode::BoolExpr::NT_RLIN
@ NT_RLIN
Reified linear relation.
Definition minimodel.hh:1338
Gecode::BoolExpr::NT_VAR
@ NT_VAR
Variable.
Definition minimodel.hh:1333
Gecode::BoolExpr::NT_OR
@ NT_OR
Disjunction.
Definition minimodel.hh:1336
Gecode::BoolExpr::NT_MISC
@ NT_MISC
Other Boolean expression.
Definition minimodel.hh:1341
Gecode::BoolExpr::NT_NOT
@ NT_NOT
Negation.
Definition minimodel.hh:1334
Gecode::BoolExpr::NT_RSET
@ NT_RSET
Reified set relation.
Definition minimodel.hh:1340
Gecode::BoolExpr::operator=
const BoolExpr & operator=(const BoolExpr &e)
Assignment operator.
Definition bool-expr.cpp:206
Gecode::BoolExpr::expr
BoolVar expr(Home home, const IntPropLevels &ipls) const
Post propagators for expression.
Definition bool-expr.cpp:574
Gecode::BoolExpr::~BoolExpr
~BoolExpr(void)
Destructor.
Definition bool-expr.cpp:218
Gecode::BoolExpr::rel
void rel(Home home, const IntPropLevels &ipls) const
Post propagators for relation.
Definition bool-expr.cpp:580
Gecode::BoolVarArgs
Passing Boolean variables.
Definition int.hh:712
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::DFA
Deterministic finite automaton (DFA).
Definition int.hh:2049
Gecode::FloatMaximizeSpace::constrain
virtual void constrain(const Space &best)
Member function constraining according to cost.
Definition optimize.cpp:97
Gecode::FloatMaximizeSpace::step
FloatNum step
Step by which a next solution has to have lower cost.
Definition minimodel.hh:2474
Gecode::FloatMaximizeSpace::cost
virtual FloatVar cost(void) const =0
Return variable with current cost.
Gecode::FloatMaximizeSpace::FloatMaximizeSpace
FloatMaximizeSpace(FloatNum s=0.0)
Constructor with step s.
Definition optimize.hpp:80
Gecode::FloatMinimizeSpace::cost
virtual FloatVar cost(void) const =0
Return variable with current cost.
Gecode::FloatMinimizeSpace::constrain
virtual void constrain(const Space &best)
Member function constraining according to cost.
Definition optimize.cpp:87
Gecode::FloatMinimizeSpace::FloatMinimizeSpace
FloatMinimizeSpace(FloatNum s=0.0)
Constructor with step s.
Definition optimize.hpp:71
Gecode::FloatMinimizeSpace::step
FloatNum step
Step by which a next solution has to have lower cost.
Definition minimodel.hh:2449
Gecode::FloatValArgs
Passing float arguments.
Definition float.hh:950
Gecode::FloatVal
Float value type.
Definition float.hh:334
Gecode::FloatVarArgs
Passing float variables.
Definition float.hh:979
Gecode::FloatVar
Float variables.
Definition float.hh:870
Gecode::HeapAllocated
Base class for heap allocated objects.
Definition heap.hpp:340
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::IntArgs
Passing integer arguments.
Definition int.hh:628
Gecode::IntLexMaximizeSpace::cost
virtual IntVarArgs cost(void) const =0
Return variables with current costs.
Gecode::IntLexMaximizeSpace::IntLexMaximizeSpace
IntLexMaximizeSpace(void)
Default constructor.
Definition optimize.hpp:61
Gecode::IntLexMaximizeSpace::constrain
virtual void constrain(const Space &best)
Member function constraining according to increasing costs.
Definition optimize.cpp:72
Gecode::IntLexMinimizeSpace::cost
virtual IntVarArgs cost(void) const =0
Return variables with current costs.
Gecode::IntLexMinimizeSpace::constrain
virtual void constrain(const Space &best)
Member function constraining according to decreasing costs.
Definition optimize.cpp:59
Gecode::IntLexMinimizeSpace::IntLexMinimizeSpace
IntLexMinimizeSpace(void)
Default constructor.
Definition optimize.hpp:53
Gecode::IntMaximizeSpace::cost
virtual IntVar cost(void) const =0
Return variable with current cost.
Gecode::IntMaximizeSpace::IntMaximizeSpace
IntMaximizeSpace(void)
Default constructor.
Definition optimize.hpp:45
Gecode::IntMaximizeSpace::constrain
virtual void constrain(const Space &best)
Member function constraining according to increasing cost.
Definition optimize.cpp:49
Gecode::IntMinimizeSpace::cost
virtual IntVar cost(void) const =0
Return variable with current cost.
Gecode::IntMinimizeSpace::IntMinimizeSpace
IntMinimizeSpace(void)
Default constructor.
Definition optimize.hpp:37
Gecode::IntMinimizeSpace::constrain
virtual void constrain(const Space &best)
Member function constraining according to decreasing cost.
Definition optimize.cpp:39
Gecode::IntPropLevels
Class for specifying integer propagation levels used by minimodel.
Definition minimodel.hh:101
Gecode::IntPropLevels::_linear
IntPropLevel _linear
For n-ary linear.
Definition minimodel.hh:104
Gecode::IntPropLevels::div
IntPropLevel div(void) const
Return integer propagation level for division constraints.
Definition ipl.hpp:114
Gecode::IntPropLevels::element
IntPropLevel element(void) const
Return integer propagation level for element constraints.
Definition ipl.hpp:164
Gecode::IntPropLevels::_sqr
IntPropLevel _sqr
For square.
Definition minimodel.hh:113
Gecode::IntPropLevels::mod
IntPropLevel mod(void) const
Return integer propagation level for modulo constraints.
Definition ipl.hpp:122
Gecode::IntPropLevels::linear
IntPropLevel linear(void) const
Return integer propagation level for non-binary linear constraints.
Definition ipl.hpp:55
Gecode::IntPropLevels::max2
IntPropLevel max2(void) const
Return integer propagation level for binary maximum constraints.
Definition ipl.hpp:73
Gecode::IntPropLevels::_mult
IntPropLevel _mult
For multiplication.
Definition minimodel.hh:110
Gecode::IntPropLevels::_mod
IntPropLevel _mod
For modulo.
Definition minimodel.hh:112
Gecode::IntPropLevels::ite
IntPropLevel ite(void) const
Return integer propagation level for if-then-else constraints.
Definition ipl.hpp:173
Gecode::IntPropLevels::mult
IntPropLevel mult(void) const
Return integer propagation level for multiplication constraints.
Definition ipl.hpp:106
Gecode::IntPropLevels::min
IntPropLevel min(void) const
Return integer propagation level for non-binary minimum constraints.
Definition ipl.hpp:97
Gecode::IntPropLevels::_sqrt
IntPropLevel _sqrt
For square root.
Definition minimodel.hh:114
Gecode::IntPropLevels::_ite
IntPropLevel _ite
For if-then-else.
Definition minimodel.hh:118
Gecode::IntPropLevels::nroot
IntPropLevel nroot(void) const
Return integer propagation level for root constraints.
Definition ipl.hpp:155
Gecode::IntPropLevels::abs
IntPropLevel abs(void) const
Return integer propagation level for absolute value constraints.
Definition ipl.hpp:64
Gecode::IntPropLevels::_max
IntPropLevel _max
For n-ary maximum.
Definition minimodel.hh:107
Gecode::IntPropLevels::_nroot
IntPropLevel _nroot
For root.
Definition minimodel.hh:116
Gecode::IntPropLevels::_pow
IntPropLevel _pow
For power.
Definition minimodel.hh:115
Gecode::IntPropLevels::_element
IntPropLevel _element
For element.
Definition minimodel.hh:117
Gecode::IntPropLevels::_div
IntPropLevel _div
For division.
Definition minimodel.hh:111
Gecode::IntPropLevels::_abs
IntPropLevel _abs
For absolute value.
Definition minimodel.hh:105
Gecode::IntPropLevels::sqrt
IntPropLevel sqrt(void) const
Return integer propagation level for square root constraints.
Definition ipl.hpp:139
Gecode::IntPropLevels::IntPropLevels
IntPropLevels(IntPropLevel ipl=IPL_DEF)
Initialize with default propagation level.
Definition ipl.hpp:37
Gecode::IntPropLevels::def
static const IntPropLevels def
Default propagation levels for all constraints.
Definition minimodel.hh:197
Gecode::IntPropLevels::linear2
IntPropLevel linear2(void) const
Return integer propagation level for binary linear constraints.
Definition ipl.hpp:47
Gecode::IntPropLevels::min2
IntPropLevel min2(void) const
Return integer propagation level for binary minimum constraints.
Definition ipl.hpp:89
Gecode::IntPropLevels::_min2
IntPropLevel _min2
For binary minimum.
Definition minimodel.hh:108
Gecode::IntPropLevels::pow
IntPropLevel pow(void) const
Return integer propagation level for power constraints.
Definition ipl.hpp:147
Gecode::IntPropLevels::_min
IntPropLevel _min
For minimum.
Definition minimodel.hh:109
Gecode::IntPropLevels::_linear2
IntPropLevel _linear2
For binary linear.
Definition minimodel.hh:103
Gecode::IntPropLevels::_max2
IntPropLevel _max2
For binary maximum.
Definition minimodel.hh:106
Gecode::IntPropLevels::max
IntPropLevel max(void) const
Return integer propagation level for non-binary maximum constraints.
Definition ipl.hpp:81
Gecode::IntPropLevels::sqr
IntPropLevel sqr(void) const
Return integer propagation level for square constraints.
Definition ipl.hpp:131
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::IntVarArgs
Passing integer variables.
Definition int.hh:656
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::LinFloatExpr
Float expressions
Definition minimodel.hh:822
Gecode::LinFloatExpr::LinFloatRel
friend class LinFloatRel
Definition minimodel.hh:823
Gecode::LinFloatExpr::nlfe
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or null if not non-linear.
Definition float-expr.cpp:138
Gecode::LinFloatExpr::LinFloatExpr
LinFloatExpr(void)
Default constructor.
Definition float-expr.cpp:226
Gecode::LinFloatExpr::operator=
const LinFloatExpr & operator=(const LinFloatExpr &e)
Assignment operator.
Definition float-expr.cpp:328
Gecode::LinFloatExpr::~LinFloatExpr
~LinFloatExpr(void)
Destructor.
Definition float-expr.cpp:337
Gecode::LinFloatExpr::post
void post(Home home, FloatRelType frt) const
Post propagator.
Definition float-expr.cpp:152
Gecode::LinFloatExpr::NodeType
NodeType
Type of linear expression.
Definition minimodel.hh:826
Gecode::LinFloatExpr::NT_VAR
@ NT_VAR
Linear term with variable.
Definition minimodel.hh:828
Gecode::LinFloatExpr::NT_CONST
@ NT_CONST
Float value constant.
Definition minimodel.hh:827
Gecode::LinFloatExpr::NT_SUM
@ NT_SUM
Sum of float variables.
Definition minimodel.hh:830
Gecode::LinFloatExpr::NT_NONLIN
@ NT_NONLIN
Non-linear expression.
Definition minimodel.hh:829
Gecode::LinFloatExpr::NT_ADD
@ NT_ADD
Addition of linear terms.
Definition minimodel.hh:831
Gecode::LinFloatExpr::NT_MUL
@ NT_MUL
Multiplication by coefficient.
Definition minimodel.hh:833
Gecode::LinFloatExpr::NT_SUB
@ NT_SUB
Subtraction of linear terms.
Definition minimodel.hh:832
Gecode::LinFloatRel
Linear relations.
Definition minimodel.hh:896
Gecode::LinFloatRel::post
void post(Home home, bool t) const
Post propagator for relation (if t is false for negated relation).
Definition float-rel.hpp:72
Gecode::LinFloatRel::BoolExpr
friend class BoolExpr
Definition minimodel.hh:897
Gecode::LinIntExpr
Linear expressions over integer variables.
Definition minimodel.hh:245
Gecode::LinIntExpr::NodeType
NodeType
Type of linear expression.
Definition minimodel.hh:255
Gecode::LinIntExpr::NT_CONST
@ NT_CONST
Integer constant.
Definition minimodel.hh:256
Gecode::LinIntExpr::NT_SUB
@ NT_SUB
Subtraction of linear terms.
Definition minimodel.hh:263
Gecode::LinIntExpr::NT_SUM_BOOL
@ NT_SUM_BOOL
Sum of Boolean variables.
Definition minimodel.hh:261
Gecode::LinIntExpr::NT_ADD
@ NT_ADD
Addition of linear terms.
Definition minimodel.hh:262
Gecode::LinIntExpr::NT_SUM_INT
@ NT_SUM_INT
Sum of integer variables.
Definition minimodel.hh:260
Gecode::LinIntExpr::NT_VAR_BOOL
@ NT_VAR_BOOL
Linear term with Boolean variable.
Definition minimodel.hh:258
Gecode::LinIntExpr::NT_MUL
@ NT_MUL
Multiplication by coefficient.
Definition minimodel.hh:264
Gecode::LinIntExpr::NT_NONLIN
@ NT_NONLIN
Non-linear expression.
Definition minimodel.hh:259
Gecode::LinIntExpr::NT_VAR_INT
@ NT_VAR_INT
Linear term with integer variable.
Definition minimodel.hh:257
Gecode::LinIntExpr::LinIntExpr
LinIntExpr(void)
Default constructor.
Definition int-expr.cpp:363
Gecode::LinIntExpr::LinFloatExpr
friend class LinFloatExpr
Definition minimodel.hh:251
Gecode::LinIntExpr::~LinIntExpr
~LinIntExpr(void)
Destructor.
Definition int-expr.cpp:514
Gecode::LinIntExpr::post
void post(Home home, IntRelType irt, const IntPropLevels &ipls) const
Post propagator.
Definition int-expr.cpp:156
Gecode::LinIntExpr::operator=
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
Definition int-expr.cpp:505
Gecode::LinIntExpr::nle
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or null if not non-linear.
Definition int-expr.cpp:359
Gecode::LinIntExpr::LinIntRel
friend class LinIntRel
Definition minimodel.hh:246
Gecode::LinIntExpr::SetExpr
friend class SetExpr
Definition minimodel.hh:248
Gecode::LinIntRel
Linear relations over integer variables.
Definition minimodel.hh:335
Gecode::LinIntRel::post
void post(Home home, bool t, const IntPropLevels &ipls) const
Post propagator for relation (if t is false for negated relation).
Definition int-rel.hpp:70
Gecode::LinIntRel::BoolExpr
friend class BoolExpr
Definition minimodel.hh:336
Gecode::Matrix
Matrix-interface for arrays.
Definition minimodel.hh:2161
Gecode::Matrix::width
int width(void) const
Return the width of the matrix.
Definition matrix.hpp:143
Gecode::Matrix::operator()
ValueType & operator()(int c, int r)
Access element (c, r) of the matrix.
Definition matrix.hpp:155
Gecode::Matrix::slice
Slice< A > slice(int fc, int tc, int fr, int tr) const
Access slice of the matrix.
Definition matrix.hpp:171
Gecode::Matrix::col
Slice< A > col(int c) const
Access column c.
Definition matrix.hpp:183
Gecode::Matrix::ValueType
ArrayTraits< A >::ValueType ValueType
The type of elements of this array.
Definition minimodel.hh:2164
Gecode::Matrix::row
Slice< A > row(int r) const
Access row r.
Definition matrix.hpp:177
Gecode::Matrix::get_array
ArgsType const get_array(void) const
Return an Args-array of the contents of the matrix.
Definition matrix.hpp:149
Gecode::Matrix::Matrix
Matrix(A a, int w, int h)
Basic constructor.
Definition matrix.hpp:127
Gecode::Matrix::ArgsType
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
Definition minimodel.hh:2166
Gecode::Matrix::height
int height(void) const
Return the height of the matrix.
Definition matrix.hpp:146
Gecode::MiniModel::ExpInfo
Expression information.
Definition reg.cpp:534
Gecode::NonLinFloatExpr
Base class for non-linear float expressions.
Definition minimodel.hh:794
Gecode::NonLinFloatExpr::post
virtual void post(Home home, FloatRelType frt, FloatVal c) const =0
Post expression to be in relation frt with c.
Gecode::NonLinFloatExpr::result
static FloatVar result(Home home, FloatVar *x)
Return fresh variable if x is null, x otherwise.
Definition float-expr.hpp:40
Gecode::NonLinFloatExpr::~NonLinFloatExpr
virtual ~NonLinFloatExpr(void)
Destructor.
Definition float-expr.hpp:37
Gecode::NonLinFloatExpr::post
virtual void post(Home home, FloatRelType frt, FloatVal c, BoolVar b) const =0
Post reified expression to be in relation frt with c.
Gecode::NonLinFloatExpr::post
virtual FloatVar post(Home home, FloatVar *ret) const =0
Return variable constrained to be equal to the expression.
Gecode::NonLinIntExpr
Base class for non-linear expressions over integer variables.
Definition minimodel.hh:215
Gecode::NonLinIntExpr::post
virtual void post(Home home, IntRelType irt, int c, BoolVar b, const IntPropLevels &ipls) const =0
Post reified expression to be in relation irt with c.
Gecode::NonLinIntExpr::result
static IntVar result(Home home, IntVar *x)
Return fresh variable if x is null, x otherwise.
Definition int-expr.hpp:40
Gecode::NonLinIntExpr::post
virtual void post(Home home, IntRelType irt, int c, const IntPropLevels &ipls) const =0
Post expression to be in relation irt with c.
Gecode::NonLinIntExpr::post
virtual IntVar post(Home home, IntVar *ret, const IntPropLevels &ipls) const =0
Return variable constrained to be equal to the expression.
Gecode::NonLinIntExpr::~NonLinIntExpr
virtual ~NonLinIntExpr(void)
Destructor.
Definition int-expr.hpp:37
Gecode::REG::Exp
Implementation of the actual expression tree.
Definition reg.cpp:52
Gecode::REG
Regular expressions over integer values.
Definition minimodel.hh:1625
Gecode::SetCmpRel
Comparison relation (for two-sided comparisons).
Definition minimodel.hh:1221
Gecode::SetCmpRel::srt
SetRelType srt
Which relation.
Definition minimodel.hh:1228
Gecode::SetCmpRel::l
SetExpr l
Left side of relation.
Definition minimodel.hh:1224
Gecode::SetCmpRel::r
SetExpr r
Right side of relation.
Definition minimodel.hh:1226
Gecode::SetCmpRel::SetCmpRel
SetCmpRel(const SetExpr &l, SetRelType srt, const SetExpr &r)
Constructor.
Definition set-rel.hpp:43
Gecode::SetExpr
Set expressions
Definition minimodel.hh:1164
Gecode::SetExpr::SetExpr
SetExpr(void)
Default constructor.
Definition set-expr.hpp:44
Gecode::SetExpr::post
SetVar post(Home home) const
Post propagators for expression.
Definition set-expr.cpp:649
Gecode::SetExpr::~SetExpr
~SetExpr(void)
Destructor.
Definition set-expr.cpp:639
Gecode::SetExpr::NodeType
NodeType
Type of set expression.
Definition minimodel.hh:1167
Gecode::SetExpr::NT_CMPL
@ NT_CMPL
Complement.
Definition minimodel.hh:1171
Gecode::SetExpr::NT_INTER
@ NT_INTER
Intersection.
Definition minimodel.hh:1172
Gecode::SetExpr::NT_DUNION
@ NT_DUNION
Disjoint union.
Definition minimodel.hh:1174
Gecode::SetExpr::NT_UNION
@ NT_UNION
Union.
Definition minimodel.hh:1173
Gecode::SetExpr::NT_VAR
@ NT_VAR
Variable.
Definition minimodel.hh:1168
Gecode::SetExpr::NT_LEXP
@ NT_LEXP
Linear expression.
Definition minimodel.hh:1170
Gecode::SetExpr::NT_CONST
@ NT_CONST
Constant.
Definition minimodel.hh:1169
Gecode::SetExpr::operator=
const SetExpr & operator=(const SetExpr &e)
Assignment operator.
Definition set-expr.cpp:629
Gecode::SetRel
Set relations
Definition minimodel.hh:1234
Gecode::SetRel::post
void post(Home home, bool t) const
Post propagators for relation (or negated relation if t is false).
Definition set-rel.hpp:58
Gecode::SetRel::SetRel
SetRel(void)
Default constructor.
Definition set-rel.hpp:47
Gecode::SetVarArgs
Passing set variables.
Definition set.hh:488
Gecode::SetVar
Set variables
Definition set.hh:127
Gecode::Slice
A slice of a matrix.
Definition minimodel.hh:2097
Gecode::Slice::Slice
Slice(const Matrix< A > &a, int fc, int tc, int fr, int tr)
Construct slice.
Definition matrix.hpp:43
Gecode::Slice::reverse
Slice & reverse(void)
Reverses the contents of the slice, and returns a reference to it.
Definition matrix.hpp:62
Gecode::Slice::ArgsType
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
Definition minimodel.hh:2100
Gecode::SymmetryHandle
A reference-counted pointer to a SymmetryObject.
Definition int.hh:5255
float-expr.hpp
float-rel.hpp
float.hh
int.hh
set.hh
Gecode::rel
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
Gecode::ite
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition bool.cpp:39
Gecode::FloatNum
double FloatNum
Floating point number base type.
Definition float.hh:106
Gecode::FloatRelType
FloatRelType
Relation types for floats.
Definition float.hh:1068
Gecode::IntRelType
IntRelType
Relation types for integers.
Definition int.hh:925
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:974
Gecode::_IPL_BITS
@ _IPL_BITS
Number of bits required (internal).
Definition int.hh:984
Gecode::IPL_DEF
@ IPL_DEF
Simple propagation levels.
Definition int.hh:976
Gecode::Space::Space
Space(void)
Default constructor.
Definition core.cpp:115
Gecode::SetRelType
SetRelType
Common relation types for sets.
Definition set.hh:643
int-expr.hpp
int-rel.hpp
print
void print(const Search::Statistics &stat, bool restart)
Print statistics.
Definition job-shop.cpp:606
kernel.hh
ldsb.hpp
matrix.hpp
channel.hpp
exception.hpp
ipl.hpp
GECODE_MINIMODEL_EXPORT
#define GECODE_MINIMODEL_EXPORT
Definition minimodel.hh:78
Gecode::MiniModel
Minimalistic modeling support.
Definition minimodel.hh:92
Gecode
Gecode toplevel namespace
Gecode::operator/
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition val.hpp:213
Gecode::lex
void lex(Home home, const IntVarArgs &x, IntRelType r, const IntVarArgs &y, IntPropLevel ipl=IPL_DEF)
Post lexical order between x and y.
Definition aliases.hpp:132
Gecode::operator-
FloatVal operator-(const FloatVal &x)
Definition val.hpp:168
Gecode::operator<=
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition val.hpp:243
Gecode::sin
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:52
Gecode::operator+
FloatVal operator+(const FloatVal &x)
Definition val.hpp:164
Gecode::rows_reflect
SymmetryHandle rows_reflect(const Matrix< A > &m)
Reflect rows symmetry specification.
Definition ldsb.hpp:62
Gecode::channel
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition channel.cpp:41
Gecode::atmost
void atmost(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:39
Gecode::operator||
SetRel operator||(const SetExpr &, const SetExpr &)
Disjointness of set expressions.
Definition set-rel.cpp:71
Gecode::sqr
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:95
Gecode::expr
IntVar expr(Home home, const LinIntExpr &e, const IntPropLevels &ipls=IntPropLevels::def)
Post linear expression and return its value.
Definition int-expr.cpp:915
Gecode::operator&
SetExpr operator&(const SetExpr &, const SetExpr &)
Intersection of set expressions.
Definition set-expr.cpp:671
Gecode::operator<<
Archive & operator<<(Archive &e, FloatNumBranch nl)
Definition val-sel.hpp:39
Gecode::atleast
void atleast(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:70
Gecode::cos
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:66
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:67
Gecode::neg
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
Definition irt.hpp:52
Gecode::dom
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition dom.cpp:40
Gecode::abs
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:41
Gecode::operator<
bool operator<(const FloatVal &x, const FloatVal &y)
Definition val.hpp:226
Gecode::element
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Definition element.cpp:39
Gecode::inter
SetExpr inter(const SetVarArgs &)
Intersection of set variables.
Definition set-expr.cpp:696
Gecode::operator!
BoolExpr operator!(const BoolExpr &)
Negated Boolean expression.
Definition bool-expr.cpp:600
Gecode::operator^
BoolExpr operator^(const BoolExpr &, const BoolExpr &)
Exclusive-or of Boolean expressions.
Definition bool-expr.cpp:595
Gecode::range
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition aliases.hpp:158
Gecode::roots
void roots(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition aliases.hpp:163
Gecode::sqrt
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition arithmetic.cpp:102
Gecode::values
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:143
Gecode::acos
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:59
Gecode::columns_reflect
SymmetryHandle columns_reflect(const Matrix< A > &m)
Reflect columns symmetry specification.
Definition ldsb.hpp:85
Gecode::operator>
bool operator>(const FloatVal &x, const FloatVal &y)
Definition val.hpp:260
Gecode::operator&&
BoolExpr operator&&(const BoolExpr &, const BoolExpr &)
Conjunction of Boolean expressions.
Definition bool-expr.cpp:587
Gecode::log
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition transcendental.cpp:53
Gecode::operator>=
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition val.hpp:277
Gecode::setdunion
SetExpr setdunion(const SetVarArgs &)
Disjoint union of set variables.
Definition set-expr.cpp:714
Gecode::rows_interchange
SymmetryHandle rows_interchange(const Matrix< A > &m)
Interchangeable rows symmetry specification.
Definition ldsb.hpp:40
Gecode::sum
LinIntExpr sum(const IntVarArgs &x)
Construct linear expression as sum of integer variables.
Definition int-expr.cpp:880
Gecode::exactly
void exactly(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl=IPL_DEF)
Post constraint .
Definition aliases.hpp:101
Gecode::setunion
SetExpr setunion(const SetVarArgs &)
Union of set variables.
Definition set-expr.cpp:705
Gecode::singleton
SetExpr singleton(const LinIntExpr &)
Singleton expression.
Definition set-expr.cpp:691
Gecode::exp
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition transcendental.cpp:45
Gecode::atan
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:73
Gecode::max
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:49
Gecode::operator>>
Archive & operator>>(Archive &e, FloatNumBranch &nl)
Definition val-sel.hpp:44
Gecode::asin
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:45
Gecode::operator|
SetExpr operator|(const SetExpr &, const SetExpr &)
Union of set expressions.
Definition set-expr.cpp:675
Gecode::pow
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Definition arithmetic.cpp:109
Gecode::cardinality
LinIntExpr cardinality(const SetExpr &)
Cardinality of set expression.
Definition set-expr.cpp:817
Gecode::operator*
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition val.hpp:200
Gecode::diagonal_reflect
SymmetryHandle diagonal_reflect(const Matrix< A > &m)
Reflect around main diagonal symmetry specification.
Definition ldsb.hpp:108
Gecode::nroot
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
Definition arithmetic.cpp:118
Gecode::operator==
bool operator==(const FloatVal &x, const FloatVal &y)
Definition val.hpp:294
Gecode::operator%
LinIntExpr operator%(const LinIntExpr &x, const LinIntExpr &y)
Return expression for .
Definition int-arith.cpp:453
Gecode::operator!=
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition val.hpp:317
Gecode::columns_interchange
SymmetryHandle columns_interchange(const Matrix< A > &m)
Interchangeable columns symmetry specification.
Definition ldsb.hpp:51
Gecode::tan
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition trigonometric.cpp:80
optimize.hpp
reg.hpp
set-expr.hpp
set-rel.hpp
GECODE_VTABLE_EXPORT
#define GECODE_VTABLE_EXPORT
Definition support.hh:72