~ubuntu-branches/ubuntu/quantal/ppl/quantal

« back to all changes in this revision

Viewing changes to src/Interval.templates.hh

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-04-21 09:08:39 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110421090839-hiiobptchgzoqiik
Tags: 0.11.2-3ubuntu1
* Merge with Debian; remaining changes:
  - Ignore results running the testsuite on amd64. One failing test.
    See LP: #697305.
  - Disable building the SWI-Prolog bindings as its in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Interval class implementation: non-inline template functions.
2
2
   Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
 
3
   Copyright (C) 2010-2011 BUGSENG srl (http://bugseng.com)
3
4
 
4
5
This file is part of the Parma Polyhedra Library (PPL).
5
6
 
120
121
            x.lower_extend();
121
122
        }
122
123
      }
123
 
      else
124
 
        x_lb = *--k;
 
124
      else {
 
125
        if (k != first)
 
126
          x_lb = *--k;
 
127
        else
 
128
          x.lower_extend();
 
129
      }
125
130
    }
126
131
  }
127
132
}
140
145
  // Get the upper bound.
141
146
  Boundary upper_bound;
142
147
  Result upper_r = assign_r(upper_bound, s, ROUND_UP);
143
 
  assert(upper_r != V_CVT_STR_UNK && upper_r != V_NAN);
 
148
  PPL_ASSERT(upper_r != V_CVT_STR_UNK && upper_r != V_NAN);
144
149
  upper_r = result_relation_class(upper_r);
145
150
 
146
151
  // Buld the interval.
155
160
  case V_GT:
156
161
    lower_open = true;
157
162
    break;
 
163
  case V_GT_MINUS_INFINITY:
 
164
    lower_open = true;
158
165
  case V_EQ_MINUS_INFINITY:
159
 
  case V_GT_MINUS_INFINITY:
160
166
    lower_boundary_infinity = true;
161
167
    break;
162
168
  case V_EQ_PLUS_INFINITY:
183
189
    else
184
190
      assign(EMPTY);
185
191
    break;
 
192
  case V_LT_PLUS_INFINITY:
 
193
    upper_open = true;
186
194
  case V_EQ_PLUS_INFINITY:
187
 
  case V_LT_PLUS_INFINITY:
188
195
    upper_boundary_infinity = true;
189
196
    break;
190
197
  default:
198
205
    assign(EMPTY);
199
206
  else {
200
207
    if (lower_boundary_infinity)
201
 
      special_set_boundary_infinity(LOWER, lower(), info());
 
208
      set_minus_infinity(LOWER, lower(), info(), lower_open);
202
209
    else
203
210
      Boundary_NS::assign(LOWER, lower(), info(),
204
211
                          LOWER, lower_bound, SCALAR_INFO, lower_open);
205
212
    if (upper_boundary_infinity)
206
 
      special_set_boundary_infinity(UPPER, upper(), info());
 
213
      set_plus_infinity(UPPER, upper(), info(), upper_open);
207
214
    else
208
215
      Boundary_NS::assign(UPPER, upper(), info(),
209
216
                          UPPER, upper_bound, SCALAR_INFO, upper_open);
291
298
  case V_GT:
292
299
    lower_open = true;
293
300
    break;
 
301
  case V_GT_MINUS_INFINITY:
 
302
    lower_open = true;
294
303
  case V_EQ_MINUS_INFINITY:
295
 
  case V_GT_MINUS_INFINITY:
296
304
    lower_boundary_infinity = true;
297
305
    break;
298
306
  case V_EQ_PLUS_INFINITY:
312
320
  case V_LT:
313
321
    upper_open = true;
314
322
    break;
 
323
  case V_GT_MINUS_INFINITY:
 
324
    upper_open = true;
315
325
  case V_EQ_MINUS_INFINITY:
316
 
  case V_GT_MINUS_INFINITY:
317
326
    if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY)
318
327
      x.assign(UNIVERSE);
319
328
    else
334
343
    x.assign(EMPTY);
335
344
  else {
336
345
    if (lower_boundary_infinity)
337
 
      special_set_boundary_infinity(LOWER, x.lower(), x.info());
 
346
      set_minus_infinity(LOWER, x.lower(), x.info(), lower_open);
338
347
    else
339
348
      assign(LOWER, x.lower(), x.info(),
340
349
             LOWER, lower_bound, SCALAR_INFO, lower_open);
341
350
    if (upper_boundary_infinity)
342
 
      special_set_boundary_infinity(UPPER, x.upper(), x.info());
 
351
      set_plus_infinity(UPPER, x.upper(), x.info(), upper_open);
343
352
    else
344
353
      assign(UPPER, x.upper(), x.info(),
345
354
             UPPER, upper_bound, SCALAR_INFO, upper_open);