37 namespace Gecode {
namespace Int {
namespace Linear {
42 long long int min =
c;
43 long long int max =
c;
44 for (
int i=0;
i<
n;
i++) {
45 long long int a = t[
i].
a;
47 min += a*t[
i].
x.min();
48 max += a*t[
i].
x.max();
50 max += a*t[
i].
x.min();
51 min += a*t[
i].
x.max();
58 l =
static_cast<int>(
min);
63 u =
static_cast<int>(
max);
82 int t =
b; b = a %
b; a =
t;
133 long long int a = t[
i].a;
135 while ((++i < n) && (t[i].x == x)) {
140 t[j].a =
static_cast<int>(
a); t[j].x =
x; j++;
154 while ((t[j].
a < 0) && (--j >= 0)) ;
155 while ((t[i].
a > 0) && (++i <
n)) ;
160 t_n = t+n_p; n_n = n-n_p;
170 for (
int i=0;
i<n_n;
i++)
171 t_n[
i].
a = -t_n[
i].
a;
177 if ((n > 0) && (g > 0)) {
179 for (
int i=1; (g > 1) && (
i < n);
i++)
192 for (
int i=0;
i<
n;
i++)
Sort linear terms by view.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool normalize(Term< View > *t, int &n, Term< View > *&t_p, int &n_p, Term< View > *&t_n, int &n_n, int &g)
Normalize linear integer constraints.
const int max
Largest allowed integer value.
const int min
Smallest allowed integer value.
Gecode::FloatVal c(-8, 8)
int n
Number of negative literals for node type.
Gecode::IntArgs i({1, 2, 3, 4})
int gcd(int a, int b)
Compute the greatest common divisor of a and b.
VarImp * x
Pointer to variable implementation.
struct Gecode::@593::NNF::@62::@63 b
For binary nodes (and, or, eqv)
union Gecode::@593::NNF::@62 u
Union depending on nodetype t.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
Post propagator for SetVar x
Class for describing linear term .
Gecode toplevel namespace
bool operator()(const Term< View > &a, const Term< View > &b)
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.