PPL  1.2
Parma_Polyhedra_Library::Boundary_NS Namespace Reference

Classes

struct  Property
 

Enumerations

enum  Boundary_Type { LOWER = ROUND_DOWN, UPPER = ROUND_UP }
 

Functions

Rounding_Dir round_dir_check (Boundary_Type t, bool check=false)
 
template<typename T , typename Info >
Result special_set_boundary_infinity (Boundary_Type type, T &, Info &info)
 
template<typename T , typename Info >
bool special_is_open (Boundary_Type, const T &, const Info &)
 
template<typename T , typename Info >
bool normal_is_open (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool is_open (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
Result set_unbounded (Boundary_Type type, T &x, Info &info)
 
template<typename T , typename Info >
Result set_minus_infinity (Boundary_Type type, T &x, Info &info, bool open=false)
 
template<typename T , typename Info >
Result set_plus_infinity (Boundary_Type type, T &x, Info &info, bool open=false)
 
template<typename T , typename Info >
Result set_boundary_infinity (Boundary_Type type, T &x, Info &info, bool open=false)
 
template<typename T , typename Info >
bool is_domain_inf (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool is_domain_sup (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool normal_is_boundary_infinity (Boundary_Type type, const T &x, const Info &)
 
template<typename T , typename Info >
bool is_boundary_infinity (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool normal_is_reverse_infinity (Boundary_Type type, const T &x, const Info &)
 
template<typename T , typename Info >
bool is_minus_infinity (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool is_plus_infinity (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool is_reverse_infinity (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
int infinity_sign (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
bool is_boundary_infinity_closed (Boundary_Type type, const T &x, const Info &info)
 
template<typename Info >
bool boundary_infinity_is_open (Boundary_Type type, const Info &info)
 
template<typename T , typename Info >
int sgn_b (Boundary_Type type, const T &x, const Info &info)
 
template<typename T , typename Info >
int sgn (Boundary_Type type, const T &x, const Info &info)
 
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool eq (Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool lt (Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool gt (Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool le (Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool ge (Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename T , typename Info >
Result adjust_boundary (Boundary_Type type, T &x, Info &info, bool open, Result r)
 
template<typename To , typename To_Info , typename T , typename Info >
Result complement (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info)
 
template<typename To , typename To_Info , typename T , typename Info >
Result assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, bool should_shrink=false)
 
template<typename To , typename To_Info , typename T , typename Info >
Result min_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result min_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename To , typename To_Info , typename T , typename Info >
Result max_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result max_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename To , typename To_Info , typename T , typename Info >
Result neg_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result add_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result sub_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result mul_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename To , typename To_Info >
Result set_zero (Boundary_Type to_type, To &to, To_Info &to_info, bool should_shrink)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result mul_assign_z (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, int x1s, Boundary_Type type2, const T2 &x2, const Info2 &info2, int x2s)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result div_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
 
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result div_assign_z (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, int x1s, Boundary_Type type2, const T2 &x2, const Info2 &info2, int x2s)
 
template<typename To , typename To_Info , typename T , typename Info >
Result umod_2exp_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, unsigned int exp)
 
template<typename To , typename To_Info , typename T , typename Info >
Result smod_2exp_assign (Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, unsigned int exp)
 

Variables

static const Property SPECIAL (Property::SPECIAL_)
 
static const Property OPEN (Property::OPEN_)
 

Enumeration Type Documentation

Function Documentation

template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::add_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 614 of file Boundary_defs.hh.

References adjust_boundary(), boundary_infinity_is_open(), is_boundary_infinity(), is_boundary_infinity_closed(), normal_is_open(), round_dir_check(), and set_boundary_infinity().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator+=().

616  {
617  PPL_ASSERT(type1 == type2);
618  bool should_shrink;
619  if (is_boundary_infinity(type1, x1, info1)) {
620  should_shrink = (boundary_infinity_is_open(type1, info1)
621  && !is_boundary_infinity_closed(type2, x2, info2));
622  return set_boundary_infinity(to_type, to, to_info, should_shrink);
623  }
624  else if (is_boundary_infinity(type2, x2, info2)) {
625  should_shrink = (boundary_infinity_is_open(type2, info2)
626  && !is_boundary_infinity_closed(type1, x1, info1));
627  return set_boundary_infinity(to_type, to, to_info, should_shrink);
628  }
629  should_shrink = (normal_is_open(type1, x1, info1)
630  || normal_is_open(type2, x2, info2));
631  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
632  // FIXME: extended handling is not needed
633  Result r = add_assign_r(to, x1, x2, round_dir_check(to_type, check));
634  return adjust_boundary(to_type, to, to_info, should_shrink, r);
635 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
bool boundary_infinity_is_open(Boundary_Type type, const Info &info)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool is_boundary_infinity_closed(Boundary_Type type, const T &x, const Info &info)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::adjust_boundary ( Boundary_Type  type,
T &  x,
Info &  info,
bool  open,
Result  r 
)
inline

Definition at line 451 of file Boundary_defs.hh.

References LOWER, OPEN, Parma_Polyhedra_Library::result_relation_class(), special_set_boundary_infinity(), Parma_Polyhedra_Library::V_EQ, Parma_Polyhedra_Library::V_EQ_MINUS_INFINITY, Parma_Polyhedra_Library::V_EQ_PLUS_INFINITY, Parma_Polyhedra_Library::V_GE, Parma_Polyhedra_Library::V_GT, Parma_Polyhedra_Library::V_GT_MINUS_INFINITY, Parma_Polyhedra_Library::V_LE, Parma_Polyhedra_Library::V_LT, Parma_Polyhedra_Library::V_LT_PLUS_INFINITY, and Parma_Polyhedra_Library::V_NAN.

Referenced by add_assign(), assign(), complement(), div_assign(), mul_assign(), neg_assign(), set_zero(), smod_2exp_assign(), sub_assign(), and umod_2exp_assign().

452  {
453  r = result_relation_class(r);
454  if (type == LOWER) {
455  switch (r) {
456  case V_GT_MINUS_INFINITY:
457  open = true;
458  /* Fall through */
459  case V_EQ_MINUS_INFINITY:
460  if (!Info::store_special) {
461  return r;
462  }
463  if (open) {
464  info.set_boundary_property(type, OPEN);
465  }
466  return special_set_boundary_infinity(type, x, info);
467  case V_GT:
468  open = true;
469  /* Fall through */
470  case V_GE:
471  case V_EQ:
472  if (open) {
473  info.set_boundary_property(type, OPEN);
474  }
475  return r;
476  default:
477  PPL_UNREACHABLE;
478  return V_NAN;
479  }
480  }
481  else {
482  switch (r) {
483  case V_LT_PLUS_INFINITY:
484  open = true;
485  /* Fall through */
486  case V_EQ_PLUS_INFINITY:
487  if (!Info::store_special) {
488  return r;
489  }
490  if (open) {
491  info.set_boundary_property(type, OPEN);
492  }
493  return special_set_boundary_infinity(type, x, info);
494  case V_LT:
495  open = true;
496  /* Fall through */
497  case V_LE:
498  case V_EQ:
499  if (open) {
500  info.set_boundary_property(type, OPEN);
501  }
502  return r;
503  default:
504  PPL_UNREACHABLE;
505  return V_NAN;
506  }
507  }
508 }
The computed result is exact.
Definition: Result_defs.hh:81
A positive integer overflow occurred (rounding up).
Definition: Result_defs.hh:111
Result special_set_boundary_infinity(Boundary_Type type, T &, Info &info)
static const Property OPEN(Property::OPEN_)
Not a number result.
Definition: Result_defs.hh:123
The computed result is inexact and rounded down.
Definition: Result_defs.hh:87
Result result_relation_class(Result r)
The computed result may be inexact and rounded up.
Definition: Result_defs.hh:93
The computed result may be inexact and rounded down.
Definition: Result_defs.hh:96
A negative integer overflow occurred (rounding down).
Definition: Result_defs.hh:114
The computed result is inexact and rounded up.
Definition: Result_defs.hh:84
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info,
bool  should_shrink = false 
)
inline

Definition at line 533 of file Boundary_defs.hh.

References adjust_boundary(), Parma_Polyhedra_Library::assign_r(), normal_is_open(), round_dir_check(), set_boundary_infinity(), SPECIAL, and special_is_open().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), Parma_Polyhedra_Library::Scalar_Products::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::build(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::empty_intersection_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), max_assign(), min_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::operator=(), Parma_Polyhedra_Library::operator>>(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::MIP_Problem::steepest_edge_float_entering_index(), Parma_Polyhedra_Library::Interval< Boundary, Info >::sub_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().

535  {
536  PPL_ASSERT(to_type == type);
537  if (info.get_boundary_property(type, SPECIAL)) {
538  should_shrink = (should_shrink || special_is_open(type, x, info));
539  return set_boundary_infinity(to_type, to, to_info, should_shrink);
540  }
541  should_shrink = (should_shrink || normal_is_open(type, x, info));
542  const bool check
543  = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
544  const Result r = assign_r(to, x, round_dir_check(to_type, check));
545  return adjust_boundary(to_type, to, to_info, should_shrink, r);
546 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
static const Property SPECIAL(Property::SPECIAL_)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool special_is_open(Boundary_Type, const T &, const Info &)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::boundary_infinity_is_open ( Boundary_Type  type,
const Info &  info 
)
inline

Definition at line 330 of file Boundary_defs.hh.

References OPEN.

Referenced by add_assign(), div_assign(), mul_assign(), smod_2exp_assign(), sub_assign(), and umod_2exp_assign().

330  {
331  return !Info::may_contain_infinity
332  || info.get_boundary_property(type, OPEN);
333 }
static const Property OPEN(Property::OPEN_)
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::complement ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 512 of file Boundary_defs.hh.

References adjust_boundary(), Parma_Polyhedra_Library::assign_r(), LOWER, normal_is_open(), round_dir_check(), set_minus_infinity(), set_plus_infinity(), SPECIAL, and special_is_open().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign().

513  {
514  PPL_ASSERT(to_type != type);
515  bool should_shrink;
516  if (info.get_boundary_property(type, SPECIAL)) {
517  should_shrink = !special_is_open(type, x, info);
518  if (type == LOWER) {
519  return set_minus_infinity(to_type, to, to_info, should_shrink);
520  }
521  else {
522  return set_plus_infinity(to_type, to, to_info, should_shrink);
523  }
524  }
525  should_shrink = !normal_is_open(type, x, info);
526  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
527  Result r = assign_r(to, x, round_dir_check(to_type, check));
528  return adjust_boundary(to_type, to, to_info, should_shrink, r);
529 }
Result set_minus_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
Result set_plus_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
static const Property SPECIAL(Property::SPECIAL_)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool special_is_open(Boundary_Type, const T &, const Info &)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::div_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 720 of file Boundary_defs.hh.

References adjust_boundary(), boundary_infinity_is_open(), is_boundary_infinity(), normal_is_open(), round_dir_check(), set_boundary_infinity(), and set_zero().

Referenced by div_assign_z(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator/=().

722  {
723  bool should_shrink;
724  if (is_boundary_infinity(type1, x1, info1)) {
725  should_shrink = boundary_infinity_is_open(type1, info1);
726  return set_boundary_infinity(to_type, to, to_info, should_shrink);
727  }
728  else if (is_boundary_infinity(type2, x2, info2)) {
729  should_shrink = boundary_infinity_is_open(type2, info2);
730  return set_zero(to_type, to, to_info, should_shrink);
731  }
732  should_shrink = (normal_is_open(type1, x1, info1)
733  || normal_is_open(type2, x2, info2));
734  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
735  PPL_ASSERT(x1 != Constant<0>::value && x2 != Constant<0>::value);
736  // FIXME: extended handling is not needed
737  Result r = div_assign_r(to, x1, x2, round_dir_check(to_type, check));
738  return adjust_boundary(to_type, to, to_info, should_shrink, r);
739 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
Result set_zero(Boundary_Type to_type, To &to, To_Info &to_info, bool should_shrink)
Coefficient value
Definition: PIP_Tree.cc:618
bool boundary_infinity_is_open(Boundary_Type type, const Info &info)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::div_assign_z ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
int  x1s,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2,
int  x2s 
)
inline

Definition at line 744 of file Boundary_defs.hh.

References div_assign(), is_boundary_infinity_closed(), OPEN, set_boundary_infinity(), and set_zero().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign().

746  {
747  if (x1s != 0) {
748  if (x2s != 0) {
749  return div_assign(to_type, to, to_info,
750  type1, x1, info1,
751  type2, x2, info2);
752  }
753  else {
754  return set_boundary_infinity(to_type, to, to_info, true);
755  }
756  }
757  else {
758  bool should_shrink = info1.get_boundary_property(type1, OPEN)
759  && !is_boundary_infinity_closed(type2, x2, info2);
760  return set_zero(to_type, to, to_info, should_shrink);
761  }
762 }
Result set_zero(Boundary_Type to_type, To &to, To_Info &to_info, bool should_shrink)
static const Property OPEN(Property::OPEN_)
Result div_assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
bool is_boundary_infinity_closed(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool Parma_Polyhedra_Library::Boundary_NS::eq ( Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 362 of file Boundary_defs.hh.

References is_minus_infinity(), is_open(), and is_plus_infinity().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::can_be_exactly_joined_to(), Parma_Polyhedra_Library::I_Constraint_Common< I_Constraint< T, Val_Or_Ref_Criteria, extended > >::convert_real(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton(), Parma_Polyhedra_Library::operator==(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal().

363  {
364  if (type1 == type2) {
365  if (is_open(type1, x1, info1)
366  != is_open(type2, x2, info2)) {
367  return false;
368  }
369  }
370  else if (is_open(type1, x1, info1)
371  || is_open(type2, x2, info2)) {
372  return false;
373  }
374  if (is_minus_infinity(type1, x1, info1)) {
375  return is_minus_infinity(type2, x2, info2);
376  }
377  else if (is_plus_infinity(type1, x1, info1)) {
378  return is_plus_infinity(type2, x2, info2);
379  }
380  else if (is_minus_infinity(type2, x2, info2)
381  || is_plus_infinity(type2, x2, info2)) {
382  return false;
383  }
384  else {
385  return equal(x1, x2);
386  }
387 }
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type equal(const T1 &x, const T2 &y)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_minus_infinity(const T &x)
bool is_open(Boundary_Type type, const T &x, const Info &info)
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool Parma_Polyhedra_Library::Boundary_NS::ge ( Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline
template<typename T , typename Info >
int Parma_Polyhedra_Library::Boundary_NS::infinity_sign ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 308 of file Boundary_defs.hh.

References is_boundary_infinity(), is_reverse_infinity(), LOWER, and UPPER.

308  {
309  if (is_boundary_infinity(type, x, info)) {
310  return (type == LOWER) ? -1 : 1;
311  }
312  else if (is_reverse_infinity(type, x, info)) {
313  return (type == UPPER) ? -1 : 1;
314  }
315  else {
316  return 0;
317  }
318 }
bool is_reverse_infinity(Boundary_Type type, const T &x, const Info &info)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_boundary_infinity ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 245 of file Boundary_defs.hh.

References normal_is_boundary_infinity(), and SPECIAL.

Referenced by add_assign(), div_assign(), infinity_sign(), is_boundary_infinity_closed(), is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), mul_assign(), smod_2exp_assign(), sub_assign(), umod_2exp_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity().

245  {
246  if (Info::store_special) {
247  return info.get_boundary_property(type, SPECIAL);
248  }
249  else {
250  return normal_is_boundary_infinity(type, x, info);
251  }
252 }
bool normal_is_boundary_infinity(Boundary_Type type, const T &x, const Info &)
static const Property SPECIAL(Property::SPECIAL_)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_boundary_infinity_closed ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 322 of file Boundary_defs.hh.

References is_boundary_infinity(), and OPEN.

Referenced by add_assign(), div_assign_z(), mul_assign(), and sub_assign().

322  {
323  return Info::may_contain_infinity
324  && !info.get_boundary_property(type, OPEN)
325  && is_boundary_infinity(type, x, info);
326 }
static const Property OPEN(Property::OPEN_)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_domain_inf ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 197 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::is_minus_infinity(), LOWER, and SPECIAL.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_domain_inf().

197  {
198  if (Info::store_special && type == LOWER) {
199  return info.get_boundary_property(type, SPECIAL);
200  }
201  else if (std::numeric_limits<T>::has_infinity) {
203  }
204  else if (std::numeric_limits<T>::is_bounded) {
205  return x == std::numeric_limits<T>::min();
206  }
207  else {
208  return false;
209  }
210 }
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_minus_infinity(const T &x)
static const Property SPECIAL(Property::SPECIAL_)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_domain_sup ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 214 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::is_plus_infinity(), SPECIAL, and UPPER.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_domain_sup().

214  {
215  if (Info::store_special && type == UPPER) {
216  return info.get_boundary_property(type, SPECIAL);
217  }
218  else if (std::numeric_limits<T>::has_infinity) {
220  }
221  else if (std::numeric_limits<T>::is_bounded) {
222  return x == std::numeric_limits<T>::max();
223  }
224  else {
225  return false;
226  }
227 }
static const Property SPECIAL(Property::SPECIAL_)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_minus_infinity ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 270 of file Boundary_defs.hh.

References LOWER, normal_is_boundary_infinity(), normal_is_reverse_infinity(), and SPECIAL.

Referenced by eq(), lt(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::OK().

270  {
271  if (type == LOWER) {
272  if (Info::store_special) {
273  return info.get_boundary_property(type, SPECIAL);
274  }
275  else {
276  return normal_is_boundary_infinity(type, x, info);
277  }
278  }
279  else {
280  return !Info::store_special && normal_is_reverse_infinity(type, x, info);
281  }
282 }
bool normal_is_boundary_infinity(Boundary_Type type, const T &x, const Info &)
bool normal_is_reverse_infinity(Boundary_Type type, const T &x, const Info &)
static const Property SPECIAL(Property::SPECIAL_)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_open ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 93 of file Boundary_defs.hh.

References is_boundary_infinity(), and OPEN.

Referenced by eq(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), lt(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().

93  {
94  if (Info::store_open) {
95  return info.get_boundary_property(type, OPEN);
96  }
97  else {
98  return !Info::may_contain_infinity
99  && is_boundary_infinity(type, x, info);
100  }
101 }
static const Property OPEN(Property::OPEN_)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_plus_infinity ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 286 of file Boundary_defs.hh.

References normal_is_boundary_infinity(), normal_is_reverse_infinity(), SPECIAL, and UPPER.

Referenced by eq(), lt(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::OK().

286  {
287  if (type == UPPER) {
288  if (Info::store_special) {
289  return info.get_boundary_property(type, SPECIAL);
290  }
291  else {
292  return normal_is_boundary_infinity(type, x, info);
293  }
294  }
295  else {
296  return !Info::store_special && normal_is_reverse_infinity(type, x, info);
297  }
298 }
bool normal_is_boundary_infinity(Boundary_Type type, const T &x, const Info &)
bool normal_is_reverse_infinity(Boundary_Type type, const T &x, const Info &)
static const Property SPECIAL(Property::SPECIAL_)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::is_reverse_infinity ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 302 of file Boundary_defs.hh.

References normal_is_reverse_infinity().

Referenced by infinity_sign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::infinity_sign().

302  {
303  return normal_is_reverse_infinity(type, x, info);
304 }
bool normal_is_reverse_infinity(Boundary_Type type, const T &x, const Info &)
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool Parma_Polyhedra_Library::Boundary_NS::le ( Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 437 of file Boundary_defs.hh.

References gt().

Referenced by Parma_Polyhedra_Library::Polyhedron::add_congruence(), Parma_Polyhedra_Library::Polyhedron::add_congruences(), Parma_Polyhedra_Library::Linear_System< Row >::add_universe_rows_and_space_dimensions(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR_original(), Parma_Polyhedra_Library::Pointset_Powerset< PSET >::approximate_partition_aux(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains(), Parma_Polyhedra_Library::Polyhedron::contains_integer_point(), Parma_Polyhedra_Library::Grid::conversion(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::BD_Shape< T >::frequency(), Parma_Polyhedra_Library::Octagonal_Shape< T >::frequency(), Parma_Polyhedra_Library::Pointset_Powerset< PSET >::linear_partition(), Parma_Polyhedra_Library::Pointset_Powerset< PSET >::linear_partition_aux(), lt(), Parma_Polyhedra_Library::Implementation::Termination::one_affine_ranking_function_MS(), Parma_Polyhedra_Library::Termination_Helpers::one_affine_ranking_function_PR(), Parma_Polyhedra_Library::Termination_Helpers::one_affine_ranking_function_PR_original(), Parma_Polyhedra_Library::Shape_Preserving_Reduction< D1, D2 >::product_reduce(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::Polyhedron::refine_with_congruence(), Parma_Polyhedra_Library::Polyhedron::refine_with_congruences(), Parma_Polyhedra_Library::Octagonal_Shape< T >::relation_with(), Parma_Polyhedra_Library::BD_Shape< T >::relation_with(), Parma_Polyhedra_Library::Polyhedron::simplify_using_context_assign(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().

438  {
439  return !gt(type1, x1, info1, type2, x2, info2);
440 }
bool gt(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
template<typename T1 , typename Info1 , typename T2 , typename Info2 >
bool Parma_Polyhedra_Library::Boundary_NS::lt ( Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 391 of file Boundary_defs.hh.

References is_minus_infinity(), is_open(), is_plus_infinity(), le(), LOWER, and UPPER.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::can_be_exactly_joined_to(), Parma_Polyhedra_Library::I_Constraint_Common< I_Constraint< T, Val_Or_Ref_Criteria, extended > >::convert_real(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), ge(), gt(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_disjoint_from(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), min_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::Interval< Boundary, Info >::simplify_using_context_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains().

392  {
393  if (is_open(type1, x1, info1)) {
394  if (type1 == UPPER
395  && (type2 == LOWER
396  || !is_open(type2, x2, info2))) {
397  goto le;
398  }
399  }
400  else if (type2 == LOWER
401  && is_open(type2, x2, info2)) {
402  le:
403  if (is_minus_infinity(type1, x1, info1)
404  || is_plus_infinity(type2, x2, info2)) {
405  return true;
406  }
407  if (is_plus_infinity(type1, x1, info1)
408  || is_minus_infinity(type2, x2, info2)) {
409  return false;
410  }
411  else {
412  return less_or_equal(x1, x2);
413  }
414  }
415  if (is_plus_infinity(type1, x1, info1)
416  || is_minus_infinity(type2, x2, info2)) {
417  return false;
418  }
419  if (is_minus_infinity(type1, x1, info1)
420  || is_plus_infinity(type2, x2, info2)) {
421  return true;
422  }
423  else {
424  return less_than(x1, x2);
425  }
426 }
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type less_than(const T1 &x, const T2 &y)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_minus_infinity(const T &x)
bool is_open(Boundary_Type type, const T &x, const Info &info)
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type less_or_equal(const T1 &x, const T2 &y)
bool le(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::max_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 574 of file Boundary_defs.hh.

References assign(), gt(), and Parma_Polyhedra_Library::V_EQ.

575  {
576  if (gt(type, x, info, to_type, to, to_info)) {
577  to_info.clear_boundary_properties(to_type);
578  return assign(to_type, to, to_info, type, x, info);
579  }
580  return V_EQ;
581 }
The computed result is exact.
Definition: Result_defs.hh:81
bool gt(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
Result assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, bool should_shrink=false)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::max_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 585 of file Boundary_defs.hh.

References assign(), and gt().

587  {
588  if (gt(type1, x1, info1, type2, x2, info2)) {
589  return assign(to_type, to, to_info, type1, x1, info1);
590  }
591  else {
592  return assign(to_type, to, to_info, type2, x2, info2);
593  }
594 }
bool gt(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
Result assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, bool should_shrink=false)
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::min_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 550 of file Boundary_defs.hh.

References assign(), lt(), and Parma_Polyhedra_Library::V_EQ.

551  {
552  if (lt(type, x, info, to_type, to, to_info)) {
553  to_info.clear_boundary_properties(to_type);
554  return assign(to_type, to, to_info, type, x, info);
555  }
556  return V_EQ;
557 }
The computed result is exact.
Definition: Result_defs.hh:81
bool lt(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
Result assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, bool should_shrink=false)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::min_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 561 of file Boundary_defs.hh.

References assign(), and lt().

563  {
564  if (lt(type1, x1, info1, type2, x2, info2)) {
565  return assign(to_type, to, to_info, type1, x1, info1);
566  }
567  else {
568  return assign(to_type, to, to_info, type2, x2, info2);
569  }
570 }
bool lt(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
Result assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, bool should_shrink=false)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::mul_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 664 of file Boundary_defs.hh.

References adjust_boundary(), boundary_infinity_is_open(), is_boundary_infinity(), is_boundary_infinity_closed(), normal_is_open(), round_dir_check(), and set_boundary_infinity().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), mul_assign_z(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator*=().

666  {
667  bool should_shrink;
668  if (is_boundary_infinity(type1, x1, info1)) {
669  should_shrink = (boundary_infinity_is_open(type1, info1)
670  && !is_boundary_infinity_closed(type2, x2, info2));
671  return set_boundary_infinity(to_type, to, to_info, should_shrink);
672  }
673  else if (is_boundary_infinity(type2, x2, info2)) {
674  should_shrink = (boundary_infinity_is_open(type2, info2)
675  && !is_boundary_infinity_closed(type1, x1, info1));
676  return set_boundary_infinity(to_type, to, to_info, should_shrink);
677  }
678  should_shrink = (normal_is_open(type1, x1, info1)
679  || normal_is_open(type2, x2, info2));
680  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
681  PPL_ASSERT(x1 != Constant<0>::value && x2 != Constant<0>::value);
682  // FIXME: extended handling is not needed
683  Result r = mul_assign_r(to, x1, x2, round_dir_check(to_type, check));
684  return adjust_boundary(to_type, to, to_info, should_shrink, r);
685 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
Coefficient value
Definition: PIP_Tree.cc:618
bool boundary_infinity_is_open(Boundary_Type type, const Info &info)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool is_boundary_infinity_closed(Boundary_Type type, const T &x, const Info &info)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::mul_assign_z ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
int  x1s,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2,
int  x2s 
)
inline

Definition at line 697 of file Boundary_defs.hh.

References mul_assign(), OPEN, and set_zero().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign().

699  {
700  bool should_shrink;
701  if (x1s != 0) {
702  if (x2s != 0) {
703  return mul_assign(to_type, to, to_info,
704  type1, x1, info1,
705  type2, x2, info2);
706  }
707  else {
708  should_shrink = info2.get_boundary_property(type2, OPEN);
709  }
710  }
711  else {
712  should_shrink = (info1.get_boundary_property(type1, OPEN)
713  && (x2s != 0 || info2.get_boundary_property(type2, OPEN)));
714  }
715  return set_zero(to_type, to, to_info, should_shrink);
716 }
Result set_zero(Boundary_Type to_type, To &to, To_Info &to_info, bool should_shrink)
static const Property OPEN(Property::OPEN_)
Result mul_assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::neg_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 598 of file Boundary_defs.hh.

References adjust_boundary(), normal_is_open(), round_dir_check(), set_boundary_infinity(), SPECIAL, and special_is_open().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign().

599  {
600  PPL_ASSERT(to_type != type);
601  bool should_shrink;
602  if (info.get_boundary_property(type, SPECIAL)) {
603  should_shrink = special_is_open(type, x, info);
604  return set_boundary_infinity(to_type, to, to_info, should_shrink);
605  }
606  should_shrink = normal_is_open(type, x, info);
607  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
608  Result r = neg_assign_r(to, x, round_dir_check(to_type, check));
609  return adjust_boundary(to_type, to, to_info, should_shrink, r);
610 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
static const Property SPECIAL(Property::SPECIAL_)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool special_is_open(Boundary_Type, const T &, const Info &)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::normal_is_boundary_infinity ( Boundary_Type  type,
const T &  x,
const Info &   
)
inline

Definition at line 231 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::is_minus_infinity(), Parma_Polyhedra_Library::is_plus_infinity(), and LOWER.

Referenced by is_boundary_infinity(), is_minus_infinity(), is_plus_infinity(), and normal_is_open().

231  {
232  if (!std::numeric_limits<T>::has_infinity) {
233  return false;
234  }
235  if (type == LOWER) {
237  }
238  else {
240  }
241 }
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_minus_infinity(const T &x)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::normal_is_open ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 81 of file Boundary_defs.hh.

References normal_is_boundary_infinity(), and OPEN.

Referenced by add_assign(), assign(), complement(), div_assign(), mul_assign(), neg_assign(), smod_2exp_assign(), sub_assign(), and umod_2exp_assign().

81  {
82  if (Info::store_open) {
83  return info.get_boundary_property(type, OPEN);
84  }
85  else {
86  return !Info::store_special && !Info::may_contain_infinity
87  && normal_is_boundary_infinity(type, x, info);
88  }
89 }
bool normal_is_boundary_infinity(Boundary_Type type, const T &x, const Info &)
static const Property OPEN(Property::OPEN_)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::normal_is_reverse_infinity ( Boundary_Type  type,
const T &  x,
const Info &   
)
inline

Definition at line 256 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::is_minus_infinity(), Parma_Polyhedra_Library::is_plus_infinity(), and LOWER.

Referenced by is_minus_infinity(), is_plus_infinity(), and is_reverse_infinity().

256  {
257  if (!Info::may_contain_infinity) {
258  return false;
259  }
260  else if (type == LOWER) {
262  }
263  else {
265  }
266 }
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_minus_infinity(const T &x)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
Rounding_Dir Parma_Polyhedra_Library::Boundary_NS::round_dir_check ( Boundary_Type  t,
bool  check = false 
)
inline

Definition at line 56 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::ROUND_STRICT_RELATION.

Referenced by add_assign(), assign(), complement(), div_assign(), mul_assign(), neg_assign(), set_boundary_infinity(), set_minus_infinity(), set_plus_infinity(), set_zero(), smod_2exp_assign(), sub_assign(), and umod_2exp_assign().

56  {
57  if (check) {
58  return static_cast<Rounding_Dir>(t) | ROUND_STRICT_RELATION;
59  }
60  else {
61  return static_cast<Rounding_Dir>(t);
62  }
63 }
Rounding_Dir
Rounding directions for arithmetic computations.
template<typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::set_boundary_infinity ( Boundary_Type  type,
T &  x,
Info &  info,
bool  open = false 
)
inline

Definition at line 176 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::assign_r(), LOWER, Parma_Polyhedra_Library::MINUS_INFINITY, OPEN, Parma_Polyhedra_Library::PLUS_INFINITY, Parma_Polyhedra_Library::result_representable(), round_dir_check(), and special_set_boundary_infinity().

Referenced by add_assign(), assign(), div_assign(), div_assign_z(), mul_assign(), neg_assign(), smod_2exp_assign(), sub_assign(), and umod_2exp_assign().

176  {
177  PPL_ASSERT(open || Info::may_contain_infinity);
178  Result r;
179  if (Info::store_special) {
180  r = special_set_boundary_infinity(type, x, info);
181  }
182  else if (type == LOWER) {
183  r = assign_r(x, MINUS_INFINITY, round_dir_check(type));
184  }
185  else {
186  r = assign_r(x, PLUS_INFINITY, round_dir_check(type));
187  }
188  PPL_ASSERT(result_representable(r));
189  if (open) {
190  info.set_boundary_property(type, OPEN);
191  }
192  return r;
193 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Result special_set_boundary_infinity(Boundary_Type type, T &, Info &info)
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
static const Property OPEN(Property::OPEN_)
Plus_Infinity PLUS_INFINITY
Definition: checked.cc:31
Minus_Infinity MINUS_INFINITY
Definition: checked.cc:30
bool result_representable(Result r)
template<typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::set_minus_infinity ( Boundary_Type  type,
T &  x,
Info &  info,
bool  open = false 
)
inline

Definition at line 128 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::assign_r(), LOWER, Parma_Polyhedra_Library::MINUS_INFINITY, OPEN, Parma_Polyhedra_Library::result_relation(), Parma_Polyhedra_Library::result_representable(), round_dir_check(), special_set_boundary_infinity(), and Parma_Polyhedra_Library::VR_EQ.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), complement(), Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval(), Parma_Polyhedra_Library::operator>>(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities().

128  {
129  if (open) {
130  PPL_ASSERT(type == LOWER);
131  }
132  else {
133  PPL_ASSERT(Info::may_contain_infinity);
134  }
135  Result r;
136  if (Info::store_special) {
137  PPL_ASSERT(type == LOWER);
138  r = special_set_boundary_infinity(type, x, info);
139  }
140  else {
141  r = assign_r(x, MINUS_INFINITY, round_dir_check(type));
142  PPL_ASSERT(result_representable(r));
143  }
144  if (open || result_relation(r) != VR_EQ) {
145  info.set_boundary_property(type, OPEN);
146  }
147  return r;
148 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Result special_set_boundary_infinity(Boundary_Type type, T &, Info &info)
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
static const Property OPEN(Property::OPEN_)
Equal. This need to be accompanied by a value.
Definition: Result_defs.hh:51
Minus_Infinity MINUS_INFINITY
Definition: checked.cc:30
bool result_representable(Result r)
Result result_relation(Rounding_Dir dir)
template<typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::set_plus_infinity ( Boundary_Type  type,
T &  x,
Info &  info,
bool  open = false 
)
inline

Definition at line 152 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::assign_r(), OPEN, Parma_Polyhedra_Library::PLUS_INFINITY, Parma_Polyhedra_Library::result_relation(), Parma_Polyhedra_Library::result_representable(), round_dir_check(), special_set_boundary_infinity(), UPPER, and Parma_Polyhedra_Library::VR_EQ.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), complement(), Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval(), Parma_Polyhedra_Library::operator>>(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities().

152  {
153  if (open) {
154  PPL_ASSERT(type == UPPER);
155  }
156  else {
157  PPL_ASSERT(Info::may_contain_infinity);
158  }
159  Result r;
160  if (Info::store_special) {
161  PPL_ASSERT(type == UPPER);
162  r = special_set_boundary_infinity(type, x, info);
163  }
164  else {
165  r = assign_r(x, PLUS_INFINITY, round_dir_check(type));
166  PPL_ASSERT(result_representable(r));
167  }
168  if (open || result_relation(r) != VR_EQ) {
169  info.set_boundary_property(type, OPEN);
170  }
171  return r;
172 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Result special_set_boundary_infinity(Boundary_Type type, T &, Info &info)
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
static const Property OPEN(Property::OPEN_)
Equal. This need to be accompanied by a value.
Definition: Result_defs.hh:51
Plus_Infinity PLUS_INFINITY
Definition: checked.cc:31
bool result_representable(Result r)
Result result_relation(Rounding_Dir dir)
template<typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::set_unbounded ( Boundary_Type  type,
T &  x,
Info &  info 
)
inline

Definition at line 105 of file Boundary_defs.hh.

References Parma_Polyhedra_Library::assign_r(), LOWER, Parma_Polyhedra_Library::MINUS_INFINITY, OPEN, Parma_Polyhedra_Library::PLUS_INFINITY, PPL_COMPILE_TIME_CHECK, Parma_Polyhedra_Library::result_relation(), Parma_Polyhedra_Library::ROUND_DOWN, Parma_Polyhedra_Library::ROUND_UP, special_set_boundary_infinity(), and Parma_Polyhedra_Library::VR_EQ.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_extend(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_extend(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().

105  {
106  PPL_COMPILE_TIME_CHECK(Info::store_special
107  || std::numeric_limits<T>::is_bounded
108  || std::numeric_limits<T>::has_infinity,
109  "unbounded is not representable");
110  Result r;
111  if (Info::store_special) {
112  r = special_set_boundary_infinity(type, x, info);
113  }
114  else if (type == LOWER) {
116  }
117  else {
119  }
120  if (result_relation(r) == VR_EQ && !Info::may_contain_infinity) {
121  info.set_boundary_property(type, OPEN);
122  }
123  return r;
124 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Result special_set_boundary_infinity(Boundary_Type type, T &, Info &info)
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
static const Property OPEN(Property::OPEN_)
#define PPL_COMPILE_TIME_CHECK(e, msg)
Produces a compilation error if the compile-time constant e does not evaluate to true ...
Equal. This need to be accompanied by a value.
Definition: Result_defs.hh:51
Plus_Infinity PLUS_INFINITY
Definition: checked.cc:31
Minus_Infinity MINUS_INFINITY
Definition: checked.cc:30
Result result_relation(Rounding_Dir dir)
template<typename To , typename To_Info >
Result Parma_Polyhedra_Library::Boundary_NS::set_zero ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
bool  should_shrink 
)
inline

Definition at line 689 of file Boundary_defs.hh.

References adjust_boundary(), Parma_Polyhedra_Library::assign_r(), and round_dir_check().

Referenced by div_assign(), div_assign_z(), and mul_assign_z().

689  {
690  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
691  Result r = assign_r(to, Constant<0>::value, round_dir_check(to_type, check));
692  return adjust_boundary(to_type, to, to_info, should_shrink, r);
693 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &x, Rounding_Dir dir)
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
Coefficient value
Definition: PIP_Tree.cc:618
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
template<typename T , typename Info >
int Parma_Polyhedra_Library::Boundary_NS::sgn ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 350 of file Boundary_defs.hh.

References LOWER, OPEN, and sgn_b().

Referenced by Parma_Polyhedra_Library::Octagonal_Shape< T >::affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::affine_image(), Parma_Polyhedra_Library::Checked::assign_float_mpq(), Parma_Polyhedra_Library::Checked::assign_float_mpz(), Parma_Polyhedra_Library::Checked::assign_signed_int_mpz(), Parma_Polyhedra_Library::Checked::assign_unsigned_int_mpz(), Parma_Polyhedra_Library::Octagonal_Shape< T >::bounded_affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::bounded_affine_image(), Parma_Polyhedra_Library::Octagonal_Shape< T >::bounded_affine_preimage(), Parma_Polyhedra_Library::BD_Shape< T >::bounded_affine_preimage(), Parma_Polyhedra_Library::Box< ITV >::bounds(), Parma_Polyhedra_Library::Box< ITV >::Box(), Parma_Polyhedra_Library::Checked::classify_mpq(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::compare(), Parma_Polyhedra_Library::Polyhedron::constrains(), Parma_Polyhedra_Library::Grid::constrains(), Parma_Polyhedra_Library::Polyhedron::conversion(), Parma_Polyhedra_Library::Checked::div_mpq(), Parma_Polyhedra_Library::Checked::div_mpz(), Parma_Polyhedra_Library::Polyhedron::drop_some_non_integer_points(), Parma_Polyhedra_Library::BD_Shape< T >::extract_bounded_difference(), Parma_Polyhedra_Library::Polyhedron::frequency(), Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Octagonal_Shape< T >::generalized_affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::generalized_affine_image(), Parma_Polyhedra_Library::Box< ITV >::generalized_affine_preimage(), Parma_Polyhedra_Library::BD_Shape< T >::generalized_affine_preimage(), Parma_Polyhedra_Library::Octagonal_Shape< T >::generalized_affine_preimage(), Parma_Polyhedra_Library::Polyhedron::generalized_affine_preimage(), Parma_Polyhedra_Library::MIP_Problem::get_exiting_base_index(), Parma_Polyhedra_Library::Scalar_Products::homogeneous_sign(), Parma_Polyhedra_Library::Checked::idiv_mpq(), Parma_Polyhedra_Library::Checked::idiv_mpz(), Parma_Polyhedra_Library::BD_Shape< T >::incremental_shortest_path_closure_assign(), Parma_Polyhedra_Library::Octagonal_Shape< T >::incremental_strong_closure_assign(), Parma_Polyhedra_Library::interval_relation(), Parma_Polyhedra_Library::Checked::is_int_mpq(), Parma_Polyhedra_Library::Checked::is_minf_mpq(), Parma_Polyhedra_Library::Checked::is_nan_mpq(), Parma_Polyhedra_Library::Checked::is_pinf_mpq(), Parma_Polyhedra_Library::Constraint::is_tautological(), Parma_Polyhedra_Library::DB_Matrix< T >::l_m_distance_assign(), Parma_Polyhedra_Library::Generator::l_m_distance_assign(), Parma_Polyhedra_Library::OR_Matrix< T >::l_m_distance_assign(), Parma_Polyhedra_Library::Box< ITV >::l_m_distance_assign(), Parma_Polyhedra_Library::BD_Shape< T >::max_min(), Parma_Polyhedra_Library::Box< ITV >::max_min(), Parma_Polyhedra_Library::Octagonal_Shape< T >::max_min(), Parma_Polyhedra_Library::Polyhedron::max_min(), Parma_Polyhedra_Library::Polyhedron::modify_according_to_evolution(), Parma_Polyhedra_Library::Dense_Row::normalize(), Parma_Polyhedra_Library::Sparse_Row::normalize(), Parma_Polyhedra_Library::BD_Shape< T >::operator<<(), Parma_Polyhedra_Library::Octagonal_Shape< T >::operator<<(), Parma_Polyhedra_Library::MIP_Problem::parse_constraints(), Parma_Polyhedra_Library::Box< ITV >::propagate_constraint_no_check(), Parma_Polyhedra_Library::Scalar_Products::reduced_sign(), Parma_Polyhedra_Library::Octagonal_Shape< T >::refine(), Parma_Polyhedra_Library::BD_Shape< T >::refine(), Parma_Polyhedra_Library::Box< ITV >::relation_with(), Parma_Polyhedra_Library::Octagonal_Shape< T >::relation_with(), Parma_Polyhedra_Library::BD_Shape< T >::relation_with(), Parma_Polyhedra_Library::Checked::rem_mpq(), Parma_Polyhedra_Library::Checked::rem_mpz(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::scalar_product_sign(), sgn_b(), Parma_Polyhedra_Library::Checked::sgn_mp(), Parma_Polyhedra_Library::BD_Shape< T >::shortest_path_closure_assign(), Parma_Polyhedra_Library::Scalar_Products::sign(), Parma_Polyhedra_Library::MIP_Problem::steepest_edge_exact_entering_index(), Parma_Polyhedra_Library::MIP_Problem::steepest_edge_float_entering_index(), Parma_Polyhedra_Library::Octagonal_Shape< T >::strong_closure_assign(), and Parma_Polyhedra_Library::MIP_Problem::textbook_entering_index().

350  {
351  int sign = sgn_b(type, x, info);
352  if (x == 0 && info.get_boundary_property(type, OPEN)) {
353  return (type == LOWER) ? -1 : 1;
354  }
355  else {
356  return sign;
357  }
358 }
static const Property OPEN(Property::OPEN_)
int sgn_b(Boundary_Type type, const T &x, const Info &info)
template<typename T , typename Info >
int Parma_Polyhedra_Library::Boundary_NS::sgn_b ( Boundary_Type  type,
const T &  x,
const Info &  info 
)
inline

Definition at line 337 of file Boundary_defs.hh.

References LOWER, sgn(), and SPECIAL.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), Parma_Polyhedra_Library::MIP_Problem::parse_constraints(), and sgn().

337  {
338  if (info.get_boundary_property(type, SPECIAL)) {
339  return (type == LOWER) ? -1 : 1;
340  }
341  else {
342  // The following Parma_Polyhedra_Library:: qualification is to work
343  // around a bug of GCC 4.0.x.
345  }
346 }
static const Property SPECIAL(Property::SPECIAL_)
int sgn(Boundary_Type type, const T &x, const Info &info)
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::smod_2exp_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info,
unsigned int  exp 
)
inline

Definition at line 783 of file Boundary_defs.hh.

References adjust_boundary(), boundary_infinity_is_open(), is_boundary_infinity(), normal_is_open(), round_dir_check(), and set_boundary_infinity().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().

785  {
786  PPL_ASSERT(to_type == type);
787  bool should_shrink;
788  if (is_boundary_infinity(type, x, info)) {
789  should_shrink = boundary_infinity_is_open(type, info);
790  return set_boundary_infinity(to_type, to, to_info, should_shrink);
791  }
792  should_shrink = normal_is_open(type, x, info);
793  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
794  Result r = smod_2exp_assign_r(to, x, exp, round_dir_check(to_type, check));
795  return adjust_boundary(to_type, to, to_info, should_shrink, r);
796 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
bool boundary_infinity_is_open(Boundary_Type type, const Info &info)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename T , typename Info >
bool Parma_Polyhedra_Library::Boundary_NS::special_is_open ( Boundary_Type  ,
const T &  ,
const Info &   
)
inline

Definition at line 75 of file Boundary_defs.hh.

Referenced by assign(), complement(), and neg_assign().

75  {
76  return !Info::may_contain_infinity;
77 }
template<typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::special_set_boundary_infinity ( Boundary_Type  type,
T &  ,
Info &  info 
)
inline

Definition at line 67 of file Boundary_defs.hh.

References SPECIAL, and Parma_Polyhedra_Library::V_EQ.

Referenced by adjust_boundary(), set_boundary_infinity(), set_minus_infinity(), set_plus_infinity(), and set_unbounded().

67  {
68  PPL_ASSERT(Info::store_special);
69  info.set_boundary_property(type, SPECIAL);
70  return V_EQ;
71 }
The computed result is exact.
Definition: Result_defs.hh:81
static const Property SPECIAL(Property::SPECIAL_)
template<typename To , typename To_Info , typename T1 , typename Info1 , typename T2 , typename Info2 >
Result Parma_Polyhedra_Library::Boundary_NS::sub_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type1,
const T1 &  x1,
const Info1 &  info1,
Boundary_Type  type2,
const T2 &  x2,
const Info2 &  info2 
)
inline

Definition at line 639 of file Boundary_defs.hh.

References adjust_boundary(), boundary_infinity_is_open(), is_boundary_infinity(), is_boundary_infinity_closed(), normal_is_open(), round_dir_check(), and set_boundary_infinity().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::operator-=(), Parma_Polyhedra_Library::Interval< Boundary, Info >::sub_assign(), and Parma_Polyhedra_Library::PIP_Solution_Node::update_tableau().

641  {
642  PPL_ASSERT(type1 != type2);
643  bool should_shrink;
644  if (is_boundary_infinity(type1, x1, info1)) {
645  should_shrink = (boundary_infinity_is_open(type1, info1)
646  && !is_boundary_infinity_closed(type2, x2, info2));
647  return set_boundary_infinity(to_type, to, to_info, should_shrink);
648  }
649  else if (is_boundary_infinity(type2, x2, info2)) {
650  should_shrink = (boundary_infinity_is_open(type2, info2)
651  && !is_boundary_infinity_closed(type1, x1, info1));
652  return set_boundary_infinity(to_type, to, to_info, should_shrink);
653  }
654  should_shrink = (normal_is_open(type1, x1, info1)
655  || normal_is_open(type2, x2, info2));
656  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
657  // FIXME: extended handling is not needed
658  Result r = sub_assign_r(to, x1, x2, round_dir_check(to_type, check));
659  return adjust_boundary(to_type, to, to_info, should_shrink, r);
660 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
bool boundary_infinity_is_open(Boundary_Type type, const Info &info)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool is_boundary_infinity_closed(Boundary_Type type, const T &x, const Info &info)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)
template<typename To , typename To_Info , typename T , typename Info >
Result Parma_Polyhedra_Library::Boundary_NS::umod_2exp_assign ( Boundary_Type  to_type,
To &  to,
To_Info &  to_info,
Boundary_Type  type,
const T &  x,
const Info &  info,
unsigned int  exp 
)
inline

Definition at line 766 of file Boundary_defs.hh.

References adjust_boundary(), boundary_infinity_is_open(), is_boundary_infinity(), normal_is_open(), round_dir_check(), and set_boundary_infinity().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().

768  {
769  PPL_ASSERT(to_type == type);
770  bool should_shrink;
771  if (is_boundary_infinity(type, x, info)) {
772  should_shrink = boundary_infinity_is_open(type, info);
773  return set_boundary_infinity(to_type, to, to_info, should_shrink);
774  }
775  should_shrink = normal_is_open(type, x, info);
776  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
777  Result r = umod_2exp_assign_r(to, x, exp, round_dir_check(to_type, check));
778  return adjust_boundary(to_type, to, to_info, should_shrink, r);
779 }
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Rounding_Dir round_dir_check(Boundary_Type t, bool check=false)
bool boundary_infinity_is_open(Boundary_Type type, const Info &info)
bool normal_is_open(Boundary_Type type, const T &x, const Info &info)
Result adjust_boundary(Boundary_Type type, T &x, Info &info, bool open, Result r)
bool is_boundary_infinity(Boundary_Type type, const T &x, const Info &info)
Result set_boundary_infinity(Boundary_Type type, T &x, Info &info, bool open=false)

Variable Documentation