PPL  1.2
Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 > Class Template Reference

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

#include <Partially_Reduced_Product_defs.hh>

Public Member Functions

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

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 141 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 781 of file Partially_Reduced_Product_inlines.hh.

781  {
782 }
template<typename D1 , typename D2 >
Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >::~Constraints_Reduction ( )
inline

Destructor.

Definition at line 786 of file Partially_Reduced_Product_inlines.hh.

786  {
787 }

Member Function Documentation

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

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
d1A pointset domain element;
d2A pointset domain element;

Definition at line 521 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().

521  {
522  if (d1.is_empty() || d2.is_empty()) {
523  // If one of the components is empty, do the smash reduction and return.
525  sr.product_reduce(d1, d2);
526  return;
527  }
528  else {
529  using std::swap;
530  dimension_type space_dim = d1.space_dimension();
531  d1.refine_with_constraints(d2.minimized_constraints());
532  if (d1.is_empty()) {
533  D2 new_d2(space_dim, EMPTY);
534  swap(d2, new_d2);
535  return;
536  }
537  d2.refine_with_constraints(d1.minimized_constraints());
538  if (d2.is_empty()) {
539  D1 new_d1(space_dim, EMPTY);
540  swap(d1, new_d1);
541  }
542  }
543 }
The empty element, i.e., the empty set.
void swap(CO_Tree &x, CO_Tree &y)
size_t dimension_type
An unsigned integral type for representing space dimensions.
void product_reduce(D1 &d1, D2 &d2)
The smash reduction operator for propagating emptiness between the domain elements d1 and d2...
This class provides the reduction method for the Smash_Product domain.

The documentation for this class was generated from the following files: