Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 > Class Template Reference
[C++ Language Interface]

This class provides the reduction method for the Constraints_Product domain. More...

#include <Partially_Reduced_Product.defs.hh>

List of all members.

Public Member Functions

 Constraints_Reduction ()
 Default constructor.
void product_reduce (D1 &d1, D2 &d2)
 The constraints reduction operator for sharing constraints between the domains.
 ~Constraints_Reduction ()
 Destructor.

Detailed Description

template<typename D1, typename D2>
class Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >

This class provides the reduction method for the Constraints_Product domain.

The reduction classes are used to instantiate the Partially_Reduced_Product domain. This class adds the constraints defining each of the component domains to the other component.

Definition at line 135 of file Partially_Reduced_Product.defs.hh.


Constructor & Destructor Documentation

template<typename D1 , typename D2 >
Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >::Constraints_Reduction (  )  [inline]

Default constructor.

Definition at line 771 of file Partially_Reduced_Product.inlines.hh.

00771                                                      {
00772 }

template<typename D1 , typename D2 >
Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >::~Constraints_Reduction (  )  [inline]

Destructor.

Definition at line 776 of file Partially_Reduced_Product.inlines.hh.

00776                                                       {
00777 }


Member Function Documentation

template<typename D1 , typename D2 >
void Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >::product_reduce ( D1 &  d1,
D2 &  d2 
) [inline]

The constraints reduction operator for sharing constraints between the domains.

The minimized constraint system defining the domain element d1 is added to d2 and the minimized constraint system defining d2 is added to d1. In each case, the donor domain must provide a constraint system in minimal form; this must define a polyhedron in which the donor element is contained. The recipient domain selects a subset of these constraints that it can add to the recipient element. For example: if the domain D1 is the Grid domain and D2 the NNC Polyhedron domain, then only the equality constraints are copied from d1 to d2 and from d2 to d1.

Parameters:
d1 A pointset domain element;
d2 A pointset domain element;

Definition at line 468 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Smash_Reduction< D1, D2 >::product_reduce(), and Parma_Polyhedra_Library::swap().

Referenced by Parma_Polyhedra_Library::Shape_Preserving_Reduction< D1, D2 >::product_reduce().

00468                                                                  {
00469   if (d1.is_empty() || d2.is_empty()) {
00470     // If one of the components is empty, do the smash reduction and return.
00471     Parma_Polyhedra_Library::Smash_Reduction<D1, D2> sr;
00472     sr.product_reduce(d1, d2);
00473     return;
00474   }
00475   else {
00476     dimension_type space_dim = d1.space_dimension();
00477     d1.refine_with_constraints(d2.minimized_constraints());
00478     if (d1.is_empty()) {
00479       D2 new_d2(space_dim, EMPTY);
00480       std::swap(d2, new_d2);
00481       return;
00482     }
00483     d2.refine_with_constraints(d1.minimized_constraints());
00484     if (d2.is_empty()) {
00485       D1 new_d1(space_dim, EMPTY);
00486       std::swap(d1, new_d1);
00487     }
00488   }
00489 }


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