big update
glue.cpp
Sun Jan 7 17:49:57 PST 2007 kilian.sprotte@gmail.com
* big update
The API resembles much more the original gecode one.
Added support for finite sets.
Can now use BAB search.
--- old-gecol/glue.cpp 2014-07-22 16:40:11.000000000 -0700
+++ new-gecol/glue.cpp 2014-07-22 16:40:11.000000000 -0700
@@ -33,103 +33,200 @@
using namespace Gecode;
-// TODO avoid using void pointer for Space ?
-
-class Simple : public Space {
+class GecolSpace : public Space {
protected:
- IntVarArray vars;
+ IntVarArray ints;
BoolVarArray bools;
SetVarArray sets;
+ int bab_intvar_ind;
+ IntRelType bab_intreltype;
public:
- Simple(int varnum, int varmin, int varmax,
- int boolnum,
- int setnum) : vars(this, varnum, varmin, varmax),
- bools(this, boolnum, 0, 1),
- sets(this,setnum)
+ GecolSpace(int intnum, int intmin, int intmax,
+ int boolnum,
+ int setnum,
+ int arg_bab_intvar_ind, IntRelType arg_bab_intreltype)
+ : ints(this, intnum, intmin, intmax),
+ bools(this, boolnum, 0, 1),
+ sets(this,setnum),
+ bab_intvar_ind(arg_bab_intvar_ind),
+ bab_intreltype(arg_bab_intreltype)
{
}
- /// Constructor for cloning \a s
- Simple(bool share, Simple& s) : Space(share,s) {
- vars.update(this, share, s.vars);
+ // Constructor for cloning a s
+ GecolSpace(bool share, GecolSpace &s) : Space(share,s) {
+ ints.update(this, share, s.ints);
bools.update(this, share, s.bools);
sets.update(this, share, s.sets);
+ // TODO maybe specialize GecolBABSpace
+ // so we dont always copy these
+ bab_intvar_ind = s.bab_intvar_ind;
+ bab_intreltype = s.bab_intreltype;
}
- /// Copy during cloning
+ // Copy during cloning
virtual Space*
copy(bool share) {
- return new Simple(share,*this);
- }
- // TODO clean this up
- IntVarArray* get_vars () {
- return &vars;
+ return new GecolSpace(share,*this);
}
- IntVarArray get_vars2 () {
- return vars;
+ IntVarArray getInts () {
+ return ints;
}
- BoolVarArray get_bools2 () {
+ BoolVarArray getBools () {
return bools;
}
- SetVarArray get_sets () {
+ SetVarArray getSets () {
return sets;
}
+ // TODO use here the 'more complicated' version
+ // like in gecode examples?
+ void constrain(GecolSpace* latest) {
+ rel(this, this->getInts()[bab_intvar_ind], bab_intreltype, latest->getInts()[bab_intvar_ind]);
+ }
+};
+
+struct lisp_SetVarArgs
+{
+ int size;
+ SetVar** array[];
+};
+
+struct lisp_IntVarArgs
+{
+ int size;
+ IntVar** array[];
+};
+
+struct lisp_BoolVarArgs
+{
+ int size;
+ BoolVar** array[];
+};
+
+struct lisp_IntArgs
+{
+ int size;
+ int* array[];
};
extern "C" {
- void* create_space(int varnum, int varmin, int varmax, int boolnum, int setnum);
- void dispose_space(void* space);
- void* create_search_engine(void* space);
- void dispose_search_engine(void* engine);
- void* search_next(void* engine);
- bool gec_int_assigned(void* space, int x);
- bool gec_bool_assigned(void* space, int x);
- int space_read_int(void* space, int index);
- int space_read_bool(void* space, int index);
- void gec_branch_vars_min(void* space);
- void gec_branch_vars_med(void* space);
- void gec_branch_vars_max(void* space);
-
- void gec_rel_var(void* space, int x, int type, int y, int level);
- void gec_rel_const(void* space, int x, int type, int c, int level);
- void gec_rel_reif(void* space, int x, int type, int y, int b, int level);
- void gec_dom_var(void* space, int x, int min, int max, int level);
- void gec_dom_var_set(void* space, int x, int* d, int n, int level);
- void gec_linear_var(void* space, int res, int type, int* xs, int n, int level);
- void gec_linear_const(void* space, int res, int type, int* xs, int n, int level);
- void gec_distinct(void* space, int* xs, int n, int level);
- void gec_distance(void* space, int res, int a, int b);
- void gec_distance_const(void* space, int res, int a, int b);
- void gec_min(void* space, int res, int a, int b, int level);
- void gec_max(void* space, int res, int a, int b, int level);
- void gec_mult(void* space, int a, int b, int res, int level);
- void gec_minus(void* space, int res, int a, int b, int level);
-
- void gec_bool_eq(void* space, int a, int b, int level);
- void gec_bool_eq_const(void* space, int a, int b, int level);
- void gec_bool_not(void* space, int a, int res, int level);
- void gec_bool_and(void* space, int a, int b, int res, int level);
- void gec_bool_and_const(void* space, int a, int b, int res, int level);
- void gec_bool_or(void* space, int a, int b, int res, int level);
- void gec_bool_or_const(void* space, int a, int b, int res, int level);
- void gec_bool_xor(void* space, int a, int b, int res, int level);
- void gec_bool_xor_const(void* space, int a, int b, int res, int level);
- void gec_bool_imp(void* space, int a, int b, int res, int level);
- void gec_bool_imp_const(void* space, int a, int b, int res, int level);
- void gec_bool_eqv(void* space, int a, int b, int res, int level);
- void gec_bool_eqv_const(void* space, int a, int b, int res, int level);
-
- void gec_element_const(void* space, int* ns, int n, int x0, int x1, int level);
- void gec_element_vars(void* space, int* xs, int n, int x0, int x1, int level);
-
- void gec_mod_12(void* space, int x, int m);
+ // IntSet
+ IntSet *make_IntSet_int_int(int n, int m);
+ IntSet *make_IntSet_intarray_int(const int r[], int n);
+ int IntSet_size(IntSet *intset);
+ int IntSet_min_int(IntSet *intset, int i);
+ int IntSet_max_int(IntSet *intset, int i);
+ unsigned int IntSet_width_int(IntSet *intset, int i);
+ int IntSet_min(IntSet *intset);
+ int IntSet_max(IntSet *intset);
+ void delete_IntSet(IntSet *intset);
+ // IntVar
+ IntVar *make_IntVar_Space_int_int(Space* home, int min, int max);
+ bool IntVar_assigned(IntVar* intvar);
+ int IntVar_val(IntVar* intvar);
+ void delete_IntVar(IntVar *v);
+ // GecolSpace
+ GecolSpace* make_GecolSpace(int intnum, int intmin, int intmax, int boolnum, int setnum,
+ int bab_intvar_ind, IntRelType bab_intreltype);
+ void delete_GecolSpace(GecolSpace* space);
+ IntVar* GecolSpace_getInt_int(GecolSpace* space, int ind);
+ BoolVar* GecolSpace_getBool_int(GecolSpace* space, int ind);
+ SetVar* GecolSpace_getSet_int(GecolSpace* space, int ind);
+ void GecolSpace_putSet_int_SetVar(GecolSpace* space, int ind, SetVar* set);
+ // DFS
+ DFS<GecolSpace>* make_DFS_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st);
+ void delete_DFS(DFS<GecolSpace>* dfs);
+ GecolSpace* DFS_next(DFS<GecolSpace>* dfs);
+ // BAB
+ BAB<GecolSpace>* make_BAB_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st);
+ void delete_BAB(BAB<GecolSpace>* bab);
+ GecolSpace* BAB_next(BAB<GecolSpace>* bab);
+
+ ////////////
+
+ void branch_intvarargs_bvarsel_bvalsel(Space *home, const lisp_IntVarArgs *x, BvarSel vars, BvalSel vals);
+ void linear_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl);
+ void linear_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl);
+ void linear_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl);
+ void linear_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl);
+ void linear_boolvarargs_intreltype_int_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, int c, IntConLevel icl);
+ void linear_boolvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void eq_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl);
+ void eq_intvar_int_intconlevel(Space *home, IntVar *x, int n, IntConLevel icl);
+ void eq_intvar_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, BoolVar *b, IntConLevel icl);
+ void eq_intvar_int_boolvar_intconlevel(Space *home, IntVar *x, int n, BoolVar *b, IntConLevel icl);
+ void eq_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl);
+ void count_intvarargs_int_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, int m, IntConLevel icl);
+ void count_intvarargs_intvar_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, int m, IntConLevel icl);
+ void count_intvarargs_int_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, IntVar *z, IntConLevel icl);
+ void count_intvarargs_intvar_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, IntVar *z, IntConLevel icl);
+ void gcc_intvarargs_intargs_int_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec_low, int unspec_up, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_intargs_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int lb, int ub, IntConLevel icl);
+ void gcc_intvarargs_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int ub, IntConLevel icl);
+ void gcc_intvarargs_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *c, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_intargs_intvarargs_int_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec_low, int unspec_up, bool all, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_intargs_intvarargs_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec, bool all, int min, int max, IntConLevel icl);
+ void channel_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl);
+ void dom_intvar_int_int_intconlevel(Space *home, IntVar *x, int l, int m, IntConLevel icl);
+ void dom_intvarargs_int_int_intconlevel(Space *home, lisp_IntVarArgs *x, int l, int m, IntConLevel icl);
+ void dom_intvar_intset_intconlevel(Space *home, IntVar *x, const IntSet *s, IntConLevel icl);
+ void dom_intvarargs_intset_intconlevel(Space *home, lisp_IntVarArgs *x, const IntSet *s, IntConLevel icl);
+ void dom_intvar_int_int_boolvar_intconlevel(Space *home, IntVar *x, int l, int m, BoolVar *b, IntConLevel icl);
+ void dom_intvar_intset_boolvar_intconlevel(Space *home, IntVar *x, const IntSet *s, BoolVar *b, IntConLevel icl);
+ void bool_not_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl);
+ void bool_eq_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl);
+ void bool_and_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_and_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_and_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl);
+ void bool_and_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl);
+ void bool_or_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_or_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_or_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl);
+ void bool_or_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl);
+ void bool_imp_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_imp_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_eqv_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_eqv_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_xor_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_xor_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void sortedness_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl);
+ void sortedness_intvarargs_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, const lisp_IntVarArgs *z, IntConLevel icl);
+ void distinct_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl);
+ void distinct_intargs_intvarargs_intconlevel(Space *home, const lisp_IntArgs *n, const lisp_IntVarArgs *x, IntConLevel icl);
+ void element_intargs_intvar_intvar_intconlevel(Space *home, const lisp_IntArgs *n, IntVar *x0, IntVar *x1, IntConLevel icl);
+ void element_intvarargs_intvar_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y0, IntVar *y1, IntConLevel icl);
+ void rel_intvar_intreltype_intvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, IntConLevel icl);
+ void rel_intvar_intreltype_int_intconlevel(Space *home, IntVar *x, IntRelType r, int c, IntConLevel icl);
+ void rel_intvar_intreltype_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, BoolVar *b, IntConLevel icl);
+ void rel_intvar_intreltype_int_boolvar_intconlevel(Space *home, IntVar *x, IntRelType r, int c, BoolVar *b, IntConLevel icl);
+ void rel_intvarargs_intreltype_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, const lisp_IntVarArgs *y, IntConLevel icl);
+ void min_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl);
+ void min_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl);
+ void max_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl);
+ void max_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl);
+ void abs_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl);
+ void mult_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl);
+
+
+
// Sets
- void gec_fs_space_put(Simple* space, int ind, SetVar* set);
- SetVar* gec_fs_space_get(Simple* space, int ind);
- SetVar* gec_fs_make_const(Simple* space, int card, int *dom);
- SetVar* gec_fs_make_bounds(Simple* space,
+ SetVar* gec_fs_make_const(GecolSpace* space, int card, int *dom);
+ SetVar* gec_fs_make_bounds(GecolSpace* space,
int lower_card, int *lower_dom,
int upper_card, int *upper_dom);
- SetVar* gec_fs_make_lower_bound(Simple* space, int lower_card, int *lower_dom);
- SetVar* gec_fs_make_upper_bound(Simple* space, int upper_card, int *upper_dom);
+ SetVar* gec_fs_make_lower_bound(GecolSpace* space, int lower_card, int *lower_dom);
+ SetVar* gec_fs_make_upper_bound(GecolSpace* space, int upper_card, int *upper_dom);
unsigned int gec_fs_glb_size(SetVar* set);
unsigned int gec_fs_lub_size(SetVar* set);
unsigned int gec_fs_unknown_size(SetVar* set);
@@ -142,372 +239,889 @@
bool gec_fs_contains(SetVar* set, int x);
bool gec_fs_not_contains(SetVar* set, int x);
bool gec_fs_assigned(SetVar* set);
- void gec_fs_cardinality_const(Simple* space, SetVar* set, unsigned int min, unsigned int max);
- void gec_fs_cardinality(Simple* space, SetVar* set, int x);
- void gec_fs_rel_setvar_setreltype_setvar(Simple* space, SetVar* x, SetRelType r, SetVar* y);
- void gec_fs_rel_intvar_setreltype_setvar(Simple* space, int x, SetRelType r, SetVar* y);
- void gec_fs_rel_setvar_setoptype_setvar_setreltype_setvar(Simple* space, SetVar* x, SetOpType op, SetVar* y, SetRelType r, SetVar* z);
- void gec_fs_min(Simple* space, SetVar* s, int x);
- void gec_fs_max(Simple* space, SetVar* s, int x);
+
+ void atmostOne_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c);
+ void distinct_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c);
+ void min_setvar_intvar(Space *home, SetVar *s, IntVar *x);
+ void max_setvar_intvar(Space *home, SetVar *s, IntVar *x);
+ void match_setvar_intvarargs(Space *home, SetVar *s, const lisp_IntVarArgs *x);
+ void channel_intvarargs_setvarargs(Space *home, const lisp_IntVarArgs *x, const lisp_SetVarArgs *y);
+ void cardinality_setvar_intvar(Space *home, SetVar *s, IntVar *x);
+ void weights_intargs_intargs_setvar_intvar(Space *home, const lisp_IntArgs *elements, const lisp_IntArgs *weights, SetVar *x, IntVar *y);
+ void convex_setvar(Space *home, SetVar *x);
+ void convexHull_setvar_setvar(Space *home, SetVar *x, SetVar *y);
+ void selectUnion_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z);
+ void selectInter_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z);
+ void selectInterIn_setvarargs_setvar_setvar_intset(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z, const IntSet *universe);
+ void selectDisjoint_setvarargs_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y);
+ void selectSet_setvarargs_intvar_setvar(Space *home, const lisp_SetVarArgs *x, IntVar *y, SetVar *z);
+ void rel_setvar_setreltype_setvar(Space *home, SetVar *x, SetRelType r, SetVar *y);
+ void rel_setvar_setreltype_setvar_boolvar(Space *home, SetVar *x, SetRelType r, SetVar *y, BoolVar *b);
+ void rel_setvar_setreltype_intvar(Space *home, SetVar *s, SetRelType r, IntVar *x);
+ void rel_intvar_setreltype_setvar(Space *home, IntVar *x, SetRelType r, SetVar *s);
+ void rel_setvar_setreltype_intvar_boolvar(Space *home, SetVar *s, SetRelType r, IntVar *x, BoolVar *b);
+ void rel_intvar_setreltype_setvar_boolvar(Space *home, IntVar *x, SetRelType r, SetVar *s, BoolVar *b);
+ void rel_setvar_intreltype_intvar(Space *home, SetVar *s, IntRelType r, IntVar *x);
+ void rel_intvar_intreltype_setvar(Space *home, IntVar *x, IntRelType r, SetVar *s);
+ void rel_setvar_setoptype_setvar_setreltype_setvar(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z);
+ void rel_setoptype_setvarargs_setvar(Space *home, SetOpType op, const lisp_SetVarArgs *x, SetVar *y);
+ void rel_setoptype_intvarargs_setvar(Space *home, SetOpType op, const lisp_IntVarArgs *x, SetVar *y);
+ void rel_intset_setoptype_setvar_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z);
+ void rel_setvar_setoptype_intset_setreltype_setvar(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z);
+ void rel_setvar_setoptype_setvar_setreltype_intset(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z);
+ void rel_intset_setoptype_intset_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z);
+ void rel_intset_setoptype_setvar_setreltype_intset(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z);
+ void rel_setvar_setoptype_intset_setreltype_intset(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, const IntSet *z);
+ void sequence_setvarargs(Space *home, const lisp_SetVarArgs *x);
+ void sequentialUnion_setvarargs_setvar(Space *home, const lisp_SetVarArgs *y, SetVar *x);
+ void dom_setvar_setreltype_int(Space *home, SetVar *x, SetRelType r, int i);
+ void dom_setvar_setreltype_int_int(Space *home, SetVar *x, SetRelType r, int i, int j);
+ void dom_setvar_setreltype_intset(Space *home, SetVar *x, SetRelType r, const IntSet *s);
+ void dom_setvar_setreltype_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, BoolVar *b);
+ void dom_setvar_setreltype_int_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, int j, BoolVar *b);
+ void dom_setvar_setreltype_intset_boolvar(Space *home, SetVar *x, SetRelType r, const IntSet *s, BoolVar *b);
+ void cardinality_setvar_unsigned_int_unsigned_int(Space *home, SetVar *x, unsigned int i, unsigned int j);
+
+
}
-void* create_space(int varnum, int varmin, int varmax, int boolnum, int setnum)
+// IntSet
+
+IntSet *make_IntSet_int_int(int n, int m)
{
- Simple* s = new Simple(varnum, varmin, varmax, boolnum, setnum);
- return (void*)s;
+ return new IntSet(n,m);
}
-void dispose_space(void* space)
+IntSet *make_IntSet_intarray_int(const int r[], int n)
{
- delete (Simple*)space;
+ return new IntSet(r,n);
}
-void* create_search_engine(void* space)
+int IntSet_size(IntSet *intset)
{
- Simple* s = (Simple*)space;
- DFS<Simple>* e = new DFS<Simple>(s,1,1);
- return (void*)e;
+ return intset->size();
}
-void dispose_search_engine(void* engine)
+int IntSet_min_int(IntSet *intset, int i)
{
- delete (DFS<Simple>*)engine;
+ return intset->min(i);
}
-void* search_next(void* engine)
+int IntSet_max_int(IntSet *intset, int i)
{
- DFS<Simple>* e = (DFS<Simple>*)engine;
- return (void*)e->next();
+ return intset->max(i);
}
-// TODO ch to get_vars2
-int space_read_int(void* space, int index)
+unsigned int IntSet_width_int(IntSet *intset, int i)
{
- Simple* s = (Simple*)space;
- IntVarArray* array = s->get_vars();
- IntVar x = (*array)[index];
- return x.val();
+ return intset->width(i);
}
-int space_read_bool(void* space, int index)
+int IntSet_min(IntSet *intset)
{
- Simple* s = (Simple*)space;
- BoolVarArray array = s->get_bools2();
- BoolVar x = array[index];
- return x.val();
+ return intset->min();
}
-void gec_branch_vars_min(void* space)
+int IntSet_max(IntSet *intset)
{
- branch((Simple*)space,(*((Simple*)space)->get_vars()),BVAR_NONE,BVAL_MIN);
+ return intset->max();
}
-void gec_branch_vars_med(void* space)
+void delete_IntSet(IntSet *intset)
{
- branch((Simple*)space,(*((Simple*)space)->get_vars()),BVAR_NONE,BVAL_MED);
+ delete intset;
}
-void gec_branch_vars_max(void* space)
+// IntVar
+IntVar *make_IntVar_Space_int_int(Space* home, int min, int max)
{
- branch((Simple*)space,(*((Simple*)space)->get_vars()),BVAR_NONE,BVAL_MAX);
+ return new IntVar(home, min, max);
}
-void gec_rel_var(void* space, int x, int type, int y, int level)
+bool IntVar_assigned(IntVar* intvar)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- rel(s, vars[x], (IntRelType)type, vars[y], (IntConLevel)level);
+ return intvar->assigned();
}
-void gec_rel_const(void* space, int x, int type, int c, int level)
+int IntVar_val(IntVar* intvar)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- rel(s, vars[x], (IntRelType)type, c, (IntConLevel)level);
+ return intvar->val();
}
-void gec_rel_reif(void* space, int x, int type, int y, int b, int level)
+void delete_IntVar(IntVar *v)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- BoolVarArray bools = s->get_bools2();
- rel(s, vars[x], (IntRelType)type, vars[y], bools[b], (IntConLevel)level);
+ delete v;
}
-void gec_dom_var(void* space, int x, int min, int max, int level)
+// GecolSpace
+GecolSpace* make_GecolSpace(int intnum, int intmin, int intmax, int boolnum, int setnum,
+ int bab_intvar_ind, IntRelType bab_intreltype)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- dom(s, vars[x], min, max, (IntConLevel)level);
+ return new GecolSpace(intnum, intmin, intmax, boolnum, setnum,
+ bab_intvar_ind, bab_intreltype);
}
-void gec_dom_var_set(void* space, int x, int* d, int n, int level)
+void delete_GecolSpace(GecolSpace* space)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntSet set(d, n);
- dom(s, vars[x], set, (IntConLevel)level);
+ delete space;
}
-void gec_linear_var(void* space, int res, int type, int* xs, int n, int level)
+// Providing these as if they were GecolSpace methods
+IntVar* GecolSpace_getInt_int(GecolSpace* space, int ind)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- linear(s, a, (IntRelType)type, vars[res], (IntConLevel)level);
+ IntVarArray ints = space->getInts();
+ return &(ints[ind]);
}
-void gec_linear_const(void* space, int res, int type, int* xs, int n, int level)
+BoolVar* GecolSpace_getBool_int(GecolSpace* space, int ind)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- linear(s, a, (IntRelType)type, res, (IntConLevel)level);
+ BoolVarArray bools = space->getBools();
+ return &(bools[ind]);
}
-void gec_distinct(void* space, int* xs, int n, int level)
+SetVar* GecolSpace_getSet_int(GecolSpace* space, int ind)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- distinct(s, a, (IntConLevel)level);
+ SetVarArray sets = space->getSets();
+ return &(sets[ind]);
}
-void gec_distance(void* space, int res, int a, int b)
+void GecolSpace_putSet_int_SetVar(GecolSpace* space, int ind, SetVar* set)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar m;
- m = minus(s, vars[a], vars[b], ICL_DEF);
- abs(s, m, vars[res], ICL_DEF);
+ SetVarArray sets = space->getSets();
+ sets[ind] = *set;
}
-void gec_distance_const(void* space, int res, int a, int b)
+// DFS
+DFS<GecolSpace>* make_DFS_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar m;
- IntVar resvar = IntVar(s, res, res);
- m = minus(s, vars[a], vars[b], ICL_DEF);
- abs(s, m, resvar, ICL_DEF);
+ return new DFS<GecolSpace>(space, c_d, a_d, st);
}
+void delete_DFS(DFS<GecolSpace>* dfs)
+{
+ delete dfs;
+}
-void gec_min(void* space, int res, int a, int b, int level)
+GecolSpace* DFS_next(DFS<GecolSpace>* dfs)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- min(s, vars[a], vars[b], vars[res], (IntConLevel)level);
+ return dfs->next();
}
-void gec_max(void* space, int res, int a, int b, int level)
+// BAB
+BAB<GecolSpace>* make_BAB_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- max(s, vars[a], vars[b], vars[res], (IntConLevel)level);
+ return new BAB<GecolSpace>(space, c_d, a_d, st);
}
-void gec_mult(void* space, int a, int b, int res, int level)
+void delete_BAB(BAB<GecolSpace>* bab)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- mult(s, vars[a], vars[b], vars[res], (IntConLevel)level);
+ delete bab;
}
-void gec_minus(void* space, int res, int a, int b, int level)
-{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar x = vars[a];
- IntVar y = vars[b];
- IntVar z = vars[res];
- dom(s, z, x.min()-y.max(), x.max()-y.min(), (IntConLevel)level);
- Int::Linear::Term ts[3];
- ts[0].a = 1; ts[0].x = x;
- ts[1].a = -1; ts[1].x = y;
- ts[2].a = -1; ts[2].x = z;
- Int::Linear::post(s, ts, 3, IRT_EQ, 0, (IntConLevel)level);
+GecolSpace* BAB_next(BAB<GecolSpace>* bab)
+{
+ return bab->next();
}
-void gec_bool_eq(void* space, int a, int b, int level)
+////////
+
+void branch_intvarargs_bvarsel_bvalsel(Space *home, const lisp_IntVarArgs *x, BvarSel vars, BvalSel vals)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_eq(s, bools[a], bools[b], (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::branch(home, x_IntVarArgs, vars, vals);
}
-void gec_bool_eq_const(void* space, int a, int b, int level)
+void linear_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- rel(s, bools[a], IRT_EQ, b, (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, c, icl);
}
-void gec_bool_not(void* space, int a, int res, int level)
+void linear_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_not(s, bools[a], bools[res], (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, *y, icl);
}
-void gec_bool_and(void* space, int a, int b, int res, int level)
+void linear_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_and(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, c, *b, icl);
}
-void gec_bool_and_const(void* space, int a, int b, int res, int level)
+void linear_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_and(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, *y, *b, icl);
}
-void gec_bool_or(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_or(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, c, icl);
}
-void gec_bool_or_const(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_or(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, *y, icl);
}
-void gec_bool_xor(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_xor(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, c, *b, icl);
}
-void gec_bool_xor_const(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_xor(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, *y, *b, icl);
}
-void gec_bool_imp(void* space, int a, int b, int res, int level)
+void linear_boolvarargs_intreltype_int_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, int c, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_imp(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ BoolVarArgs x_BoolVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_BoolVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_BoolVarArgs, r, c, icl);
}
-void gec_bool_imp_const(void* space, int a, int b, int res, int level)
+void linear_boolvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_imp(s, bools[a], bools[b], res, (IntConLevel)level);
+ BoolVarArgs x_BoolVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_BoolVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_BoolVarArgs, r, *y, icl);
}
-void gec_bool_eqv(void* space, int a, int b, int res, int level)
+void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_eqv(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-void gec_bool_eqv_const(void* space, int a, int b, int res, int level)
+void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_eqv(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-bool gec_int_assigned(void* space, int x)
+void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- return (vars[x]).assigned();
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-bool gec_bool_assigned(void* space, int x)
+void cumulatives_intargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- return (bools[x]).assigned();
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-void gec_element_const(void* space, int* ns, int n, int x0, int x1, int level)
+void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntArgs a = IntArgs(n);
- int i;
- for(i=0;i<n;i++) {
- a[i] = ns[i];
- }
- element(s, a, vars[x0], vars[x1], (IntConLevel)level);
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-void gec_element_vars(void* space, int* xs, int n, int x0, int x1, int level)
+void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- element(s, a, vars[x0], vars[x1], (IntConLevel)level);
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-void gec_mod_12(void* space, int x, int m)
+void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar twelve(s, 12, 12);
- IntVar oct(s, 1, 11);
- IntVar start = minus(s, vars[x], vars[m], ICL_DOM);
- mult(s, oct, twelve, start, ICL_DOM);
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-// Sets
-void gec_fs_space_put(Simple* space, int ind, SetVar* set)
+void cumulatives_intargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- SetVarArray sets = space->get_sets();
- sets[ind] = *set;
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-SetVar* gec_fs_space_get(Simple* space, int ind)
+void eq_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl)
{
- SetVarArray sets = space->get_sets();
- return &(sets[ind]);
+ Gecode::eq(home, *x0, *x1, icl);
+}
+
+void eq_intvar_int_intconlevel(Space *home, IntVar *x, int n, IntConLevel icl)
+{
+ Gecode::eq(home, *x, n, icl);
+}
+
+void eq_intvar_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, BoolVar *b, IntConLevel icl)
+{
+ Gecode::eq(home, *x0, *x1, *b, icl);
+}
+
+void eq_intvar_int_boolvar_intconlevel(Space *home, IntVar *x, int n, BoolVar *b, IntConLevel icl)
+{
+ Gecode::eq(home, *x, n, *b, icl);
+}
+
+void eq_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::eq(home, x_IntVarArgs, icl);
+}
+
+void count_intvarargs_int_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, int m, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, n, r, m, icl);
+}
+
+void count_intvarargs_intvar_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, int m, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, *y, r, m, icl);
+}
+
+void count_intvarargs_int_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, IntVar *z, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, n, r, *z, icl);
+}
+
+void count_intvarargs_intvar_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, IntVar *z, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, *y, r, *z, icl);
+}
+
+void gcc_intvarargs_intargs_int_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec_low, int unspec_up, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs c_IntArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntArgs[i] = (*(c->array))[i];
+ Gecode::gcc(home, x_IntVarArgs, c_IntArgs, m, unspec_low, unspec_up, min, max, icl);
+}
+
+void gcc_intvarargs_intargs_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs c_IntArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntArgs[i] = (*(c->array))[i];
+ Gecode::gcc(home, x_IntVarArgs, c_IntArgs, m, unspec, min, max, icl);
+}
+
+void gcc_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int lb, int ub, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, lb, ub, icl);
+}
+
+void gcc_intvarargs_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int ub, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, ub, icl);
+}
+
+void gcc_intvarargs_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *c, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs c_IntVarArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntVarArgs[i] = *((*(c->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, c_IntVarArgs, min, max, icl);
+}
+
+void gcc_intvarargs_intargs_intvarargs_int_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec_low, int unspec_up, bool all, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs v_IntArgs(v->size);
+ for(int i=0;i<v->size;i++)
+ v_IntArgs[i] = (*(v->array))[i];
+ IntVarArgs c_IntVarArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntVarArgs[i] = *((*(c->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, v_IntArgs, c_IntVarArgs, m, unspec_low, unspec_up, all, min, max, icl);
+}
+
+void gcc_intvarargs_intargs_intvarargs_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec, bool all, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs v_IntArgs(v->size);
+ for(int i=0;i<v->size;i++)
+ v_IntArgs[i] = (*(v->array))[i];
+ IntVarArgs c_IntVarArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntVarArgs[i] = *((*(c->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, v_IntArgs, c_IntVarArgs, m, unspec, all, min, max, icl);
+}
+
+void channel_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ Gecode::channel(home, x_IntVarArgs, y_IntVarArgs, icl);
+}
+
+void dom_intvar_int_int_intconlevel(Space *home, IntVar *x, int l, int m, IntConLevel icl)
+{
+ Gecode::dom(home, *x, l, m, icl);
+}
+
+void dom_intvarargs_int_int_intconlevel(Space *home, lisp_IntVarArgs *x, int l, int m, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::dom(home, x_IntVarArgs, l, m, icl);
+}
+
+void dom_intvar_intset_intconlevel(Space *home, IntVar *x, const IntSet *s, IntConLevel icl)
+{
+ Gecode::dom(home, *x, *s, icl);
+}
+
+void dom_intvarargs_intset_intconlevel(Space *home, lisp_IntVarArgs *x, const IntSet *s, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::dom(home, x_IntVarArgs, *s, icl);
+}
+
+void dom_intvar_int_int_boolvar_intconlevel(Space *home, IntVar *x, int l, int m, BoolVar *b, IntConLevel icl)
+{
+ Gecode::dom(home, *x, l, m, *b, icl);
+}
+
+void dom_intvar_intset_boolvar_intconlevel(Space *home, IntVar *x, const IntSet *s, BoolVar *b, IntConLevel icl)
+{
+ Gecode::dom(home, *x, *s, *b, icl);
+}
+
+void bool_not_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl)
+{
+ Gecode::bool_not(home, *b0, *b1, icl);
+}
+
+void bool_eq_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl)
+{
+ Gecode::bool_eq(home, *b0, *b1, icl);
+}
+
+void bool_and_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_and(home, *b0, *b1, *b2, icl);
+}
+
+void bool_and_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_and(home, *b0, *b1, b2, icl);
+}
+
+void bool_and_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_and(home, b_BoolVarArgs, *c, icl);
+}
+
+void bool_and_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_and(home, b_BoolVarArgs, c, icl);
+}
+
+void bool_or_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_or(home, *b0, *b1, *b2, icl);
+}
+
+void bool_or_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_or(home, *b0, *b1, b2, icl);
+}
+
+void bool_or_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_or(home, b_BoolVarArgs, *c, icl);
+}
+
+void bool_or_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_or(home, b_BoolVarArgs, c, icl);
+}
+
+void bool_imp_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_imp(home, *b0, *b1, *b2, icl);
+}
+
+void bool_imp_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_imp(home, *b0, *b1, b2, icl);
+}
+
+void bool_eqv_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_eqv(home, *b0, *b1, *b2, icl);
+}
+
+void bool_eqv_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_eqv(home, *b0, *b1, b2, icl);
+}
+
+void bool_xor_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_xor(home, *b0, *b1, *b2, icl);
+}
+
+void bool_xor_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_xor(home, *b0, *b1, b2, icl);
+}
+
+void sortedness_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ Gecode::sortedness(home, x_IntVarArgs, y_IntVarArgs, icl);
+}
+
+void sortedness_intvarargs_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, const lisp_IntVarArgs *z, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ IntVarArgs z_IntVarArgs(z->size);
+ for(int i=0;i<z->size;i++)
+ z_IntVarArgs[i] = *((*(z->array))[i]);
+ Gecode::sortedness(home, x_IntVarArgs, y_IntVarArgs, z_IntVarArgs, icl);
+}
+
+void distinct_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::distinct(home, x_IntVarArgs, icl);
+}
+
+void distinct_intargs_intvarargs_intconlevel(Space *home, const lisp_IntArgs *n, const lisp_IntVarArgs *x, IntConLevel icl)
+{
+ IntArgs n_IntArgs(n->size);
+ for(int i=0;i<n->size;i++)
+ n_IntArgs[i] = (*(n->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::distinct(home, n_IntArgs, x_IntVarArgs, icl);
}
-SetVar* gec_fs_make_const(Simple* space, int card, int *dom)
+void element_intargs_intvar_intvar_intconlevel(Space *home, const lisp_IntArgs *n, IntVar *x0, IntVar *x1, IntConLevel icl)
+{
+ IntArgs n_IntArgs(n->size);
+ for(int i=0;i<n->size;i++)
+ n_IntArgs[i] = (*(n->array))[i];
+ Gecode::element(home, n_IntArgs, *x0, *x1, icl);
+}
+
+void element_intvarargs_intvar_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y0, IntVar *y1, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::element(home, x_IntVarArgs, *y0, *y1, icl);
+}
+
+void rel_intvar_intreltype_intvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, IntConLevel icl)
+{
+ Gecode::rel(home, *x0, r, *x1, icl);
+}
+
+void rel_intvar_intreltype_int_intconlevel(Space *home, IntVar *x, IntRelType r, int c, IntConLevel icl)
+{
+ Gecode::rel(home, *x, r, c, icl);
+}
+
+void rel_intvar_intreltype_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, BoolVar *b, IntConLevel icl)
+{
+ Gecode::rel(home, *x0, r, *x1, *b, icl);
+}
+
+void rel_intvar_intreltype_int_boolvar_intconlevel(Space *home, IntVar *x, IntRelType r, int c, BoolVar *b, IntConLevel icl)
+{
+ Gecode::rel(home, *x, r, c, *b, icl);
+}
+
+void rel_intvarargs_intreltype_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, const lisp_IntVarArgs *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ Gecode::rel(home, x_IntVarArgs, r, y_IntVarArgs, icl);
+}
+
+void min_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl)
+{
+ Gecode::min(home, *x0, *x1, *x2, icl);
+}
+
+void min_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::min(home, x_IntVarArgs, *y, icl);
+}
+
+void max_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl)
+{
+ Gecode::max(home, *x0, *x1, *x2, icl);
+}
+
+void max_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::max(home, x_IntVarArgs, *y, icl);
+}
+
+void abs_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl)
+{
+ Gecode::abs(home, *x0, *x1, icl);
+}
+
+void mult_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl)
+{
+ Gecode::mult(home, *x0, *x1, *x2, icl);
+}
+
+
+
+// Sets
+SetVar* gec_fs_make_const(GecolSpace* space, int card, int *dom)
{
IntSet d(dom, card);
return new SetVar(space, d, d);
}
-SetVar* gec_fs_make_bounds(Simple* space,
+SetVar* gec_fs_make_bounds(GecolSpace* space,
int lower_card, int *lower_dom,
int upper_card, int *upper_dom)
{
@@ -516,14 +1130,14 @@
return new SetVar(space, ld, ud);
}
-SetVar* gec_fs_make_lower_bound(Simple* space,
+SetVar* gec_fs_make_lower_bound(GecolSpace* space,
int lower_card, int *lower_dom)
{
IntSet ld(lower_dom, lower_card);
return new SetVar(space, ld, IntSet::empty);
}
-SetVar* gec_fs_make_upper_bound(Simple* space,
+SetVar* gec_fs_make_upper_bound(GecolSpace* space,
int upper_card, int *upper_dom)
{
IntSet ud(upper_dom, upper_card);
@@ -590,46 +1204,258 @@
return set->assigned();
}
-void gec_fs_cardinality_const(Simple* space, SetVar* set, unsigned int min, unsigned int max)
+//////
+
+void atmostOne_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::atmostOne(home, x_SetVarArgs, c);
+}
+
+void distinct_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::distinct(home, x_SetVarArgs, c);
+}
+
+void min_setvar_intvar(Space *home, SetVar *s, IntVar *x)
+{
+ Gecode::min(home, *s, *x);
+}
+
+void max_setvar_intvar(Space *home, SetVar *s, IntVar *x)
+{
+ Gecode::max(home, *s, *x);
+}
+
+void match_setvar_intvarargs(Space *home, SetVar *s, const lisp_IntVarArgs *x)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::match(home, *s, x_IntVarArgs);
+}
+
+void channel_intvarargs_setvarargs(Space *home, const lisp_IntVarArgs *x, const lisp_SetVarArgs *y)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ SetVarArgs y_SetVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_SetVarArgs[i] = *((*(y->array))[i]);
+ Gecode::channel(home, x_IntVarArgs, y_SetVarArgs);
+}
+
+void cardinality_setvar_intvar(Space *home, SetVar *s, IntVar *x)
+{
+ Gecode::cardinality(home, *s, *x);
+}
+
+void weights_intargs_intargs_setvar_intvar(Space *home, const lisp_IntArgs *elements, const lisp_IntArgs *weights, SetVar *x, IntVar *y)
+{
+ IntArgs elements_IntArgs(elements->size);
+ for(int i=0;i<elements->size;i++)
+ elements_IntArgs[i] = (*(elements->array))[i];
+ IntArgs weights_IntArgs(weights->size);
+ for(int i=0;i<weights->size;i++)
+ weights_IntArgs[i] = (*(weights->array))[i];
+ Gecode::weights(home, elements_IntArgs, weights_IntArgs, *x, *y);
+}
+
+void convex_setvar(Space *home, SetVar *x)
{
- cardinality(space, *set, min, max);
+ Gecode::convex(home, *x);
}
-void gec_fs_cardinality(Simple* space, SetVar* set, int x)
+void convexHull_setvar_setvar(Space *home, SetVar *x, SetVar *y)
{
- IntVarArray vars = space->get_vars2();
- cardinality(space, *set, vars[x]);
+ Gecode::convexHull(home, *x, *y);
}
-void gec_fs_rel_setvar_setreltype_setvar(Simple* space, SetVar* x, SetRelType r, SetVar* y)
+void selectUnion_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z)
{
- rel(space, *x, r, *y);
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectUnion(home, x_SetVarArgs, *y, *z);
}
-void gec_fs_rel_intvar_setreltype_setvar(Simple* space, int x, SetRelType r, SetVar* y)
+void selectInter_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z)
{
- IntVarArray vars = space->get_vars2();
- rel(space, vars[x], r, *y);
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectInter(home, x_SetVarArgs, *y, *z);
}
-// TODO ...
+void selectInterIn_setvarargs_setvar_setvar_intset(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z, const IntSet *universe)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectInterIn(home, x_SetVarArgs, *y, *z, *universe);
+}
+
+void selectDisjoint_setvarargs_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectDisjoint(home, x_SetVarArgs, *y);
+}
+
+void selectSet_setvarargs_intvar_setvar(Space *home, const lisp_SetVarArgs *x, IntVar *y, SetVar *z)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectSet(home, x_SetVarArgs, *y, *z);
+}
+
+void rel_setvar_setreltype_setvar(Space *home, SetVar *x, SetRelType r, SetVar *y)
+{
+ Gecode::rel(home, *x, r, *y);
+}
+
+void rel_setvar_setreltype_setvar_boolvar(Space *home, SetVar *x, SetRelType r, SetVar *y, BoolVar *b)
+{
+ Gecode::rel(home, *x, r, *y, *b);
+}
+
+void rel_setvar_setreltype_intvar(Space *home, SetVar *s, SetRelType r, IntVar *x)
+{
+ Gecode::rel(home, *s, r, *x);
+}
-// operation/relation
-void gec_fs_rel_setvar_setoptype_setvar_setreltype_setvar(Simple* space, SetVar* x, SetOpType op, SetVar* y, SetRelType r, SetVar* z)
+void rel_intvar_setreltype_setvar(Space *home, IntVar *x, SetRelType r, SetVar *s)
{
- rel(space, *x, op, *y, r, *z);
+ Gecode::rel(home, *x, r, *s);
}
-// TODO ...
+void rel_setvar_setreltype_intvar_boolvar(Space *home, SetVar *s, SetRelType r, IntVar *x, BoolVar *b)
+{
+ Gecode::rel(home, *s, r, *x, *b);
+}
-void gec_fs_min(Simple* space, SetVar* s, int x)
+void rel_intvar_setreltype_setvar_boolvar(Space *home, IntVar *x, SetRelType r, SetVar *s, BoolVar *b)
{
- IntVarArray vars = space->get_vars2();
- min(space, *s, vars[x]);
+ Gecode::rel(home, *x, r, *s, *b);
}
-void gec_fs_max(Simple* space, SetVar* s, int x)
+void rel_setvar_intreltype_intvar(Space *home, SetVar *s, IntRelType r, IntVar *x)
{
- IntVarArray vars = space->get_vars2();
- max(space, *s, vars[x]);
+ Gecode::rel(home, *s, r, *x);
}
+
+void rel_intvar_intreltype_setvar(Space *home, IntVar *x, IntRelType r, SetVar *s)
+{
+ Gecode::rel(home, *x, r, *s);
+}
+
+void rel_setvar_setoptype_setvar_setreltype_setvar(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setoptype_setvarargs_setvar(Space *home, SetOpType op, const lisp_SetVarArgs *x, SetVar *y)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::rel(home, op, x_SetVarArgs, *y);
+}
+
+void rel_setoptype_intvarargs_setvar(Space *home, SetOpType op, const lisp_IntVarArgs *x, SetVar *y)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::rel(home, op, x_IntVarArgs, *y);
+}
+
+void rel_intset_setoptype_setvar_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setvar_setoptype_intset_setreltype_setvar(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setvar_setoptype_setvar_setreltype_intset(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_intset_setoptype_intset_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_intset_setoptype_setvar_setreltype_intset(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setvar_setoptype_intset_setreltype_intset(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, const IntSet *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void sequence_setvarargs(Space *home, const lisp_SetVarArgs *x)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::sequence(home, x_SetVarArgs);
+}
+
+void sequentialUnion_setvarargs_setvar(Space *home, const lisp_SetVarArgs *y, SetVar *x)
+{
+ SetVarArgs y_SetVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_SetVarArgs[i] = *((*(y->array))[i]);
+ Gecode::sequentialUnion(home, y_SetVarArgs, *x);
+}
+
+void dom_setvar_setreltype_int(Space *home, SetVar *x, SetRelType r, int i)
+{
+ Gecode::dom(home, *x, r, i);
+}
+
+void dom_setvar_setreltype_int_int(Space *home, SetVar *x, SetRelType r, int i, int j)
+{
+ Gecode::dom(home, *x, r, i, j);
+}
+
+void dom_setvar_setreltype_intset(Space *home, SetVar *x, SetRelType r, const IntSet *s)
+{
+ Gecode::dom(home, *x, r, *s);
+}
+
+void dom_setvar_setreltype_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, BoolVar *b)
+{
+ Gecode::dom(home, *x, r, i, *b);
+}
+
+void dom_setvar_setreltype_int_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, int j, BoolVar *b)
+{
+ Gecode::dom(home, *x, r, i, j, *b);
+}
+
+void dom_setvar_setreltype_intset_boolvar(Space *home, SetVar *x, SetRelType r, const IntSet *s, BoolVar *b)
+{
+ Gecode::dom(home, *x, r, *s, *b);
+}
+
+void cardinality_setvar_unsigned_int_unsigned_int(Space *home, SetVar *x, unsigned int i, unsigned int j)
+{
+ Gecode::cardinality(home, *x, i, j);
+}
+