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;
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)) {
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::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int p
Number of positive literals for node type.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@602::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 .
const FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
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.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i({1, 2, 3, 4})