Esempio n. 1
0
	Min2(IntView<U> _x, IntView<U> _y, IntView<U> _z) :
		x(_x), y(_y), z(_z) {
		priority = 1;
		x.attach(this, 0, EVENT_LU);
		y.attach(this, 1, EVENT_LU);
		z.attach(this, 2, EVENT_L);
	}
Esempio n. 2
0
	IntElemDomain(IntView<U> _y, IntView<V> _x, vec<IntView<W> >& _a) :
		y(_y), x(_x), a(_a) {
		num_support = new Tint[y.getMax()-y.getMin()+1] - y.getMin();
		support = new int*[y.getMax()-y.getMin()+1] - y.getMin();
		temp_sup = new int[x.getMax()-x.getMin()+1];

		vec<int> temp;
		for (int v = y.getMin(); v <= y.getMax(); v++) {
			temp.clear();
			if (y.indomain(v)) {
				for (int i = x.getMin(); i <= x.getMax(); i++) {
					if (x.indomain(i) && a[i].indomain(v)) temp.push(i);
				}
			}
			num_support[v] = temp.size();
			support[v] = new int[temp.size()];
			for (int i = 0; i < temp.size(); i++) {
				support[v][i] = temp[i];
			}
		}

		for (int i = 0; i < a.size(); i++) a[i].attach(this, i, EVENT_C);
		y.attach(this, a.size(), EVENT_C);
		x.attach(this, a.size()+1, EVENT_C);
	}
Esempio n. 3
0
	IntElemBounds(IntView<U> _y, IntView<V> _x, vec<IntView<W> >& _a) :
		y(_y), x(_x), a(_a), min_support(-1), max_support(-1), fixed_index(-1),
		no_min_support(false), no_max_support(false) {
		for (int i = 0; i < a.size(); i++) a[i].attach(this, i, EVENT_LU);
		y.attach(this, a.size(), EVENT_LU);
		x.attach(this, a.size()+1, EVENT_C);
	}
Esempio n. 4
0
	Times(IntView<U> _x, IntView<V> _y, IntView<W> _z) :
		x(_x), y(_y), z(_z) {
		priority = 1;
		assert(x.getMin() >= 0 && y.getMin() >= 0 && z.getMin() >= 0);
		x.attach(this, 0, EVENT_LU);
		y.attach(this, 1, EVENT_LU);
		z.attach(this, 2, EVENT_LU);
	}
Esempio n. 5
0
	Minimum(vec<IntView<U> > _x, IntView<U> _y)	:
		sz(_x.size()), x(_x.release()), y(_y), min_max_var(-1), min_max(INT_MAX),
		min_fixed(INT_MAX), lower_change(false) {
		priority = 1;
		for (int i = 0; i < sz; i++) x[i].attach(this, i, EVENT_LU);
		y.attach(this, sz, EVENT_L);
	}
Esempio n. 6
0
	Abs(IntView<U> _x, IntView<V> _y) : x(_x), y(_y) {
		priority = 1;
		x.attach(this, 0, EVENT_LU);
		y.attach(this, 1, EVENT_U);
	}
Esempio n. 7
0
	BinLTInf(IntVar *_x, IntVar *_y, int _k) : x(_x), y(_y), k(_k) {
		x.attach(this, 0, EVENT_L);
		y.attach(this, 1, EVENT_U);
	}