PPL
1.2
|
A dimension of the vector space. More...
#include <Variable_defs.hh>
Classes | |
struct | Compare |
Binary predicate defining the total ordering on variables. More... | |
Public Types | |
typedef void | output_function_type(std::ostream &s, const Variable v) |
Type of output functions. More... | |
Public Member Functions | |
Variable (dimension_type i) | |
Builds the variable corresponding to the Cartesian axis of index i . More... | |
dimension_type | id () const |
Returns the index of the Cartesian axis associated to the variable. More... | |
dimension_type | space_dimension () const |
Returns the dimension of the vector space enclosing *this . More... | |
memory_size_type | total_memory_in_bytes () const |
Returns the total size in bytes of the memory occupied by *this . More... | |
memory_size_type | external_memory_in_bytes () const |
Returns the size in bytes of the memory managed by *this . More... | |
bool | OK () const |
Checks if all the invariants are satisfied. More... | |
void | m_swap (Variable &v) |
Swaps *this and v. More... | |
Static Public Member Functions | |
static dimension_type | max_space_dimension () |
Returns the maximum space dimension a Variable can handle. More... | |
static void | default_output_function (std::ostream &s, const Variable v) |
The default output function. More... | |
static void | set_output_function (output_function_type *p) |
Sets the output function to be used for printing Variable objects. More... | |
static output_function_type * | get_output_function () |
Returns the pointer to the current output function. More... | |
Private Attributes | |
dimension_type | varid |
The index of the Cartesian axis. More... | |
Static Private Attributes | |
static output_function_type * | current_output_function = 0 |
Pointer to the current output function. More... | |
Friends | |
class | Init |
std::ostream & | Parma_Polyhedra_Library::IO_Operators::operator<< (std::ostream &s, const Variable v) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &s, const Variable v) |
std::ostream & | operator<< (std::ostream &s, const Variable v) |
Output operator. More... | |
bool | less (Variable v, Variable w) |
Defines a total ordering on variables. More... | |
void | swap (Variable &x, Variable &y) |
bool | less (const Variable v, const Variable w) |
A dimension of the vector space.
An object of the class Variable represents a dimension of the space, that is one of the Cartesian axes. Variables are used as basic blocks in order to build more complex linear expressions. Each variable is identified by a non-negative integer, representing the index of the corresponding Cartesian axis (the first axis has index 0). The space dimension of a variable is the dimension of the vector space made by all the Cartesian axes having an index less than or equal to that of the considered variable; thus, if a variable has index , its space dimension is
.
Note that the ``meaning'' of an object of the class Variable is completely specified by the integer index provided to its constructor: be careful not to be mislead by C++ language variable names. For instance, in the following example the linear expressions e1
and e2
are equivalent, since the two variables x
and z
denote the same Cartesian axis.
Definition at line 85 of file Variable_defs.hh.
typedef void Parma_Polyhedra_Library::Variable::output_function_type(std::ostream &s, const Variable v) |
Type of output functions.
Definition at line 118 of file Variable_defs.hh.
|
inlineexplicit |
Builds the variable corresponding to the Cartesian axis of index i
.
std::length_error | Thrown if i+1 exceeds Variable::max_space_dimension() . |
Definition at line 38 of file Variable_inlines.hh.
|
static |
The default output function.
Definition at line 39 of file Variable.cc.
References id().
Referenced by Parma_Polyhedra_Library::Init::Init().
|
inline |
Returns the size in bytes of the memory managed by *this
.
Definition at line 57 of file Variable_inlines.hh.
Referenced by total_memory_in_bytes().
|
inlinestatic |
Returns the pointer to the current output function.
Definition at line 72 of file Variable_inlines.hh.
References current_output_function.
Referenced by Parma_Polyhedra_Library::Implementation::Termination::all_affine_quasi_ranking_functions_MS(), Parma_Polyhedra_Library::Implementation::Termination::all_affine_ranking_functions_MS(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR(), Parma_Polyhedra_Library::Implementation::Termination::fill_constraint_systems_MS(), Parma_Polyhedra_Library::Termination_Helpers::one_affine_ranking_function_PR(), and Parma_Polyhedra_Library::Implementation::Termination::termination_test_PR().
|
inline |
Returns the index of the Cartesian axis associated to the variable.
Definition at line 47 of file Variable_inlines.hh.
References varid.
Referenced by Parma_Polyhedra_Library::affine_form_image(), Parma_Polyhedra_Library::Box< ITV >::affine_form_image(), Parma_Polyhedra_Library::Octagonal_Shape< T >::affine_form_image(), Parma_Polyhedra_Library::BD_Shape< T >::affine_form_image(), Parma_Polyhedra_Library::Polyhedron::affine_form_image(), Parma_Polyhedra_Library::Box< ITV >::affine_image(), Parma_Polyhedra_Library::Octagonal_Shape< T >::affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::affine_image(), Parma_Polyhedra_Library::Box< ITV >::affine_preimage(), Parma_Polyhedra_Library::Octagonal_Shape< T >::affine_preimage(), Parma_Polyhedra_Library::BD_Shape< T >::affine_preimage(), Parma_Polyhedra_Library::Box< ITV >::bounded_affine_image(), Parma_Polyhedra_Library::Octagonal_Shape< T >::bounded_affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::bounded_affine_image(), Parma_Polyhedra_Library::Box< ITV >::bounded_affine_preimage(), 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::Linear_Expression_Impl< Row >::coefficient(), Parma_Polyhedra_Library::Linear_Form< C >::coefficient(), Parma_Polyhedra_Library::Polyhedron::constrains(), default_output_function(), Parma_Polyhedra_Library::Box< ITV >::expand_space_dimension(), Parma_Polyhedra_Library::Octagonal_Shape< T >::expand_space_dimension(), Parma_Polyhedra_Library::BD_Shape< T >::expand_space_dimension(), Parma_Polyhedra_Library::Implementation::Termination::fill_constraint_system_PR(), Parma_Polyhedra_Library::Implementation::Termination::fill_constraint_system_PR_original(), Parma_Polyhedra_Library::Implementation::Termination::fill_constraint_systems_MS(), Parma_Polyhedra_Library::Box< ITV >::fold_space_dimensions(), Parma_Polyhedra_Library::Octagonal_Shape< T >::fold_space_dimensions(), Parma_Polyhedra_Library::BD_Shape< T >::fold_space_dimensions(), Parma_Polyhedra_Library::Grid::fold_space_dimensions(), Parma_Polyhedra_Library::Polyhedron::fold_space_dimensions(), Parma_Polyhedra_Library::Box< ITV >::generalized_affine_image(), Parma_Polyhedra_Library::Octagonal_Shape< T >::generalized_affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::generalized_affine_image(), Parma_Polyhedra_Library::BD_Shape< T >::generalized_affine_preimage(), Parma_Polyhedra_Library::Octagonal_Shape< T >::generalized_affine_preimage(), Parma_Polyhedra_Library::Box< ITV >::get_interval(), Parma_Polyhedra_Library::Box< ITV >::has_lower_bound(), Parma_Polyhedra_Library::Box< ITV >::has_upper_bound(), Parma_Polyhedra_Library::BD_Shape< T >::incremental_shortest_path_closure_assign(), Parma_Polyhedra_Library::Octagonal_Shape< T >::incremental_strong_closure_assign(), Parma_Polyhedra_Library::Variables_Set::insert(), less(), Parma_Polyhedra_Library::Polyhedron::modify_according_to_evolution(), OK(), Parma_Polyhedra_Library::PIP_Solution_Node::parametric_values(), Parma_Polyhedra_Library::Box< ITV >::propagate_constraint_no_check(), Parma_Polyhedra_Library::Octagonal_Shape< T >::refine(), Parma_Polyhedra_Library::BD_Shape< T >::refine(), Parma_Polyhedra_Library::Box< ITV >::relation_with(), Parma_Polyhedra_Library::Box< ITV >::set_interval(), Parma_Polyhedra_Library::Linear_System< Row >::shift_space_dimensions(), Parma_Polyhedra_Library::Box< ITV >::unconstrain(), Parma_Polyhedra_Library::Octagonal_Shape< T >::unconstrain(), Parma_Polyhedra_Library::Variables_Set::Variables_Set(), and Parma_Polyhedra_Library::Implementation::wrap_assign_ind().
|
inline |
Swaps *this and v.
Definition at line 88 of file Variable_inlines.hh.
References swap(), Parma_Polyhedra_Library::swap(), and varid.
Referenced by Parma_Polyhedra_Library::swap().
|
inlinestatic |
Returns the maximum space dimension a Variable can handle.
Definition at line 33 of file Variable_inlines.hh.
References Parma_Polyhedra_Library::not_a_dimension().
Referenced by Parma_Polyhedra_Library::max_space_dimension(), Parma_Polyhedra_Library::Variables_Set::max_space_dimension(), and OK().
bool Parma_Polyhedra_Library::Variable::OK | ( | ) | const |
Checks if all the invariants are satisfied.
Definition at line 34 of file Variable.cc.
References id(), and max_space_dimension().
Referenced by Parma_Polyhedra_Library::Variables_Set::OK().
|
inlinestatic |
Sets the output function to be used for printing Variable objects.
Definition at line 67 of file Variable_inlines.hh.
References current_output_function.
Referenced by Parma_Polyhedra_Library::Implementation::Termination::all_affine_quasi_ranking_functions_MS(), Parma_Polyhedra_Library::Implementation::Termination::all_affine_ranking_functions_MS(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR_original(), Parma_Polyhedra_Library::Implementation::Termination::fill_constraint_systems_MS(), Parma_Polyhedra_Library::Init::Init(), Parma_Polyhedra_Library::Termination_Helpers::one_affine_ranking_function_PR(), and Parma_Polyhedra_Library::Implementation::Termination::termination_test_PR().
|
inline |
Returns the dimension of the vector space enclosing *this
.
The returned value is id()+1
.
Definition at line 52 of file Variable_inlines.hh.
References varid.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::add_mul_assign(), Parma_Polyhedra_Library::Box< ITV >::affine_form_image(), Parma_Polyhedra_Library::Grid_Generator_System::affine_image(), Parma_Polyhedra_Library::Generator_System::affine_image(), Parma_Polyhedra_Library::Box< ITV >::affine_image(), Parma_Polyhedra_Library::Grid::affine_image(), Parma_Polyhedra_Library::Polyhedron::affine_image(), Parma_Polyhedra_Library::Congruence::affine_preimage(), Parma_Polyhedra_Library::Constraint_System::affine_preimage(), Parma_Polyhedra_Library::Congruence_System::affine_preimage(), Parma_Polyhedra_Library::Box< ITV >::affine_preimage(), Parma_Polyhedra_Library::BD_Shape< T >::affine_preimage(), Parma_Polyhedra_Library::Grid::affine_preimage(), Parma_Polyhedra_Library::Polyhedron::affine_preimage(), Parma_Polyhedra_Library::Box< ITV >::bounded_affine_image(), Parma_Polyhedra_Library::Grid::bounded_affine_image(), Parma_Polyhedra_Library::Polyhedron::bounded_affine_image(), Parma_Polyhedra_Library::Box< ITV >::bounded_affine_preimage(), Parma_Polyhedra_Library::Grid::bounded_affine_preimage(), Parma_Polyhedra_Library::Polyhedron::bounded_affine_preimage(), Parma_Polyhedra_Library::Expression_Hide_Last< T >::coefficient(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::coefficient(), Parma_Polyhedra_Library::Congruence::coefficient(), Parma_Polyhedra_Library::Linear_Form< C >::coefficient(), Parma_Polyhedra_Library::Constraint::coefficient(), Parma_Polyhedra_Library::Grid_Generator::coefficient(), Parma_Polyhedra_Library::Generator::coefficient(), Parma_Polyhedra_Library::Pointset_Powerset< PSET >::constrains(), Parma_Polyhedra_Library::Box< ITV >::constrains(), Parma_Polyhedra_Library::Polyhedron::constrains(), Parma_Polyhedra_Library::Octagonal_Shape< T >::constrains(), Parma_Polyhedra_Library::Grid::constrains(), Parma_Polyhedra_Library::BD_Shape< T >::constrains(), Parma_Polyhedra_Library::BD_Shape< T >::deduce_u_minus_v_bounds(), Parma_Polyhedra_Library::Box< ITV >::expand_space_dimension(), Parma_Polyhedra_Library::BD_Shape< T >::expand_space_dimension(), Parma_Polyhedra_Library::Grid::expand_space_dimension(), Parma_Polyhedra_Library::Polyhedron::expand_space_dimension(), Parma_Polyhedra_Library::Box< ITV >::fold_space_dimensions(), Parma_Polyhedra_Library::Octagonal_Shape< T >::fold_space_dimensions(), Parma_Polyhedra_Library::BD_Shape< T >::fold_space_dimensions(), Parma_Polyhedra_Library::Grid::fold_space_dimensions(), Parma_Polyhedra_Library::Polyhedron::fold_space_dimensions(), Parma_Polyhedra_Library::BD_Shape< T >::frequency(), Parma_Polyhedra_Library::Box< ITV >::generalized_affine_image(), Parma_Polyhedra_Library::Grid::generalized_affine_image(), Parma_Polyhedra_Library::Polyhedron::generalized_affine_image(), Parma_Polyhedra_Library::Box< ITV >::generalized_affine_preimage(), Parma_Polyhedra_Library::Grid::generalized_affine_preimage(), Parma_Polyhedra_Library::Polyhedron::generalized_affine_preimage(), Parma_Polyhedra_Library::Expression_Hide_Last< T >::get(), Parma_Polyhedra_Library::Linear_Expression::get(), Parma_Polyhedra_Library::Box< ITV >::get_interval(), Parma_Polyhedra_Library::Expression_Hide_Last< T >::have_a_common_variable(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::have_a_common_variable(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl(), Parma_Polyhedra_Library::Linear_Form< C >::Linear_Form(), Parma_Polyhedra_Library::Expression_Hide_Last< T >::lower_bound(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::lower_bound(), Parma_Polyhedra_Library::Linear_Form< C >::operator+(), Parma_Polyhedra_Library::Linear_Expression::operator+(), Parma_Polyhedra_Library::Linear_Form< C >::operator+=(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::operator+=(), Parma_Polyhedra_Library::Linear_Expression::operator-(), Parma_Polyhedra_Library::Linear_Form< C >::operator-(), Parma_Polyhedra_Library::Linear_Form< C >::operator-=(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::operator-=(), Parma_Polyhedra_Library::Constraint::operator==(), Parma_Polyhedra_Library::Constraint::operator>(), Parma_Polyhedra_Library::Constraint::operator>=(), Parma_Polyhedra_Library::PIP_Solution_Node::parametric_values(), Parma_Polyhedra_Library::Octagonal_Shape< T >::relation_with(), Parma_Polyhedra_Library::Linear_Expression::set(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::set_coefficient(), Parma_Polyhedra_Library::Box< ITV >::set_interval(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::shift_space_dimensions(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::sub_mul_assign(), Parma_Polyhedra_Library::Linear_System< Row >::swap_space_dimensions(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::swap_space_dimensions(), Parma_Polyhedra_Library::Constraint::swap_space_dimensions(), Parma_Polyhedra_Library::Grid_Generator::swap_space_dimensions(), Parma_Polyhedra_Library::Generator::swap_space_dimensions(), Parma_Polyhedra_Library::Congruence::throw_dimension_incompatible(), Parma_Polyhedra_Library::Constraint::throw_dimension_incompatible(), Parma_Polyhedra_Library::Generator::throw_dimension_incompatible(), Parma_Polyhedra_Library::Grid_Generator::throw_dimension_incompatible(), Parma_Polyhedra_Library::Grid::throw_dimension_incompatible(), Parma_Polyhedra_Library::Polyhedron::throw_dimension_incompatible(), Parma_Polyhedra_Library::Polyhedron::unconstrain(), Parma_Polyhedra_Library::Grid::unconstrain(), and Parma_Polyhedra_Library::BD_Shape< T >::unconstrain().
|
inline |
Returns the total size in bytes of the memory occupied by *this
.
Definition at line 62 of file Variable_inlines.hh.
References external_memory_in_bytes().
|
friend |
Definition at line 144 of file Variable_defs.hh.
Defines a total ordering on variables.
Referenced by Parma_Polyhedra_Library::Variable::Compare::operator()().
Definition at line 78 of file Variable_inlines.hh.
References id().
|
related |
Output operator.
|
related |
Definition at line 51 of file Variable.cc.
|
friend |
Definition at line 94 of file Variable_inlines.hh.
Referenced by m_swap().
|
staticprivate |
Pointer to the current output function.
Definition at line 151 of file Variable_defs.hh.
Referenced by get_output_function(), and set_output_function().
|
private |
The index of the Cartesian axis.
Definition at line 141 of file Variable_defs.hh.
Referenced by id(), m_swap(), and space_dimension().