PPL  1.2
Parma_Polyhedra_Library::Box_Helpers Class Reference

#include <Box_defs.hh>

Static Public Member Functions

static bool extract_interval_congruence (const Congruence &cg, dimension_type &cg_num_vars, dimension_type &cg_only_var)
 

Related Functions

(Note that these are not member functions.)

static bool extract_interval_constraint (const Constraint &c, dimension_type &c_num_vars, dimension_type &c_only_var)
 Decodes the constraint c as an interval constraint. More...
 

Detailed Description

Definition at line 2245 of file Box_defs.hh.

Member Function Documentation

bool Parma_Polyhedra_Library::Box_Helpers::extract_interval_congruence ( const Congruence cg,
dimension_type cg_num_vars,
dimension_type cg_only_var 
)
static

Definition at line 48 of file Box.cc.

References Parma_Polyhedra_Library::Expression_Adapter< T >::all_zeroes(), Parma_Polyhedra_Library::Congruence::expression(), Parma_Polyhedra_Library::Expression_Adapter< T >::first_nonzero(), Parma_Polyhedra_Library::Congruence::is_equality(), and Parma_Polyhedra_Library::Congruence::space_dimension().

Referenced by Parma_Polyhedra_Library::Box< ITV >::add_congruence_no_check().

50  {
51  // Check for preconditions.
52  PPL_ASSERT(cg_num_vars == 0 && cg_only_var == 0);
53  // Only equality congruences can be intervals.
54  PPL_ASSERT(cg.is_equality());
55 
56  cg_only_var = cg.expression().first_nonzero(1, cg.space_dimension() + 1);
57  if (cg_only_var == cg.space_dimension() + 1) {
58  // All the inhomogeneous coefficients are zero.
59  return true;
60  }
61 
62  ++cg_num_vars;
63  --cg_only_var;
64  return cg.expression().all_zeroes(cg_only_var + 2, cg.space_dimension() + 1);
65 }

Friends And Related Function Documentation

bool Parma_Polyhedra_Library::Box_Helpers::extract_interval_constraint ( const Constraint c,
dimension_type c_num_vars,
dimension_type c_only_var 
)
related

Decodes the constraint c as an interval constraint.

Returns
true if the constraint c is an interval constraint; false otherwise.
Parameters
cThe constraint to be decoded.
c_num_varsIf true is returned, then it will be set to the number of variables having a non-zero coefficient. The only legal values will therefore be 0 and 1.
c_only_varIf true is returned and if c_num_vars is not set to 0, then it will be set to the index of the only variable having a non-zero coefficient in c.

Definition at line 30 of file Box.cc.

References Parma_Polyhedra_Library::Expression_Hide_Last< T >::all_zeroes(), Parma_Polyhedra_Library::Constraint::expression(), Parma_Polyhedra_Library::Expression_Hide_Last< T >::first_nonzero(), and Parma_Polyhedra_Library::Constraint::space_dimension().

Referenced by Parma_Polyhedra_Library::Box< ITV >::add_constraint_no_check(), Parma_Polyhedra_Library::Box< ITV >::get_limiting_box(), Parma_Polyhedra_Library::Box< ITV >::refine_no_check(), Parma_Polyhedra_Library::Box< ITV >::relation_with(), and Parma_Polyhedra_Library::Box< ITV >::wrap_assign().

32  {
33  // Check for preconditions.
34  PPL_ASSERT(c_num_vars == 0 && c_only_var == 0);
35 
36  c_only_var = c.expression().first_nonzero(1, c.space_dimension() + 1);
37  if (c_only_var == c.space_dimension() + 1) {
38  // All the inhomogeneous coefficients are zero.
39  return true;
40  }
41 
42  ++c_num_vars;
43  --c_only_var;
44  return c.expression().all_zeroes(c_only_var + 2, c.space_dimension() + 1);
45 }
Coefficient c
Definition: PIP_Tree.cc:64

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