Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base > Class Template Reference

#include <Interval_Restriction.defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >:
Inheritance graph
[legend]
Collaboration diagram for Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T modulo_type

Public Member Functions

 PPL_COMPILE_TIME_CHECK (std::numeric_limits< T >::is_exact,"type for modulo values must be exact")
 Interval_Restriction_Integer_Modulo ()
bool has_restriction () const
void clear ()
void normalize () const
template<typename V >
Result restrict (Rounding_Dir rdir, V &x, Result dir) const
void assign_or_swap (Interval_Restriction_Integer_Modulo &x)

Public Attributes

remainder
divisor

Detailed Description

template<typename T, typename Base>
class Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >

Definition at line 319 of file Interval_Restriction.defs.hh.


Member Typedef Documentation

template<typename T, typename Base>
typedef T Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::modulo_type

Definition at line 397 of file Interval_Restriction.defs.hh.


Constructor & Destructor Documentation

template<typename T, typename Base>
Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::Interval_Restriction_Integer_Modulo (  )  [inline]

Definition at line 323 of file Interval_Restriction.defs.hh.

References Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::clear().

00323                                         {
00324     // FIXME: would we have speed benefits with uninitialized info?
00325     // (Dirty_Temp)
00326     clear();
00327   }


Member Function Documentation

template<typename T, typename Base>
void Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::assign_or_swap ( Interval_Restriction_Integer_Modulo< T, Base > &  x  )  [inline]
template<typename T, typename Base>
void Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::clear (  )  [inline]
template<typename T, typename Base>
bool Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::has_restriction (  )  const [inline]
template<typename T, typename Base>
void Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::normalize (  )  const [inline]

Definition at line 336 of file Interval_Restriction.defs.hh.

00336                          {
00337   }

template<typename T, typename Base>
Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::PPL_COMPILE_TIME_CHECK ( std::numeric_limits< T >::is_exact  ,
"type for modulo values must be exact"   
)
template<typename T, typename Base>
template<typename V >
Result Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::restrict ( Rounding_Dir  rdir,
V &  x,
Result  dir 
) const [inline]

Definition at line 339 of file Interval_Restriction.defs.hh.

References Parma_Polyhedra_Library::assign_r(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor, Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::has_restriction(), and Parma_Polyhedra_Library::Checked::Result.

00339                                                              {
00340     if (!has_restriction())
00341       return dir;
00342     PPL_DIRTY_TEMP(V, n);
00343     PPL_DIRTY_TEMP(V, div);
00344     Result r;
00345     r = assign_r(div, divisor, ROUND_CHECK);
00346     PPL_ASSERT(r == V_EQ);
00347     int s;
00348     r = rem_assign_r(n, x, div, ROUND_NOT_NEEDED);
00349     PPL_ASSERT(r == V_EQ);
00350     s = sgn(n);
00351     switch (dir) {
00352     case V_GT:
00353       if (s >= 0) {
00354         r = sub_assign_r(n, div, n, ROUND_NOT_NEEDED);
00355         PPL_ASSERT(r == V_EQ);
00356         return add_assign_r(x, x, n, rdir);
00357       }
00358       else
00359         return sub_assign_r(x, x, n, rdir);
00360     case V_GE:
00361       if (s > 0) {
00362         r = sub_assign_r(n, div, n, ROUND_NOT_NEEDED);
00363         PPL_ASSERT(r == V_EQ);
00364         return add_assign_r(x, x, n, rdir);
00365       }
00366       else if (s < 0)
00367         return sub_assign_r(x, x, n, rdir);
00368       else
00369         return V_EQ;
00370     case V_LT:
00371       if (s <= 0) {
00372         r = add_assign_r(n, div, n, ROUND_NOT_NEEDED);
00373         PPL_ASSERT(r == V_EQ);
00374         return sub_assign_r(x, x, n, rdir);
00375       }
00376       else
00377         return sub_assign_r(x, x, n, rdir);
00378     case V_LE:
00379       if (s < 0) {
00380         r = add_assign_r(n, div, n, ROUND_NOT_NEEDED);
00381         PPL_ASSERT(r == V_EQ);
00382         return sub_assign_r(x, x, n, rdir);
00383       }
00384       else if (s > 0)
00385         return sub_assign_r(x, x, n, rdir);
00386       else
00387         return V_EQ;
00388     default:
00389       PPL_ASSERT(false);
00390       return dir;
00391     }
00392   }


Member Data Documentation

template<typename T, typename Base>
T Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor
template<typename T, typename Base>
T Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::remainder

The documentation for this class was generated from the following file:
Generated on Sun Feb 27 16:20:27 2011 for PPL by  doxygen 1.6.3