PPL
1.2
|
A linear expression. More...
#include <Linear_Expression_Impl_defs.hh>
Classes | |
class | const_iterator |
Public Member Functions | |
Linear_Expression_Impl () | |
Default constructor: returns a copy of Linear_Expression_Impl::zero(). More... | |
Linear_Expression_Impl (const Linear_Expression_Impl &e) | |
Ordinary copy constructor. More... | |
template<typename Row2 > | |
Linear_Expression_Impl (const Linear_Expression_Impl< Row2 > &e) | |
Copy constructor for other row types. More... | |
Linear_Expression_Impl (const Linear_Expression_Interface &e) | |
Copy constructor from any implementation of Linear_Expression_Interface. More... | |
virtual | ~Linear_Expression_Impl () |
Destructor. More... | |
virtual bool | OK () const |
Checks if all the invariants are satisfied. More... | |
Linear_Expression_Impl (Coefficient_traits::const_reference n) | |
Builds the linear expression corresponding to the inhomogeneous term n . More... | |
Linear_Expression_Impl (Variable v) | |
Builds the linear expression corresponding to the variable v . More... | |
virtual Representation | representation () const |
Returns the current representation of this linear expression. More... | |
virtual const_iterator_interface * | begin () const |
virtual const_iterator_interface * | end () const |
virtual const_iterator_interface * | lower_bound (Variable v) const |
virtual dimension_type | space_dimension () const |
Returns the dimension of the vector space enclosing *this . More... | |
virtual void | set_space_dimension (dimension_type n) |
Sets the dimension of the vector space enclosing *this to n . More... | |
virtual Coefficient_traits::const_reference | coefficient (Variable v) const |
Returns the coefficient of v in *this . More... | |
virtual void | set_coefficient (Variable v, Coefficient_traits::const_reference n) |
Sets the coefficient of v in *this to n . More... | |
virtual Coefficient_traits::const_reference | inhomogeneous_term () const |
Returns the inhomogeneous term of *this . More... | |
virtual void | set_inhomogeneous_term (Coefficient_traits::const_reference n) |
Sets the inhomogeneous term of *this to n . More... | |
virtual void | linear_combine (const Linear_Expression_Interface &y, Variable v) |
virtual void | linear_combine (const Linear_Expression_Interface &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2) |
virtual void | linear_combine_lax (const Linear_Expression_Interface &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2) |
virtual void | swap_space_dimensions (Variable v1, Variable v2) |
Swaps the coefficients of the variables v1 and v2 . More... | |
virtual void | remove_space_dimensions (const Variables_Set &vars) |
Removes all the specified dimensions from the expression. More... | |
virtual void | shift_space_dimensions (Variable v, dimension_type n) |
virtual void | permute_space_dimensions (const std::vector< Variable > &cycle) |
Permutes the space dimensions of the expression. More... | |
virtual bool | is_zero () const |
Returns true if and only if *this is ![]() | |
virtual bool | all_homogeneous_terms_are_zero () const |
Returns true if and only if all the homogeneous terms of *this are ![]() | |
virtual memory_size_type | total_memory_in_bytes () const |
Returns a lower bound to the total size in bytes of the memory occupied by *this . More... | |
virtual memory_size_type | external_memory_in_bytes () const |
Returns the size in bytes of the memory managed by *this . More... | |
virtual void | ascii_dump (std::ostream &s) const |
Writes to s an ASCII representation of *this . More... | |
virtual bool | ascii_load (std::istream &s) |
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise. More... | |
Linear_Expression_Impl (const Linear_Expression_Interface &e, dimension_type space_dim) | |
Copy constructor with a specified space dimension. More... | |
virtual bool | is_equal_to (const Linear_Expression_Interface &x) const |
virtual void | normalize () |
virtual void | sign_normalize () |
virtual void | negate (dimension_type first, dimension_type last) |
Negates the elements from index first (included) to index last (excluded). More... | |
virtual Linear_Expression_Impl & | operator+= (Coefficient_traits::const_reference n) |
virtual Linear_Expression_Impl & | operator-= (Coefficient_traits::const_reference n) |
virtual Linear_Expression_Impl & | operator+= (const Linear_Expression_Interface &e2) |
virtual Linear_Expression_Impl & | operator+= (const Variable v) |
virtual Linear_Expression_Impl & | operator-= (const Linear_Expression_Interface &e2) |
virtual Linear_Expression_Impl & | operator-= (const Variable v) |
virtual Linear_Expression_Impl & | operator*= (Coefficient_traits::const_reference n) |
virtual Linear_Expression_Impl & | operator/= (Coefficient_traits::const_reference n) |
virtual void | negate () |
virtual Linear_Expression_Impl & | add_mul_assign (Coefficient_traits::const_reference n, const Variable v) |
virtual Linear_Expression_Impl & | sub_mul_assign (Coefficient_traits::const_reference n, const Variable v) |
virtual void | add_mul_assign (Coefficient_traits::const_reference factor, const Linear_Expression_Interface &e2) |
virtual void | sub_mul_assign (Coefficient_traits::const_reference factor, const Linear_Expression_Interface &e2) |
virtual void | print (std::ostream &s) const |
virtual bool | all_zeroes (const Variables_Set &vars) const |
Returns true if the coefficient of each variable in vars [i] is ![]() | |
virtual bool | have_a_common_variable (const Linear_Expression_Interface &x, Variable first, Variable last) const |
virtual Coefficient_traits::const_reference | get (dimension_type i) const |
Returns the i-th coefficient. More... | |
virtual void | set (dimension_type i, Coefficient_traits::const_reference n) |
Sets the i-th coefficient to n. More... | |
virtual bool | all_zeroes (dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is ![]() | |
virtual dimension_type | num_zeroes (dimension_type start, dimension_type end) const |
Returns the number of zero coefficient in [start, end). More... | |
virtual Coefficient | gcd (dimension_type start, dimension_type end) const |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0. More... | |
virtual void | exact_div_assign (Coefficient_traits::const_reference c, dimension_type start, dimension_type end) |
virtual void | mul_assign (Coefficient_traits::const_reference n, dimension_type start, dimension_type end) |
Equivalent to (*this)[i] *= n , for each i in [start, end). More... | |
virtual void | linear_combine (const Linear_Expression_Interface &y, dimension_type i) |
virtual void | linear_combine (const Linear_Expression_Interface &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) |
virtual void | linear_combine_lax (const Linear_Expression_Interface &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) |
virtual dimension_type | last_nonzero () const |
virtual bool | all_zeroes_except (const Variables_Set &vars, dimension_type start, dimension_type end) const |
Returns true if each coefficient in [start,end) is *not* in ![]() vars . More... | |
virtual void | scalar_product_assign (Coefficient &result, const Linear_Expression_Interface &y, dimension_type start, dimension_type end) const |
Sets results to the sum of (*this)[i]*y[i], for each i in [start,end). More... | |
virtual int | scalar_product_sign (const Linear_Expression_Interface &y, dimension_type start, dimension_type end) const |
Computes the sign of the sum of (*this)[i]*y[i], for each i in [start,end). More... | |
virtual dimension_type | first_nonzero (dimension_type first, dimension_type last) const |
virtual dimension_type | last_nonzero (dimension_type first, dimension_type last) const |
virtual void | has_a_free_dimension_helper (std::set< dimension_type > &x) const |
Removes from the set x all the indexes of nonzero elements of *this. More... | |
virtual bool | is_equal_to (const Linear_Expression_Interface &x, dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is equal to x[i], for each i in [start,end). More... | |
virtual bool | is_equal_to (const Linear_Expression_Interface &x, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const |
virtual void | get_row (Dense_Row &r) const |
Sets r to a copy of the row that implements *this . More... | |
virtual void | get_row (Sparse_Row &r) const |
Sets r to a copy of the row that implements *this . More... | |
Linear_Expression_Impl (dimension_type space_dim, bool) | |
Implementation sizing constructor. More... | |
template<typename Row2 > | |
void | linear_combine (const Linear_Expression_Impl< Row2 > &y, Variable v) |
template<typename Row2 > | |
void | linear_combine (const Linear_Expression_Impl< Row2 > &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2) |
template<typename Row2 > | |
void | linear_combine_lax (const Linear_Expression_Impl< Row2 > &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2) |
template<typename Row2 > | |
bool | is_equal_to (const Linear_Expression_Impl< Row2 > &x) const |
template<typename Row2 > | |
Linear_Expression_Impl & | operator+= (const Linear_Expression_Impl< Row2 > &e2) |
template<typename Row2 > | |
Linear_Expression_Impl & | operator-= (const Linear_Expression_Impl< Row2 > &e2) |
template<typename Row2 > | |
Linear_Expression_Impl & | sub_mul_assign (Coefficient_traits::const_reference n, const Linear_Expression_Impl< Row2 > &y, dimension_type start, dimension_type end) |
template<typename Row2 > | |
void | add_mul_assign (Coefficient_traits::const_reference factor, const Linear_Expression_Impl< Row2 > &e2) |
template<typename Row2 > | |
void | sub_mul_assign (Coefficient_traits::const_reference factor, const Linear_Expression_Impl< Row2 > &e2) |
template<typename Row2 > | |
void | linear_combine (const Linear_Expression_Impl< Row2 > &y, dimension_type i) |
template<typename Row2 > | |
void | linear_combine (const Linear_Expression_Impl< Row2 > &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) |
template<typename Row2 > | |
void | linear_combine_lax (const Linear_Expression_Impl< Row2 > &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) |
template<typename Row2 > | |
void | scalar_product_assign (Coefficient &result, const Linear_Expression_Impl< Row2 > &y, dimension_type start, dimension_type end) const |
Sets results to the sum of (*this)[i]*y[i], for each i in [start,end). More... | |
template<typename Row2 > | |
int | scalar_product_sign (const Linear_Expression_Impl< Row2 > &y, dimension_type start, dimension_type end) const |
template<typename Row2 > | |
bool | is_equal_to (const Linear_Expression_Impl< Row2 > &x, dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is equal to x[i], for each i in [start,end). More... | |
template<typename Row2 > | |
bool | is_equal_to (const Linear_Expression_Impl< Row2 > &x, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const |
template<typename Row2 > | |
bool | have_a_common_variable (const Linear_Expression_Impl< Row2 > &x, Variable first, Variable last) const |
template<> | |
bool | OK () const |
template<> | |
bool | OK () const |
template<> | |
void | remove_space_dimensions (const Variables_Set &vars) |
Removes all the specified dimensions from the expression. More... | |
template<> | |
void | remove_space_dimensions (const Variables_Set &vars) |
Removes all the specified dimensions from the expression. More... | |
template<> | |
bool | is_zero () const |
Returns true if and only if *this is ![]() | |
template<> | |
bool | all_homogeneous_terms_are_zero () const |
Returns true if and only if all the homogeneous terms of *this are ![]() | |
template<> | |
bool | all_zeroes (dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is ![]() | |
template<> | |
dimension_type | num_zeroes (dimension_type start, dimension_type end) const |
Returns the number of zero coefficient in [start, end). More... | |
template<> | |
Coefficient | gcd (dimension_type start, dimension_type end) const |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0. More... | |
template<> | |
Coefficient | gcd (dimension_type start, dimension_type end) const |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0. More... | |
template<> | |
bool | all_zeroes (const Variables_Set &vars) const |
Returns true if the coefficient of each variable in vars [i] is ![]() | |
template<> | |
bool | all_zeroes (const Variables_Set &vars) const |
Returns true if the coefficient of each variable in vars [i] is ![]() | |
template<> | |
bool | all_zeroes_except (const Variables_Set &vars, dimension_type start, dimension_type end) const |
Returns true if each coefficient in [start,end) is *not* in ![]() vars . More... | |
template<> | |
bool | all_zeroes_except (const Variables_Set &vars, dimension_type start, dimension_type end) const |
Returns true if each coefficient in [start,end) is *not* in ![]() vars . More... | |
template<> | |
dimension_type | last_nonzero () const |
template<> | |
dimension_type | first_nonzero (dimension_type first, dimension_type last) const |
template<> | |
dimension_type | last_nonzero (dimension_type first, dimension_type last) const |
template<> | |
void | has_a_free_dimension_helper (std::set< dimension_type > &x) const |
Removes from the set x all the indexes of nonzero elements of *this. More... | |
template<> | |
void | has_a_free_dimension_helper (std::set< dimension_type > &x) const |
Removes from the set x all the indexes of nonzero elements of *this. More... | |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Dense_Row > &y, Variable first, Variable last) const |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Dense_Row > &y, Variable first, Variable last) const |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Sparse_Row > &y, Variable first, Variable last) const |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Sparse_Row > &y, Variable first, Variable last) const |
template<> | |
bool | OK () const |
template<> | |
bool | OK () const |
template<> | |
bool | all_homogeneous_terms_are_zero () const |
Returns true if and only if all the homogeneous terms of *this are ![]() | |
template<> | |
bool | all_homogeneous_terms_are_zero () const |
Returns true if and only if all the homogeneous terms of *this are ![]() | |
template<> | |
bool | all_zeroes (dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is ![]() | |
template<> | |
bool | all_zeroes (dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is ![]() | |
template<> | |
bool | all_zeroes (const Variables_Set &vars) const |
Returns true if the coefficient of each variable in vars [i] is ![]() | |
template<> | |
bool | all_zeroes (const Variables_Set &vars) const |
Returns true if the coefficient of each variable in vars [i] is ![]() | |
template<> | |
bool | all_zeroes_except (const Variables_Set &vars, dimension_type start, dimension_type end) const |
Returns true if each coefficient in [start,end) is *not* in ![]() vars . More... | |
template<> | |
bool | all_zeroes_except (const Variables_Set &vars, dimension_type start, dimension_type end) const |
Returns true if each coefficient in [start,end) is *not* in ![]() vars . More... | |
template<> | |
dimension_type | first_nonzero (dimension_type first, dimension_type last) const |
template<> | |
dimension_type | first_nonzero (dimension_type first, dimension_type last) const |
template<> | |
Coefficient | gcd (dimension_type start, dimension_type end) const |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0. More... | |
template<> | |
Coefficient | gcd (dimension_type start, dimension_type end) const |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0. More... | |
template<> | |
void | has_a_free_dimension_helper (std::set< dimension_type > &x) const |
Removes from the set x all the indexes of nonzero elements of *this. More... | |
template<> | |
void | has_a_free_dimension_helper (std::set< dimension_type > &x) const |
Removes from the set x all the indexes of nonzero elements of *this. More... | |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Dense_Row > &y, Variable first, Variable last) const |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Sparse_Row > &y, Variable first, Variable last) const |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Dense_Row > &y, Variable first, Variable last) const |
template<> | |
bool | have_a_common_variable (const Linear_Expression_Impl< Sparse_Row > &y, Variable first, Variable last) const |
template<> | |
bool | is_zero () const |
Returns true if and only if *this is ![]() | |
template<> | |
bool | is_zero () const |
Returns true if and only if *this is ![]() | |
template<> | |
dimension_type | last_nonzero () const |
template<> | |
dimension_type | last_nonzero () const |
template<> | |
dimension_type | last_nonzero (dimension_type first, dimension_type last) const |
template<> | |
dimension_type | last_nonzero (dimension_type first, dimension_type last) const |
template<> | |
dimension_type | num_zeroes (dimension_type start, dimension_type end) const |
Returns the number of zero coefficient in [start, end). More... | |
template<> | |
dimension_type | num_zeroes (dimension_type start, dimension_type end) const |
Returns the number of zero coefficient in [start, end). More... | |
template<> | |
void | remove_space_dimensions (const Variables_Set &vars) |
Removes all the specified dimensions from the expression. More... | |
template<> | |
void | remove_space_dimensions (const Variables_Set &vars) |
Removes all the specified dimensions from the expression. More... | |
template<> | |
Representation | representation () const |
Returns the current representation of this linear expression. More... | |
template<> | |
Representation | representation () const |
Returns the current representation of this linear expression. More... | |
template<> | |
bool | is_zero () const |
Returns true if and only if *this is ![]() | |
template<> | |
bool | all_homogeneous_terms_are_zero () const |
Returns true if and only if all the homogeneous terms of *this are ![]() | |
template<> | |
bool | all_zeroes (dimension_type start, dimension_type end) const |
Returns true if (*this)[i] is ![]() | |
template<> | |
dimension_type | num_zeroes (dimension_type start, dimension_type end) const |
Returns the number of zero coefficient in [start, end). More... | |
template<> | |
dimension_type | last_nonzero () const |
template<> | |
dimension_type | first_nonzero (dimension_type first, dimension_type last) const |
template<> | |
dimension_type | last_nonzero (dimension_type first, dimension_type last) const |
template<> | |
Representation | representation () const |
Returns the current representation of this linear expression. More... | |
template<> | |
Representation | representation () const |
Returns the current representation of this linear expression. More... | |
template<typename Row2 > | |
Linear_Expression_Impl< Row > & | operator+= (const Linear_Expression_Impl< Row2 > &e) |
![]() | |
virtual | ~Linear_Expression_Interface () |
Static Public Member Functions | |
static dimension_type | max_space_dimension () |
Returns the maximum space dimension a Linear_Expression_Impl can handle. More... | |
Private Member Functions | |
void | construct (const Linear_Expression_Interface &e) |
void | construct (const Linear_Expression_Interface &e, dimension_type space_dim) |
template<typename Row2 > | |
void | construct (const Linear_Expression_Impl< Row2 > &e) |
template<typename Row2 > | |
void | construct (const Linear_Expression_Impl< Row2 > &e, dimension_type space_dim) |
Private Attributes | |
Row | row |
Friends | |
template<typename Row2 > | |
class | Linear_Expression_Impl |
Related Functions | |
(Note that these are not member functions.) | |
virtual int | compare (const Linear_Expression_Interface &y) const |
The basic comparison function. More... | |
template<typename Row2 > | |
int | compare (const Linear_Expression_Impl< Row2 > &y) const |
The basic comparison function. More... | |
template<typename Row > | |
std::ostream & | operator<< (std::ostream &s, const Linear_Expression_Impl< Row > &e) |
Output operator. More... | |
template<typename Row > | |
Linear_Expression_Impl< Row > & | operator+= (const Variable v) |
template<typename Row2 > | |
Linear_Expression_Impl< Row > & | operator-= (const Linear_Expression_Impl< Row2 > &e2) |
template<typename Row > | |
Linear_Expression_Impl< Row > & | operator-= (const Variable v) |
template<typename Row > | |
Linear_Expression_Impl< Row > & | operator*= (Coefficient_traits::const_reference n) |
template<typename Row > | |
Linear_Expression_Impl< Row > & | operator/= (Coefficient_traits::const_reference n) |
template<typename Row > | |
void | negate () |
template<typename Row > | |
Linear_Expression_Impl< Row > & | add_mul_assign (Coefficient_traits::const_reference n, const Variable v) |
template<typename Row > | |
Linear_Expression_Impl< Row > & | sub_mul_assign (Coefficient_traits::const_reference n, const Variable v) |
A linear expression.
An object of the class Linear_Expression_Impl represents the linear expression
where is the dimension of the vector space, each
is the integer coefficient of the
-th variable
and
is the integer for the inhomogeneous term.
Linear expressions are the basic blocks for defining both constraints (i.e., linear equalities or inequalities) and generators (i.e., lines, rays, points and closure points). A full set of functions is defined to provide a convenient interface for building complex linear expressions starting from simpler ones and from objects of the classes Variable and Coefficient: available operators include unary negation, binary addition and subtraction, as well as multiplication by a Coefficient. The space dimension of a linear expression is defined as the maximum space dimension of the arguments used to build it: in particular, the space dimension of a Variable x
is defined as x.id()+1
, whereas all the objects of the class Coefficient have space dimension zero.
e1
, e2
and e3
have space dimension 1, 2 and 3, respectively; also, in the fourth line of code, e
is created with space dimension zero and then extended to space dimension 3 in the fifth line. Definition at line 103 of file Linear_Expression_Impl_defs.hh.
|
inline |
Default constructor: returns a copy of Linear_Expression_Impl::zero().
Definition at line 40 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::OK().
Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl | ( | const Linear_Expression_Impl< Row > & | e | ) |
Ordinary copy constructor.
Definition at line 41 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::construct().
Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl | ( | const Linear_Expression_Impl< Row2 > & | e | ) |
Copy constructor for other row types.
Definition at line 48 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::construct().
Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl | ( | const Linear_Expression_Interface & | e | ) |
Copy constructor from any implementation of Linear_Expression_Interface.
Definition at line 54 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::construct().
|
inlinevirtual |
|
inlineexplicit |
Builds the linear expression corresponding to the inhomogeneous term n
.
Definition at line 61 of file Linear_Expression_Impl_inlines.hh.
Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl | ( | Variable | v | ) |
Builds the linear expression corresponding to the variable v
.
std::length_error | Thrown if the space dimension of v exceeds Linear_Expression_Impl::max_space_dimension() . |
Definition at line 221 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::max_space_dimension(), and Parma_Polyhedra_Library::Variable::space_dimension().
Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl | ( | const Linear_Expression_Interface & | e, |
dimension_type | space_dim | ||
) |
Copy constructor with a specified space dimension.
Definition at line 71 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::construct().
|
inline |
Implementation sizing constructor.
The bool parameter is just to avoid problems with the constructor Linear_Expression_Impl(Coefficient_traits::const_reference n).
Definition at line 48 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1013 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::add_mul_assign().
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::add_mul_assign | ( | Coefficient_traits::const_reference | factor, |
const Linear_Expression_Impl< Row2 > & | e2 | ||
) |
Definition at line 449 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Coefficient_one(), and Parma_Polyhedra_Library::linear_combine().
|
virtual |
Returns true
if and only if all the homogeneous terms of *this
are .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 152 of file Linear_Expression_Impl.cc.
|
inlinevirtual |
Returns true
if and only if all the homogeneous terms of *this
are .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 191 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Returns true
if and only if all the homogeneous terms of *this
are .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if and only if all the homogeneous terms of *this
are .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if and only if all the homogeneous terms of *this
are .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if (*this)[i] is , for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 163 of file Linear_Expression_Impl.cc.
|
inlinevirtual |
Returns true
if (*this)[i] is , for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 197 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Returns true
if the coefficient of each variable in vars
[i] is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 258 of file Linear_Expression_Impl.cc.
|
virtual |
Returns true
if the coefficient of each variable in vars
[i] is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 274 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::CO_Tree::const_iterator::index().
|
virtual |
Returns true
if the coefficient of each variable in vars
[i] is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::is_equal_to().
|
virtual |
Returns true
if (*this)[i] is , for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if (*this)[i] is , for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if (*this)[i] is , for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if the coefficient of each variable in vars
[i] is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if the coefficient of each variable in vars
[i] is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if each coefficient in [start,end) is *not* in , disregarding coefficients of variables in
vars
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 296 of file Linear_Expression_Impl.cc.
|
virtual |
Returns true
if each coefficient in [start,end) is *not* in , disregarding coefficients of variables in
vars
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 315 of file Linear_Expression_Impl.cc.
|
virtual |
Returns true
if each coefficient in [start,end) is *not* in , disregarding coefficients of variables in
vars
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if each coefficient in [start,end) is *not* in , disregarding coefficients of variables in
vars
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if each coefficient in [start,end) is *not* in , disregarding coefficients of variables in
vars
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Writes to s
an ASCII representation of *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1342 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::space_dimension().
|
virtual |
Loads from s
an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this
accordingly. Returns true
if successful, false
otherwise.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1354 of file Linear_Expression_Impl_templates.hh.
References c, Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::OK(), PPL_DIRTY_TEMP_COEFFICIENT, and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
|
virtual |
This returns a pointer to dynamic-allocated memory. The caller has the duty to free the memory when it's not needed anymore.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1267 of file Linear_Expression_Impl_templates.hh.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::operator/=().
|
inlinevirtual |
Returns the coefficient of v
in *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 84 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::Coefficient_zero(), Parma_Polyhedra_Library::Variable::id(), and Parma_Polyhedra_Library::Variable::space_dimension().
|
private |
Definition at line 1130 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::construct().
|
private |
Definition at line 1147 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::construct().
|
private |
Definition at line 709 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
|
private |
Definition at line 717 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, and Parma_Polyhedra_Library::swap().
|
virtual |
This returns a pointer to dynamic-allocated memory. The caller has the duty to free the memory when it's not needed anymore.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1273 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 545 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::exact_div_assign().
|
inlinevirtual |
Returns the size in bytes of the memory managed by *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 142 of file Linear_Expression_Impl_inlines.hh.
|
inlinevirtual |
Returns the index of the first nonzero element, or last
if there are no nonzero elements, considering only elements in [first,last).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 225 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::const_iterator::index().
|
virtual |
Returns the index of the first nonzero element, or last
if there are no nonzero elements, considering only elements in [first,last).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 355 of file Linear_Expression_Impl.cc.
|
virtual |
Returns the index of the first nonzero element, or last
if there are no nonzero elements, considering only elements in [first,last).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the first nonzero element, or last
if there are no nonzero elements, considering only elements in [first,last).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the first nonzero element, or last
if there are no nonzero elements, considering only elements in [first,last).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 189 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::gcd_assign(), and Parma_Polyhedra_Library::neg_assign().
|
virtual |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 227 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::gcd_assign(), and Parma_Polyhedra_Library::neg_assign().
|
virtual |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are 0 returns 0.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the i-th coefficient.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 525 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Sets r
to a copy of the row that implements *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 243 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Sets r
to a copy of the row that implements *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 249 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Removes from the set x all the indexes of nonzero elements of *this.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 385 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::swap().
|
virtual |
Removes from the set x all the indexes of nonzero elements of *this.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 400 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::CO_Tree::const_iterator::index(), and Parma_Polyhedra_Library::swap().
|
virtual |
Removes from the set x all the indexes of nonzero elements of *this.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Removes from the set x all the indexes of nonzero elements of *this.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Removes from the set x all the indexes of nonzero elements of *this.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true if there is a variable in [first,last) whose coefficient is nonzero in both *this and x.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1248 of file Linear_Expression_Impl_templates.hh.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::have_a_common_variable().
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Dense_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Dense_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
Definition at line 427 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, Parma_Polyhedra_Library::Dense_Row::size(), and Parma_Polyhedra_Library::Variable::space_dimension().
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Sparse_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Dense_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
Definition at line 446 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, Parma_Polyhedra_Library::Dense_Row::size(), and Parma_Polyhedra_Library::Variable::space_dimension().
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Dense_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Sparse_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
Definition at line 466 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::have_a_common_variable().
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Sparse_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Sparse_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
Definition at line 475 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::CO_Tree::const_iterator::index(), Parma_Polyhedra_Library::Sparse_Row::lower_bound(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, Parma_Polyhedra_Library::Sparse_Row::size(), and Parma_Polyhedra_Library::Variable::space_dimension().
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Row2 > & | x, |
Variable | first, | ||
Variable | last | ||
) | const |
Returns true if there is a variable in [first,last) whose coefficient is nonzero in both *this and x.
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Dense_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Dense_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Dense_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Sparse_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Sparse_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Dense_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Sparse_Row >::have_a_common_variable | ( | const Linear_Expression_Impl< Sparse_Row > & | y, |
Variable | first, | ||
Variable | last | ||
) | const |
|
inlinevirtual |
Returns the inhomogeneous term of *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 108 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Returns true
if *this is equal to x
. Note that (*this == x) has a completely different meaning.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 956 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Returns true
if (*this)[i] is equal to x[i], for each i in [start,end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1206 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Returns true
if (*this)[i]*c1 is equal to x[i]*c2, for each i in [start,end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1226 of file Linear_Expression_Impl_templates.hh.
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::is_equal_to | ( | const Linear_Expression_Impl< Row2 > & | x | ) | const |
Returns true
if *this is equal to x
. Note that (*this == x) has a completely different meaning.
Definition at line 237 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::is_equal_to | ( | const Linear_Expression_Impl< Row2 > & | x, |
dimension_type | start, | ||
dimension_type | end | ||
) | const |
Returns true
if (*this)[i] is equal to x[i], for each i in [start,end).
Definition at line 778 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
bool Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::is_equal_to | ( | const Linear_Expression_Impl< Row2 > & | x, |
Coefficient_traits::const_reference | c1, | ||
Coefficient_traits::const_reference | c2, | ||
dimension_type | start, | ||
dimension_type | end | ||
) | const |
Returns true
if (*this)[i]*c1 is equal to x[i]*c2, for each i in [start,end).
Definition at line 830 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::all_zeroes(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
|
virtual |
Returns true
if and only if *this
is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 141 of file Linear_Expression_Impl.cc.
|
inlinevirtual |
Returns true
if and only if *this
is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 185 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Returns true
if and only if *this
is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if and only if *this
is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns true
if and only if *this
is .
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
inlinevirtual |
Returns the index of the last nonzero element, or 0 if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 213 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::const_iterator::index().
|
inlinevirtual |
Returns the index of the last nonzero element in [first,last), or last if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 241 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::const_iterator::index().
|
virtual |
Returns the index of the last nonzero element, or 0 if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 343 of file Linear_Expression_Impl.cc.
|
virtual |
Returns the index of the last nonzero element in [first,last), or last if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 370 of file Linear_Expression_Impl.cc.
|
virtual |
Returns the index of the last nonzero element, or 0 if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the last nonzero element in [first,last), or last if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the last nonzero element, or 0 if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the last nonzero element, or 0 if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the last nonzero element in [first,last), or last if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the index of the last nonzero element in [first,last), or last if there are no nonzero elements.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Linearly combines *this
with y
so that the coefficient of v
is 0.
y | The expression that will be combined with *this object; |
v | The variable whose coefficient has to become ![]() |
Computes a linear combination of *this
and y
having the coefficient of variable v
equal to . Then it assigns the resulting expression to
*this
.
*this
and y
must have the same space dimension.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 898 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine().
|
virtual |
Equivalent to *this = *this * c1 + y * c2
, but assumes that *this
and y
have the same space dimension.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 916 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine().
|
virtual |
Linearly combines *this
with y
so that the coefficient of v
is 0.
y | The expression that will be combined with *this object; |
i | The index of the coefficient that has to become ![]() |
Computes a linear combination of *this
and y
having the i-th coefficient equal to . Then it assigns the resulting expression to
*this
.
*this
and y
must have the same space dimension.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1051 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine().
|
virtual |
Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2
, for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1069 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine().
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine | ( | const Linear_Expression_Impl< Row2 > & | y, |
Variable | v | ||
) |
Linearly combines *this
with y
so that the coefficient of v
is 0.
y | The expression that will be combined with *this object; |
v | The variable whose coefficient has to become ![]() |
Computes a linear combination of *this
and y
having the coefficient of variable v
equal to . Then it assigns the resulting expression to
*this
.
*this
and y
must have the same space dimension.
Definition at line 91 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine(), Parma_Polyhedra_Library::Variable::space_dimension(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::space_dimension().
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine | ( | const Linear_Expression_Impl< Row2 > & | y, |
Coefficient_traits::const_reference | c1, | ||
Coefficient_traits::const_reference | c2 | ||
) |
Equivalent to *this = *this * c1 + y * c2
, but assumes that *this
and y
have the same space dimension.
Definition at line 124 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::space_dimension().
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine | ( | const Linear_Expression_Impl< Row2 > & | y, |
dimension_type | i | ||
) |
Linearly combines *this
with y
so that the coefficient of v
is 0.
y | The expression that will be combined with *this object; |
i | The index of the coefficient that has to become ![]() |
Computes a linear combination of *this
and y
having the i-th coefficient equal to . Then it assigns the resulting expression to
*this
.
*this
and y
must have the same space dimension.
Definition at line 101 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine(), Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::normalize2(), PPL_DIRTY_TEMP_COEFFICIENT, Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::space_dimension().
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine | ( | const Linear_Expression_Impl< Row2 > & | y, |
Coefficient_traits::const_reference | c1, | ||
Coefficient_traits::const_reference | c2, | ||
dimension_type | start, | ||
dimension_type | end | ||
) |
Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2
, for each i in [start, end).
Definition at line 583 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
|
virtual |
Equivalent to *this = *this * c1 + y * c2
. c1 and c2 may be 0.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 936 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2
, for each i in [start, end). c1 and c2 may be zero.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1090 of file Linear_Expression_Impl_templates.hh.
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine_lax | ( | const Linear_Expression_Impl< Row2 > & | y, |
Coefficient_traits::const_reference | c1, | ||
Coefficient_traits::const_reference | c2 | ||
) |
Equivalent to *this = *this * c1 + y * c2
. c1 and c2 may be 0.
Definition at line 140 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::space_dimension().
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine_lax | ( | const Linear_Expression_Impl< Row2 > & | y, |
Coefficient_traits::const_reference | c1, | ||
Coefficient_traits::const_reference | c2, | ||
dimension_type | start, | ||
dimension_type | end | ||
) |
Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2
, for each i in [start, end). c1 and c2 may be zero.
Definition at line 595 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::linear_combine(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
|
virtual |
This returns a pointer to dynamic-allocated memory. The caller has the duty to free the memory when it's not needed anymore. Returns (a pointer to) an iterator that points to the first nonzero coefficient of a variable greater than or equal to v, or at end if no such coefficient exists.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1279 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
inlinestatic |
Returns the maximum space dimension a Linear_Expression_Impl can handle.
Definition at line 34 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Equivalent to (*this)[i] *= n
, for each i in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 560 of file Linear_Expression_Impl_templates.hh.
References c.
|
virtual |
Negates the elements from index first
(included) to index last
(excluded).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 695 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::neg_assign().
|
virtual |
|
inlinevirtual |
Normalizes the modulo of the coefficients and of the inhomogeneous term so that they are mutually prime.
Computes the Greatest Common Divisor (GCD) among the coefficients and the inhomogeneous term and normalizes them by the GCD itself.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 178 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Returns the number of zero coefficient in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 175 of file Linear_Expression_Impl.cc.
|
inlinevirtual |
Returns the number of zero coefficient in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 204 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Returns the number of zero coefficient in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the number of zero coefficient in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the number of zero coefficient in [start, end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 35 of file Linear_Expression_Impl.cc.
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 41 of file Linear_Expression_Impl.cc.
|
virtual |
Checks if all the invariants are satisfied.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1389 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::ascii_load(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::Linear_Expression_Impl().
|
virtual |
|
virtual |
|
virtual |
Linear_Expression_Impl<Row>& Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::operator+= | ( | const Linear_Expression_Impl< Row2 > & | e | ) |
Definition at line 287 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Coefficient_one(), and Parma_Polyhedra_Library::linear_combine().
|
inlinevirtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 154 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 975 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Linear_Expression_Impl& Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::operator+= | ( | const Linear_Expression_Impl< Row2 > & | e2 | ) |
|
inlinevirtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 166 of file Linear_Expression_Impl_inlines.hh.
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 994 of file Linear_Expression_Impl_templates.hh.
|
virtual |
Linear_Expression_Impl& Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::operator-= | ( | const Linear_Expression_Impl< Row2 > & | e2 | ) |
|
virtual |
|
virtual |
Permutes the space dimensions of the expression.
cycle | A vector representing a cycle of the permutation according to which the space dimensions must be rearranged. |
The cycle
vector represents a cycle of a permutation of space dimensions. For example, the permutation can be represented by the vector containing
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 256 of file Linear_Expression_Impl_templates.hh.
References PPL_DIRTY_TEMP_COEFFICIENT, and Parma_Polyhedra_Library::swap().
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 469 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Coefficient_zero(), Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::IO_Operators::operator<<(), and PPL_DIRTY_TEMP_COEFFICIENT.
|
virtual |
Removes all the specified dimensions from the expression.
The space dimension of the variable with the highest space dimension in vars
must be at most the space dimension of this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 61 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::Variables_Set::space_dimension().
|
virtual |
Removes all the specified dimensions from the expression.
The space dimension of the variable with the highest space dimension in vars
must be at most the space dimension of this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 95 of file Linear_Expression_Impl.cc.
References Parma_Polyhedra_Library::CO_Tree::iterator::index(), and Parma_Polyhedra_Library::Variables_Set::space_dimension().
|
virtual |
Removes all the specified dimensions from the expression.
The space dimension of the variable with the highest space dimension in vars
must be at most the space dimension of this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Removes all the specified dimensions from the expression.
The space dimension of the variable with the highest space dimension in vars
must be at most the space dimension of this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Removes all the specified dimensions from the expression.
The space dimension of the variable with the highest space dimension in vars
must be at most the space dimension of this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the current representation of this linear expression.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
inlinevirtual |
Returns the current representation of this linear expression.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 257 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::DENSE.
|
inlinevirtual |
Returns the current representation of this linear expression.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 263 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::SPARSE.
|
virtual |
Returns the current representation of this linear expression.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Returns the current representation of this linear expression.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
|
virtual |
Sets results to the sum of (*this)[i]*y[i], for each i in [start,end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1166 of file Linear_Expression_Impl_templates.hh.
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::scalar_product_assign | ( | Coefficient & | result, |
const Linear_Expression_Impl< Row2 > & | y, | ||
dimension_type | start, | ||
dimension_type | end | ||
) | const |
Sets results to the sum of (*this)[i]*y[i], for each i in [start,end).
Definition at line 728 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::add_mul_assign(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row.
|
virtual |
Computes the sign of the sum of (*this)[i]*y[i], for each i in [start,end).
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1186 of file Linear_Expression_Impl_templates.hh.
int Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::scalar_product_sign | ( | const Linear_Expression_Impl< Row2 > & | y, |
dimension_type | start, | ||
dimension_type | end | ||
) | const |
Computes the sign of the sum of (*this)[i]*y[i], for each i in [start,end).
Definition at line 767 of file Linear_Expression_Impl_templates.hh.
References PPL_DIRTY_TEMP_COEFFICIENT, and Parma_Polyhedra_Library::Boundary_NS::sgn().
|
virtual |
Sets the i-th coefficient to n.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 532 of file Linear_Expression_Impl_templates.hh.
|
inlinevirtual |
Sets the coefficient of v
in *this
to n
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 94 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
inlinevirtual |
Sets the inhomogeneous term of *this
to n
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 115 of file Linear_Expression_Impl_inlines.hh.
|
inlinevirtual |
Sets the dimension of the vector space enclosing *this
to n
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 77 of file Linear_Expression_Impl_inlines.hh.
|
inlinevirtual |
Shift by n
positions the coefficients of variables, starting from the coefficient of v
. This increases the space dimension by n
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 134 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
virtual |
Ensures that the first nonzero homogeneous coefficient is positive, by negating the row if necessary.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 670 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::neg_assign().
|
inlinevirtual |
Returns the dimension of the vector space enclosing *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 71 of file Linear_Expression_Impl_inlines.hh.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::ascii_dump(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine_lax().
|
virtual |
|
virtual |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1032 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::sub_mul_assign().
Linear_Expression_Impl& Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::sub_mul_assign | ( | Coefficient_traits::const_reference | n, |
const Linear_Expression_Impl< Row2 > & | y, | ||
dimension_type | start, | ||
dimension_type | end | ||
) |
void Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::sub_mul_assign | ( | Coefficient_traits::const_reference | factor, |
const Linear_Expression_Impl< Row2 > & | e2 | ||
) |
Definition at line 460 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Coefficient_one(), and Parma_Polyhedra_Library::linear_combine().
|
inlinevirtual |
Swaps the coefficients of the variables v1
and v2
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 127 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
inlinevirtual |
Returns a lower bound to the total size in bytes of the memory occupied by *this
.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 148 of file Linear_Expression_Impl_inlines.hh.
References Parma_Polyhedra_Library::external_memory_in_bytes().
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 395 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
related |
The basic comparison function.
The order is a lexicographic. It starts comparing the variables' coefficient, starting from Variable(0), and at the end it compares the inhomogeneous terms.
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 1111 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::compare().
|
related |
The basic comparison function.
The order is a lexicographic. It starts comparing the variables' coefficient, starting from Variable(0), and at the end it compares the inhomogeneous terms.
Definition at line 154 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::cmp(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::row, and Parma_Polyhedra_Library::Boundary_NS::sgn().
Definition at line 734 of file Linear_Expression_Impl_defs.hh.
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 384 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::neg_assign().
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 348 of file Linear_Expression_Impl_templates.hh.
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 295 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
related |
Definition at line 318 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Coefficient_one(), and Parma_Polyhedra_Library::linear_combine().
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 326 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 365 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::begin().
|
related |
Output operator.
Definition at line 285 of file Linear_Expression_Impl_inlines.hh.
|
related |
Implements Parma_Polyhedra_Library::Linear_Expression_Interface.
Definition at line 422 of file Linear_Expression_Impl_templates.hh.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
private |
Definition at line 731 of file Linear_Expression_Impl_defs.hh.
Referenced by Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::ascii_dump(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::ascii_load(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::compare(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::construct(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::have_a_common_variable(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::is_equal_to(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::linear_combine_lax(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::OK(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::const_iterator::operator==(), and Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::scalar_product_assign().