49 LinExpr::Node::Node(
void) : use(1) {
53 LinExpr::Node::~Node(
void) {
57 heap.
free<Int::Linear::Term<Int::IntView> >(
sum.ti,n_int);
61 heap.
free<Int::Linear::Term<Int::BoolView> >(
sum.tb,n_bool);
71 LinExpr::Node::operator
new(
size_t size) {
76 LinExpr::Node::operator
delete(
void* p, size_t) {
96 fill(home,icl,ti,tb,1.0,d);
98 return static_cast<int>(
d);
103 if (home.
failed())
return;
105 if (n->n_bool == 0) {
108 n->r->sum.ne->post(home,irt,-n->c,icl);
117 n->r->sum.ne->post(home,irt,n->c,icl);
122 (void) n->r->sum.ne->post(home,&n->l->x_int,icl);
127 (void) n->l->sum.ne->post(home,&n->r->x_int,icl);
131 int c = n->fill(home,icl,its,NULL);
134 }
else if (n->n_int == 0) {
138 int c = n->fill(home,icl,NULL,bts);
140 }
else if (n->n_bool == 1) {
146 int c = n->fill(home,icl,its,bts);
150 its[n->n_int].
a = bts[0].
a;
158 int c = n->fill(home,icl,its,bts);
162 its[n->n_int].
x = x; its[n->n_int].
a = 1;
171 if (home.
failed())
return;
173 if (n->n_bool == 0) {
176 n->r->sum.ne->post(home,irt,-n->c,b,icl);
185 n->r->sum.ne->post(home,irt,n->c,b,icl);
189 int c = n->fill(home,icl,its,NULL);
192 }
else if (n->n_int == 0) {
196 int c = n->fill(home,icl,NULL,bts);
198 }
else if (n->n_bool == 1) {
204 int c = n->fill(home,icl,its,bts);
208 its[n->n_int].
a = bts[0].
a;
216 int c = n->fill(home,icl,its,bts);
220 its[n->n_int].
x = x; its[n->n_int].
a = 1;
230 if (n->n_bool == 0) {
234 int c = n->fill(home,icl,its,NULL);
235 if ((n->n_int == 1) && (c == 0) && (its[0].
a == 1))
240 its[n->n_int].
x = x; its[n->n_int].
a = -1;
243 }
else if (n->n_int == 0) {
247 int c = n->fill(home,icl,NULL,bts);
253 }
else if (n->n_bool == 1) {
259 int c = n->fill(home,icl,its,bts);
262 its[n->n_int].
x = x; its[n->n_int].
a = bts[0].
a;
265 IntVar y(home, y_min, y_max);
266 its[n->n_int+1].
x = y; its[n->n_int+1].
a = -1;
275 int c = n->fill(home,icl,its,bts);
278 IntVar x(home, x_min, x_max);
280 its[n->n_int].
x = x; its[n->n_int].
a = 1;
283 IntVar y(home, y_min, y_max);
284 its[n->n_int+1].
x = y; its[n->n_int+1].
a = -1;
292 return n->t ==
NT_NONLIN ? n->sum.ne : NULL;