PPL  1.2
Expression_Hide_Inhomo_defs.hh
Go to the documentation of this file.
1 /* Expression_Hide_Inhomo class declaration.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Expression_Hide_Inhomo_defs_hh
25 #define PPL_Expression_Hide_Inhomo_defs_hh 1
26 
28 
30 #include "Dense_Row_defs.hh"
31 #include "Sparse_Row_defs.hh"
32 
33 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
34 
40 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
41 template <typename T>
43  : public Expression_Adapter<T> {
45 public:
51  typedef typename base_type::raw_type raw_type;
52 
54  explicit Expression_Hide_Inhomo(const raw_type& expr);
55 
56 public:
59 
61  Coefficient_traits::const_reference inhomogeneous_term() const;
62 
64  bool is_zero() const;
65 
70  template <typename Expression>
71  bool is_equal_to(const Expression& y) const;
72 
74  Coefficient_traits::const_reference get(dimension_type i) const;
75 
77  Coefficient_traits::const_reference get(Variable v) const;
78 
83  bool all_zeroes(const Variables_Set& vars) const;
84 
89  bool all_zeroes(dimension_type start, dimension_type end) const;
90 
95 
101 
105 
109 
113 
118  bool all_zeroes_except(const Variables_Set& vars,
119  dimension_type start, dimension_type end) const;
120 
122  void has_a_free_dimension_helper(std::set<dimension_type>& x) const;
123 
126  template <typename Expression>
127  bool is_equal_to(const Expression& y,
128  dimension_type start, dimension_type end) const;
129 
132  template <typename Expression>
133  bool is_equal_to(const Expression& y,
134  Coefficient_traits::const_reference c1,
135  Coefficient_traits::const_reference c2,
136  dimension_type start, dimension_type end) const;
137 
139  void get_row(Dense_Row& r) const;
140 
142  void get_row(Sparse_Row& r) const;
143 };
144 
146 
147 #endif // !defined(PPL_Expression_Hide_Inhomo_defs_hh)
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the constant zero.
bool is_equal_to(const Expression &y) const
Returns true if *this is equal to y.
T::raw_type raw_type
The raw, completely unwrapped type.
A finite sequence of coefficients.
size_t dimension_type
An unsigned integral type for representing space dimensions.
base_type::const_iterator const_iterator
The type of const iterators on coefficients.
An std::set of variables' indexes.
An adapter for Linear_Expression objects.
T::const_reference inner_type
The type obtained by one-level unwrapping.
void get_row(Dense_Row &r) const
Sets r to a copy of the row as adapted by *this.
bool all_zeroes(const Variables_Set &vars) const
Returns true if the coefficient of each variable in vars is zero.
A finite sparse sequence of coefficients.
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...
Expression_Hide_Inhomo< T > const_reference
The type of this object.
A dimension of the vector space.
raw_type::const_iterator const_iterator
The type of const iterators on coefficients.
dimension_type first_nonzero(dimension_type first, dimension_type last) const
void has_a_free_dimension_helper(std::set< dimension_type > &x) const
Removes from set x all the indexes of nonzero elements in *this.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
base_type::inner_type inner_type
The type obtained by one-level unwrapping.
An adapter for Linear_Expression that hides the inhomogeneous term.
dimension_type num_zeroes(dimension_type start, dimension_type end) const
Returns the number of zero coefficient in [start, end).
base_type::raw_type raw_type
The raw, completely unwrapped type.
bool all_zeroes_except(const Variables_Set &vars, dimension_type start, dimension_type end) const
Returns true if all coefficients in [start,end), except those corresponding to variables in vars...
bool is_zero() const
Returns true if and only if *this is zero.
const_iterator end() const
Iterator pointing after the last nonzero variable coefficient.