37namespace 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 assert((
a.a > 0) && (
b.a > 0));
83 return (
a.a >
b.a) || ((
a.a ==
b.a) && (
a.p <
b.p));
131 for (
int i=0; i<
n; i++)
148 long long int a =
t[i].a;
151 while ((++i <
n) && (
t[i].
x ==
x)) {
153 p = std::min(
p,
t[i].
p);
157 t[j].a =
static_cast<int>(
a);
t[j].x =
x;
t[j].p =
p; j++;
171 while ((
t[j].
a < 0) && (--j >= 0)) ;
172 while ((
t[i].
a > 0) && (++i <
n)) ;
174 std::swap(
t[i],
t[j]);
177 t_n =
t+n_p; n_n =
n-n_p;
187 for (
int i=0; i<n_n; i++)
188 t_n[i].
a = -t_n[i].
a;
203 if ((
n > 0) && (g > 0)) {
205 for (
int i=1; (g > 1) && (i <
n); i++)
218 for (
int i=0; i<
n; i++)
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Sort linear terms by coefficient size and original position.
bool operator()(const Term< View > &a, const Term< View > &b)
Sort linear terms by view.
bool operator()(const Term< View > &a, const Term< View > &b)
Class for describing linear term .
VarImp * x
Pointer to variable implementation.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
const int min
Smallest allowed integer value.
const int max
Largest allowed integer value.
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
int gcd(int a, int b)
Compute the greatest common divisor of a and b.
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.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Gecode toplevel namespace
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar x