PPL  1.2
Parma_Polyhedra_Library::Grid_Generator Class Reference

A grid line, parameter or grid point. More...

#include <Grid_Generator_defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Grid_Generator:

Public Types

enum  Kind { LINE_OR_EQUALITY = 0, RAY_OR_POINT_OR_INEQUALITY = 1 }
 The possible kinds of Grid_Generator objects. More...
 
enum  Type { LINE, PARAMETER, POINT }
 The generator type. More...
 
typedef Expression_Hide_Last< Expression_Hide_Inhomo< Linear_Expression > > expr_type
 The type of the (adapted) internal expression. More...
 

Public Member Functions

 Grid_Generator (Representation r=default_representation)
 Returns the origin of the zero-dimensional space $\Rset^0$. More...
 
 Grid_Generator (const Grid_Generator &g)
 
 Grid_Generator (const Grid_Generator &g, Representation r)
 Copy constructor with specified representation. More...
 
 Grid_Generator (const Grid_Generator &g, dimension_type space_dim)
 
 Grid_Generator (const Grid_Generator &g, dimension_type space_dim, Representation r)
 Copy constructor with specified space dimension and representation. More...
 
 ~Grid_Generator ()
 Destructor. More...
 
Grid_Generatoroperator= (const Grid_Generator &g)
 Assignment operator. More...
 
Representation representation () const
 Returns the current representation of *this. More...
 
void set_representation (Representation r)
 Converts *this to the specified representation. More...
 
dimension_type space_dimension () const
 Returns the dimension of the vector space enclosing *this. More...
 
void set_space_dimension (dimension_type space_dim)
 
void swap_space_dimensions (Variable v1, Variable v2)
 Swaps the coefficients of the variables v1 and v2 . More...
 
bool remove_space_dimensions (const Variables_Set &vars)
 Removes all the specified dimensions from the grid generator. More...
 
void permute_space_dimensions (const std::vector< Variable > &cycle)
 Permutes the space dimensions of the grid generator. More...
 
void shift_space_dimensions (Variable v, dimension_type n)
 
Type type () const
 Returns the generator type of *this. More...
 
bool is_line () const
 Returns true if and only if *this is a line. More...
 
bool is_parameter () const
 Returns true if and only if *this is a parameter. More...
 
bool is_line_or_parameter () const
 Returns true if and only if *this is a line or a parameter. More...
 
bool is_point () const
 Returns true if and only if *this is a point. More...
 
bool is_parameter_or_point () const
 Returns true if and only if *this row represents a parameter or a point. More...
 
Coefficient_traits::const_reference coefficient (Variable v) const
 Returns the coefficient of v in *this. More...
 
Coefficient_traits::const_reference divisor () const
 Returns the divisor of *this. More...
 
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...
 
memory_size_type external_memory_in_bytes () const
 Returns the size in bytes of the memory managed by *this. More...
 
bool is_equivalent_to (const Grid_Generator &y) const
 Returns true if and only if *this and y are equivalent generators. More...
 
bool is_equal_to (const Grid_Generator &y) const
 Returns true if *this is identical to y. More...
 
bool all_homogeneous_terms_are_zero () const
 Returns true if and only if all the homogeneous terms of *this are $0$. More...
 
bool OK () const
 Checks if all the invariants are satisfied. More...
 
void ascii_dump () const
 Writes to std::cerr an ASCII representation of *this. More...
 
void ascii_dump (std::ostream &s) const
 Writes to s an ASCII representation of *this. More...
 
void print () const
 Prints *this to std::cerr using operator<<. More...
 
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...
 
void m_swap (Grid_Generator &y)
 Swaps *this with y. More...
 
void scale_to_divisor (Coefficient_traits::const_reference d)
 Scales *this to be represented with a divisor of d (if \*this is a parameter or point). Does nothing at all on lines. More...
 
void set_divisor (Coefficient_traits::const_reference d)
 Sets the divisor of *this to d. More...
 
expr_type expression () const
 Partial read access to the (adapted) internal expression. More...
 

Static Public Member Functions

static Grid_Generator grid_line (const Linear_Expression &e, Representation r=default_representation)
 Returns the line of direction e. More...
 
static Grid_Generator parameter (const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
 
static Grid_Generator parameter (Representation r)
 Returns the parameter of direction and size Linear_Expression::zero() . More...
 
static Grid_Generator parameter (const Linear_Expression &e, Representation r)
 Returns the parameter of direction and size e . More...
 
static Grid_Generator grid_point (const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
 Returns the point at e / d. More...
 
static Grid_Generator grid_point (Representation r)
 Returns the point at e . More...
 
static Grid_Generator grid_point (const Linear_Expression &e, Representation r)
 Returns the point at e . More...
 
static dimension_type max_space_dimension ()
 Returns the maximum space dimension a Grid_Generator can handle. More...
 
static void initialize ()
 Initializes the class. More...
 
static void finalize ()
 Finalizes the class. More...
 
static const Grid_Generatorzero_dim_point ()
 Returns the origin of the zero-dimensional space $\Rset^0$. More...
 

Static Public Attributes

static const Representation default_representation = SPARSE
 The representation used for new Grid_Generators. More...
 

Private Member Functions

 Grid_Generator (dimension_type space_dim, Kind kind, Topology topology, Representation r=default_representation)
 
 Grid_Generator (Linear_Expression &e, Type t)
 Constructs a grid generator of type t from linear expression e, stealing the underlying data structures from e. More...
 
void set_space_dimension_no_ok (dimension_type space_dim)
 
bool is_equal_at_dimension (dimension_type dim, const Grid_Generator &gg) const
 Returns true if *this is equal to gg in dimension dim. More...
 
void fancy_print (std::ostream &s) const
 A print function, with fancy, more human-friendly output. More...
 
void set_is_parameter ()
 Converts the Grid_Generator into a parameter. More...
 
void set_is_line ()
 Sets the Grid_Generator kind to LINE_OR_EQUALITY. More...
 
void set_is_parameter_or_point ()
 Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY. More...
 
void sign_normalize ()
 Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a line-or-equality is positive. More...
 
void strong_normalize ()
 Strong normalization: ensures that different Grid_Generator objects represent different hyperplanes or hyperspaces. More...
 
bool check_strong_normalized () const
 Returns true if and only if the coefficients are strongly normalized. More...
 
void linear_combine (const Grid_Generator &y, dimension_type i)
 Linearly combines *this with y so that i-th coefficient is 0. More...
 
void throw_dimension_incompatible (const char *method, const char *name_var, const Variable v) const
 Throw a std::invalid_argument exception containing the appropriate error message. More...
 
void throw_invalid_argument (const char *method, const char *reason) const
 Throw a std::invalid_argument exception containing the appropriate error message. More...
 
Flags inspection methods
Topology topology () const
 Returns the topological kind of *this. More...
 
bool is_not_necessarily_closed () const
 Returns true if and only if the topology of *this row is not necessarily closed. More...
 
bool is_necessarily_closed () const
 Returns true if and only if the topology of *this row is necessarily closed. More...
 
bool is_line_or_equality () const
 Returns true if and only if *this row represents a line or an equality. More...
 
bool is_ray_or_point_or_inequality () const
 Returns true if and only if *this row represents a ray, a point or an inequality. More...
 
Flags coercion methods
void set_topology (Topology x)
 Sets to x the topological kind of *this row. More...
 
void set_necessarily_closed ()
 Sets to NECESSARILY_CLOSED the topological kind of *this row. More...
 
void set_not_necessarily_closed ()
 Sets to NOT_NECESSARILY_CLOSED the topological kind of *this row. More...
 
void set_is_line_or_equality ()
 Sets to LINE_OR_EQUALITY the kind of *this row. More...
 
void set_is_ray_or_point_or_inequality ()
 Sets to RAY_OR_POINT_OR_INEQUALITY the kind of *this row. More...
 

Private Attributes

Linear_Expression expr
 
Kind kind_
 

Static Private Attributes

static const Grid_Generatorzero_dim_point_p = 0
 Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional space $\Rset^0$. More...
 

Friends

class Expression_Adapter< Grid_Generator >
 
class Grid_Generator_System
 
class Grid
 
class Linear_System< Grid_Generator >
 
class Scalar_Products
 
class Topology_Adjusted_Scalar_Product_Sign
 
std::ostream & IO_Operators::operator<< (std::ostream &s, const Grid_Generator &g)
 
int compare (const Grid_Generator &x, const Grid_Generator &y)
 

Related Functions

(Note that these are not member functions.)

int compare (const Grid_Generator &x, const Grid_Generator &y)
 
std::ostream & operator<< (std::ostream &s, const Grid_Generator &g)
 
std::ostream & operator<< (std::ostream &s, const Grid_Generator::Type &t)
 
int compare (const Grid_Generator &x, const Grid_Generator &y)
 The basic comparison function. More...
 
std::ostream & operator<< (std::ostream &s, const Grid_Generator &g)
 Output operator. More...
 
void swap (Grid_Generator &x, Grid_Generator &y)
 Swaps x with y. More...
 
Grid_Generator grid_line (const Linear_Expression &e, Representation r=Grid_Generator::default_representation)
 Shorthand for Grid_Generator::grid_line(const Linear_Expression& e, Representation r). More...
 
Grid_Generator parameter (const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=Grid_Generator::default_representation)
 Shorthand for Grid_Generator::parameter(const Linear_Expression& e, Coefficient_traits::const_reference d, Representation r). More...
 
Grid_Generator parameter (Representation r)
 Shorthand for Grid_Generator::parameter(Representation r). More...
 
Grid_Generator parameter (const Linear_Expression &e, Representation r)
 Shorthand for Grid_Generator::parameter(const Linear_Expression& e, Representation r). More...
 
Grid_Generator grid_point (const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=Grid_Generator::default_representation)
 Shorthand for Grid_Generator::grid_point(const Linear_Expression& e, Coefficient_traits::const_reference d, Representation r). More...
 
Grid_Generator grid_point (Representation r)
 Shorthand for Grid_Generator::grid_point(Representation r). More...
 
Grid_Generator grid_point (const Linear_Expression &e, Representation r)
 Shorthand for Grid_Generator::grid_point(const Linear_Expression& e, Representation r). More...
 
bool operator== (const Grid_Generator &x, const Grid_Generator &y)
 Returns true if and only if x is equivalent to y. More...
 
bool operator!= (const Grid_Generator &x, const Grid_Generator &y)
 Returns true if and only if x is not equivalent to y. More...
 
std::ostream & operator<< (std::ostream &s, const Grid_Generator::Type &t)
 Output operator. More...
 
bool operator== (const Grid_Generator &x, const Grid_Generator &y)
 
bool operator!= (const Grid_Generator &x, const Grid_Generator &y)
 
Grid_Generator grid_line (const Linear_Expression &e, Representation r)
 
Grid_Generator parameter (const Linear_Expression &e, Coefficient_traits::const_reference d, Representation r)
 
Grid_Generator parameter (Representation r)
 
Grid_Generator parameter (const Linear_Expression &e, Representation r)
 
Grid_Generator grid_point (const Linear_Expression &e, Coefficient_traits::const_reference d, Representation r)
 
Grid_Generator grid_point (Representation r)
 
Grid_Generator grid_point (const Linear_Expression &e, Representation r)
 
void swap (Grid_Generator &x, Grid_Generator &y)
 

Detailed Description

A grid line, parameter or grid point.

An object of the class Grid_Generator is one of the following:

  • a grid_line $\vect{l} = (a_0, \ldots, a_{n-1})^\transpose$;
  • a parameter $\vect{q} = (\frac{a_0}{d}, \ldots, \frac{a_{n-1}}{d})^\transpose$;
  • a grid_point $\vect{p} = (\frac{a_0}{d}, \ldots, \frac{a_{n-1}}{d})^\transpose$;

where $n$ is the dimension of the space and, for grid_points and parameters, $d > 0$ is the divisor.

How to build a grid generator.
Each type of generator is built by applying the corresponding function (grid_line, parameter or grid_point) to a linear expression; the space dimension of the generator is defined as the space dimension of the corresponding linear expression. Linear expressions used to define a generator should be homogeneous (any constant term will be simply ignored). When defining grid points and parameters, an optional Coefficient argument can be used as a common divisor for all the coefficients occurring in the provided linear expression; the default value for this argument is 1.
In all the following examples it is assumed that variables x, y and z are defined as follows:
Variable x(0);
Variable y(1);
Variable z(2);
Example 1
The following code builds a grid line with direction $x-y-z$ and having space dimension $3$:
Grid_Generator l = grid_line(x - y - z);
By definition, the origin of the space is not a line, so that the following code throws an exception:
Example 2
The following code builds the parameter as the vector $\vect{p} = (1, -1, -1)^\transpose \in \Rset^3$ which has the same direction as the line in Example 1:
Grid_Generator q = parameter(x - y - z);
Note that, unlike lines, for parameters, the length as well as the direction of the vector represented by the code is significant. Thus q is not the same as the parameter q1 defined by
Grid_Generator q1 = parameter(2x - 2y - 2z);
By definition, the origin of the space is not a parameter, so that the following code throws an exception:
Example 3
The following code builds the grid point $\vect{p} = (1, 0, 2)^\transpose \in \Rset^3$:
Grid_Generator p = grid_point(1*x + 0*y + 2*z);
The same effect can be obtained by using the following code:
Similarly, the origin $\vect{0} \in \Rset^3$ can be defined using either one of the following lines of code:
Grid_Generator origin3 = grid_point(0*x + 0*y + 0*z);
Grid_Generator origin3_alt = grid_point(0*z);
Note however that the following code would have defined a different point, namely $\vect{0} \in \Rset^2$:
Grid_Generator origin2 = grid_point(0*y);
The following two lines of code both define the only grid point having space dimension zero, namely $\vect{0} \in \Rset^0$. In the second case we exploit the fact that the first argument of the function point is optional.
Example 4
The grid point $\vect{p}$ specified in Example 3 above can also be obtained with the following code, where we provide a non-default value for the second argument of the function grid_point (the divisor):
Grid_Generator p = grid_point(2*x + 0*y + 4*z, 2);
Obviously, the divisor can be used to specify points having some non-integer (but rational) coordinates. For instance, the grid point $\vect{p1} = (-1.5, 3.2, 2.1)^\transpose \in \Rset^3$ can be specified by the following code:
Grid_Generator p1 = grid_point(-15*x + 32*y + 21*z, 10);
If a zero divisor is provided, an exception is thrown.
Example 5
Parameters, like grid points can have a divisor. For instance, the parameter $\vect{q} = (1, 0, 2)^\transpose \in \Rset^3$ can be defined:
Grid_Generator q = parameter(2*x + 0*y + 4*z, 2);
Also, the divisor can be used to specify parameters having some non-integer (but rational) coordinates. For instance, the parameter $\vect{q} = (-1.5, 3.2, 2.1)^\transpose \in \Rset^3$ can be defined:
Grid_Generator q = parameter(-15*x + 32*y + 21*z, 10);
If a zero divisor is provided, an exception is thrown.
How to inspect a grid generator
Several methods are provided to examine a grid generator and extract all the encoded information: its space dimension, its type and the value of its integer coefficients and the value of the denominator.
Example 6
The following code shows how it is possible to access each single coefficient of a grid generator. If g1 is a grid point having coordinates $(a_0, \ldots, a_{n-1})^\transpose$, we construct the parameter g2 having coordinates $(a_0, 2 a_1, \ldots, (i+1)a_i, \ldots, n a_{n-1})^\transpose$.
if (g1.is_point()) {
cout << "Grid point g1: " << g1 << endl;
Linear_Expression e;
for (dimension_type i = g1.space_dimension(); i-- > 0; )
e += (i + 1) * g1.coefficient(Variable(i)) * Variable(i);
Grid_Generator g2 = parameter(e, g1.divisor());
cout << "Parameter g2: " << g2 << endl;
}
else
cout << "Grid generator g1 is not a grid point." << endl;
Therefore, for the grid point
Grid_Generator g1 = grid_point(2*x - y + 3*z, 2);
we would obtain the following output:
Grid point g1: p((2*A - B + 3*C)/2)
Parameter g2: parameter((2*A - 2*B + 9*C)/2)
When working with grid points and parameters, be careful not to confuse the notion of coefficient with the notion of coordinate: these are equivalent only when the divisor is 1.

Definition at line 271 of file Grid_Generator_defs.hh.

Member Typedef Documentation

The type of the (adapted) internal expression.

Definition at line 535 of file Grid_Generator_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( Representation  r = default_representation)
inlineexplicit

Returns the origin of the zero-dimensional space $\Rset^0$.

Definition at line 93 of file Grid_Generator_inlines.hh.

References expr, OK(), and Parma_Polyhedra_Library::Linear_Expression::set_space_dimension().

94  : expr(Coefficient_one(), r),
97  PPL_ASSERT(OK());
98 }
void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
bool OK() const
Checks if all the invariants are satisfied.
Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( const Grid_Generator g)
inline

Ordinary copy constructor. The new Grid_Generator will have the same representation as g.

Definition at line 101 of file Grid_Generator_inlines.hh.

102  : expr(g.expr),
103  kind_(g.kind_) {
104 }
Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( const Grid_Generator g,
Representation  r 
)
inline

Copy constructor with specified representation.

Definition at line 107 of file Grid_Generator_inlines.hh.

108  : expr(g.expr, r),
109  kind_(g.kind_) {
110 }
Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( const Grid_Generator g,
dimension_type  space_dim 
)
inline

Copy constructor with specified space dimension. The new Grid_Generator will have the same representation as g.

Definition at line 124 of file Grid_Generator_inlines.hh.

References OK(), and space_dimension().

126  : expr(g.expr, space_dim + 1),
127  kind_(g.kind_) {
128  PPL_ASSERT(OK());
129  PPL_ASSERT(space_dimension() == space_dim);
130 }
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( const Grid_Generator g,
dimension_type  space_dim,
Representation  r 
)
inline

Copy constructor with specified space dimension and representation.

Definition at line 133 of file Grid_Generator_inlines.hh.

References OK(), and space_dimension().

135  : expr(g.expr, space_dim + 1, r),
136  kind_(g.kind_) {
137  PPL_ASSERT(OK());
138  PPL_ASSERT(space_dimension() == space_dim);
139 }
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
Parma_Polyhedra_Library::Grid_Generator::~Grid_Generator ( )
inline

Destructor.

Definition at line 142 of file Grid_Generator_inlines.hh.

142  {
143 }
Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( dimension_type  space_dim,
Kind  kind,
Topology  topology,
Representation  r = default_representation 
)
inlineprivate

Constructs a Grid_Generator with the specified space dimension, kind and topology.

Definition at line 113 of file Grid_Generator_inlines.hh.

References expr, Parma_Polyhedra_Library::NECESSARILY_CLOSED, PPL_USED, Parma_Polyhedra_Library::Linear_Expression::set_space_dimension(), and space_dimension().

115  : expr(r),
116  kind_(kind) {
118  PPL_ASSERT(topology == NECESSARILY_CLOSED);
119  expr.set_space_dimension(space_dim + 1);
120  PPL_ASSERT(space_dimension() == space_dim);
121 }
void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
Topology topology() const
Returns the topological kind of *this.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
#define PPL_USED(v)
No-op macro that allows to avoid unused variable warnings from the compiler.
Definition: compiler.hh:39
Parma_Polyhedra_Library::Grid_Generator::Grid_Generator ( Linear_Expression e,
Type  t 
)
inlineprivate

Constructs a grid generator of type t from linear expression e, stealing the underlying data structures from e.

The last column in e becomes the parameter divisor column of the new Grid_Generator.

Note
The new Grid_Generator will have the same representation as `e'.

Definition at line 81 of file Grid_Generator_inlines.hh.

References expr, kind_, LINE, LINE_OR_EQUALITY, OK(), RAY_OR_POINT_OR_INEQUALITY, and swap().

Member Function Documentation

bool Parma_Polyhedra_Library::Grid_Generator::all_homogeneous_terms_are_zero ( ) const

Returns true if and only if all the homogeneous terms of *this are $0$.

Definition at line 296 of file Grid_Generator.cc.

Referenced by Parma_Polyhedra_Library::Grid_Generator_System::insert(), and Parma_Polyhedra_Library::Grid_Generator_System::remove_invalid_lines_and_parameters().

296  {
297  // This does not check neither the first nor the last coefficient.
298  return expr.all_zeroes(1, expr.space_dimension());
299 }
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool all_zeroes(const Variables_Set &vars) const
Returns true if the coefficient of each variable in vars[i] is .
void Parma_Polyhedra_Library::Grid_Generator::ascii_dump ( ) const

Writes to std::cerr an ASCII representation of *this.

Referenced by Parma_Polyhedra_Library::Grid::OK().

void Parma_Polyhedra_Library::Grid_Generator::ascii_dump ( std::ostream &  s) const

Writes to s an ASCII representation of *this.

Definition at line 186 of file Grid_Generator.cc.

186  {
187  expr.ascii_dump(s);
188  s << ' ';
189  switch (type()) {
190  case LINE:
191  s << "L";
192  break;
193  case PARAMETER:
194  s << "Q";
195  break;
196  case POINT:
197  s << "P";
198  break;
199  }
200  s << "\n";
201 }
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
Type type() const
Returns the generator type of *this.
bool Parma_Polyhedra_Library::Grid_Generator::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.

Definition at line 206 of file Grid_Generator.cc.

206  {
207 
208  if (!expr.ascii_load(s)) {
209  return false;
210  }
211 
212  std::string str;
213 
214  if (!(s >> str)) {
215  return false;
216  }
217  if (str == "L") {
218  set_is_line();
219  }
220  else if (str == "P" || str == "Q") {
222  }
223  else {
224  return false;
225  }
226 
227  PPL_ASSERT(OK());
228  return true;
229 }
void set_is_parameter_or_point()
Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
void set_is_line()
Sets the Grid_Generator kind to LINE_OR_EQUALITY.
bool OK() const
Checks if all the invariants are satisfied.
bool Parma_Polyhedra_Library::Grid_Generator::check_strong_normalized ( ) const
private

Returns true if and only if the coefficients are strongly normalized.

Definition at line 326 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::compare(), and strong_normalize().

326  {
327  Grid_Generator tmp = *this;
328  tmp.strong_normalize();
329  return compare(*this, tmp) == 0;
330 }
friend int compare(const Grid_Generator &x, const Grid_Generator &y)
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
Coefficient_traits::const_reference Parma_Polyhedra_Library::Grid_Generator::coefficient ( Variable  v) const
inline

Returns the coefficient of v in *this.

Exceptions
std::invalid_argumentThrown if the index of v is greater than or equal to the space dimension of *this.

Definition at line 277 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::Linear_Expression::coefficient(), expr, Parma_Polyhedra_Library::Variable::space_dimension(), space_dimension(), and throw_dimension_incompatible().

Referenced by Parma_Polyhedra_Library::Grid::constrains(), and Parma_Polyhedra_Library::Grid::wrap_assign().

277  {
278  if (v.space_dimension() > space_dimension()) {
279  throw_dimension_incompatible("coefficient(v)", "v", v);
280  }
281  return expr.coefficient(v);
282 }
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
void throw_dimension_incompatible(const char *method, const char *name_var, const Variable v) const
Throw a std::invalid_argument exception containing the appropriate error message. ...
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Coefficient_traits::const_reference Parma_Polyhedra_Library::Grid_Generator::divisor ( ) const
inline

Returns the divisor of *this.

Exceptions
std::invalid_argumentThrown if *this is a line.

Definition at line 239 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::Linear_Expression::coefficient(), expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), is_line(), is_line_or_parameter(), space_dimension(), and throw_invalid_argument().

Referenced by Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid::Grid(), is_equal_at_dimension(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Grid::max_min(), Parma_Polyhedra_Library::Grid::normalize_divisors(), OK(), Parma_Polyhedra_Library::Grid::relation_with(), Parma_Polyhedra_Library::Congruence_System::satisfies_all_congruences(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), and Parma_Polyhedra_Library::Grid::wrap_assign().

239  {
240  if (is_line()) {
241  throw_invalid_argument("divisor()", "*this is a line");
242  }
243  if (is_line_or_parameter()) {
244  return expr.coefficient(Variable(space_dimension()));
245  }
246  else {
247  return expr.inhomogeneous_term();
248  }
249 }
bool is_line() const
Returns true if and only if *this is a line.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void throw_invalid_argument(const char *method, const char *reason) const
Throw a std::invalid_argument exception containing the appropriate error message. ...
Grid_Generator::expr_type Parma_Polyhedra_Library::Grid_Generator::expression ( ) const
inline

Partial read access to the (adapted) internal expression.

Definition at line 146 of file Grid_Generator_inlines.hh.

References expr.

Referenced by Parma_Polyhedra_Library::Grid::constrains(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Grid::max_min(), Parma_Polyhedra_Library::Grid::select_wider_generators(), and space_dimension().

146  {
147  return expr_type(expr, true);
148 }
Expression_Hide_Last< Expression_Hide_Inhomo< Linear_Expression > > expr_type
The type of the (adapted) internal expression.
memory_size_type Parma_Polyhedra_Library::Grid_Generator::external_memory_in_bytes ( ) const
inline

Returns the size in bytes of the memory managed by *this.

Definition at line 290 of file Grid_Generator_inlines.hh.

References expr, and Parma_Polyhedra_Library::Linear_Expression::external_memory_in_bytes().

Referenced by total_memory_in_bytes().

290  {
292 }
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void Parma_Polyhedra_Library::Grid_Generator::fancy_print ( std::ostream &  s) const
private

A print function, with fancy, more human-friendly output.

This is used by operator<<().

Definition at line 348 of file Grid_Generator.cc.

References c, LINE, Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::IO_Operators::operator<<(), PARAMETER, POINT, and PPL_DIRTY_TEMP_COEFFICIENT.

Referenced by operator<<().

348  {
349  bool need_divisor = false;
350  bool extra_parentheses = false;
351  const dimension_type num_variables = space_dimension();
352  const Grid_Generator::Type t = type();
353  switch (t) {
355  s << "l(";
356  break;
358  s << "q(";
359  if (expr.coefficient(Variable(num_variables)) == 1) {
360  break;
361  }
362  goto any_point;
364  s << "p(";
365  if (expr.inhomogeneous_term() > 1) {
366  any_point:
367  need_divisor = true;
368  if (!expr.all_zeroes(1, num_variables + 1)) {
369  extra_parentheses = true;
370  s << "(";
371  break;
372  }
373  }
374  break;
375  }
376 
378  bool first = true;
379  for (Linear_Expression::const_iterator i = expr.begin(),
380  i_end = expr.lower_bound(Variable(num_variables)); i != i_end; ++i) {
381  c = *i;
382  if (!first) {
383  if (c > 0) {
384  s << " + ";
385  }
386  else {
387  s << " - ";
388  neg_assign(c);
389  }
390  }
391  else {
392  first = false;
393  }
394  if (c == -1) {
395  s << "-";
396  }
397  else if (c != 1) {
398  s << c << "*";
399  }
400  IO_Operators::operator<<(s, i.variable());
401  }
402  if (first) {
403  // A grid generator in the origin.
404  s << 0;
405  }
406  if (extra_parentheses) {
407  s << ")";
408  }
409  if (need_divisor) {
410  s << "/" << divisor();
411  }
412  s << ")";
413 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
bool all_zeroes(const Variables_Set &vars) const
Returns true if the coefficient of each variable in vars[i] is .
Coefficient_traits::const_reference divisor() const
Returns the divisor of *this.
Type type() const
Returns the generator type of *this.
void neg_assign(GMP_Integer &x)
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Coefficient c
Definition: PIP_Tree.cc:64
void Parma_Polyhedra_Library::Grid_Generator::finalize ( )
static

Finalizes the class.

Definition at line 341 of file Grid_Generator.cc.

Referenced by Parma_Polyhedra_Library::Init::~Init().

341  {
342  PPL_ASSERT(zero_dim_point_p != 0);
343  delete zero_dim_point_p;
344  zero_dim_point_p = 0;
345 }
static const Grid_Generator * zero_dim_point_p
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional...
PPL::Grid_Generator Parma_Polyhedra_Library::Grid_Generator::grid_line ( const Linear_Expression e,
Representation  r = default_representation 
)
static

Returns the line of direction e.

Exceptions
std::invalid_argumentThrown if the homogeneous part of e represents the origin of the vector space.

Definition at line 124 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Linear_Expression::all_homogeneous_terms_are_zero(), Parma_Polyhedra_Library::Coefficient_zero(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), Parma_Polyhedra_Library::Linear_Expression::space_dimension(), and strong_normalize().

Referenced by grid_line().

124  {
125  // The origin of the space cannot be a line.
126  if (e.all_homogeneous_terms_are_zero()) {
127  throw std::invalid_argument("PPL::grid_line(e):\n"
128  "e == 0, but the origin cannot be a line.");
129  }
130 
131  // Add 1 to space dimension to allow for parameter divisor column.
132  Linear_Expression ec(e, 1 + e.space_dimension(), r);
133  ec.set_inhomogeneous_term(Coefficient_zero());
134  // Using this constructor saves reallocation when creating the
135  // coefficients.
136  Grid_Generator gg(ec, LINE);
137 
138  // Enforce normalization.
139  gg.strong_normalize();
140  return gg;
141 }
Coefficient_traits::const_reference Coefficient_zero()
Returns a const reference to a Coefficient with value 0.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
PPL::Grid_Generator Parma_Polyhedra_Library::Grid_Generator::grid_point ( const Linear_Expression e = Linear_Expression::zero(),
Coefficient_traits::const_reference  d = Coefficient_one(),
Representation  r = default_representation 
)
static

Returns the point at e / d.

Both e and d are optional arguments, with default values Linear_Expression::zero() and Coefficient_one(), respectively.

Exceptions
std::invalid_argumentThrown if d is zero.

Definition at line 86 of file Grid_Generator.cc.

References expr, Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::Linear_Expression::normalize(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), and Parma_Polyhedra_Library::Linear_Expression::space_dimension().

Referenced by grid_point().

88  {
89  if (d == 0) {
90  throw std::invalid_argument("PPL::grid_point(e, d):\n"
91  "d == 0.");
92  }
93  // Add 1 to space dimension to allow for parameter divisor column.
94  Linear_Expression ec(e, 1 + e.space_dimension(), r);
95  ec.set_inhomogeneous_term(d);
96 
97  // If the divisor is negative, negate it and all the coefficients of
98  // the point, so as to satisfy the invariant.
99  if (d < 0) {
100  neg_assign(ec);
101  }
102 
103  // Using this constructor saves reallocation when creating the
104  // coefficients.
105  Grid_Generator gg(ec, POINT);
106 
107  // Enforce normalization.
108  gg.expr.normalize();
109  return gg;
110 }
void neg_assign(GMP_Integer &x)
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
PPL::Grid_Generator Parma_Polyhedra_Library::Grid_Generator::grid_point ( Representation  r)
static

Returns the point at e .

Definition at line 113 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Coefficient_one(), and Parma_Polyhedra_Library::Linear_Expression::zero().

113  {
115 }
static Grid_Generator grid_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the point at e / d.
static const Linear_Expression & zero()
Returns the (zero-dimension space) constant 0.
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
PPL::Grid_Generator Parma_Polyhedra_Library::Grid_Generator::grid_point ( const Linear_Expression e,
Representation  r 
)
static

Returns the point at e .

Definition at line 118 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Coefficient_one().

119  {
120  return grid_point(e, Coefficient_one(), r);
121 }
static Grid_Generator grid_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the point at e / d.
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
void Parma_Polyhedra_Library::Grid_Generator::initialize ( )
static

Initializes the class.

Definition at line 335 of file Grid_Generator.cc.

Referenced by Parma_Polyhedra_Library::Init::Init().

335  {
336  PPL_ASSERT(zero_dim_point_p == 0);
338 }
static const Grid_Generator * zero_dim_point_p
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional...
static Grid_Generator grid_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the point at e / d.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
bool Parma_Polyhedra_Library::Grid_Generator::is_equal_at_dimension ( dimension_type  dim,
const Grid_Generator gg 
) const
inlineprivate

Returns true if *this is equal to gg in dimension dim.

Definition at line 252 of file Grid_Generator_inlines.hh.

References divisor(), expr, and Parma_Polyhedra_Library::Linear_Expression::get().

Referenced by Parma_Polyhedra_Library::Grid::select_wider_generators().

253  {
254  const Grid_Generator& x = *this;
255  return x.expr.get(dim) * y.divisor() == y.expr.get(dim) * x.divisor();
256 }
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
bool Parma_Polyhedra_Library::Grid_Generator::is_equal_to ( const Grid_Generator y) const

Returns true if *this is identical to y.

This is faster than is_equivalent_to(), but it may return `false' even for equivalent generators.

Definition at line 291 of file Grid_Generator.cc.

References expr, and kind_.

Referenced by is_equivalent_to(), and Parma_Polyhedra_Library::Grid::OK().

291  {
292  return expr.is_equal_to(y.expr) && kind_ == y.kind_;
293 }
bool is_equal_to(const Linear_Expression &x) const
bool Parma_Polyhedra_Library::Grid_Generator::is_equivalent_to ( const Grid_Generator y) const

Returns true if and only if *this and y are equivalent generators.

Generators having different space dimensions are not equivalent.

Definition at line 264 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Coefficient_zero(), expr, is_equal_to(), Parma_Polyhedra_Library::Linear_Expression::normalize(), Parma_Polyhedra_Library::Linear_Expression::set(), space_dimension(), and type().

Referenced by operator==().

264  {
265  const Grid_Generator& x = *this;
266  const dimension_type x_space_dim = x.space_dimension();
267  if (x_space_dim != y.space_dimension()) {
268  return false;
269  }
270 
271  const Type x_type = x.type();
272  if (x_type != y.type()) {
273  return false;
274  }
275 
276  Grid_Generator tmp_x = *this;
277  Grid_Generator tmp_y = y;
278  const Variable last_var(x_space_dim);
279  if (x_type == POINT || x_type == LINE) {
280  tmp_x.expr.set(last_var, Coefficient_zero());
281  tmp_y.expr.set(last_var, Coefficient_zero());
282  }
283  // Normalize the copies, including the divisor column.
284  tmp_x.expr.normalize();
285  tmp_y.expr.normalize();
286  // Check for equality.
287  return tmp_x.is_equal_to(tmp_y);
288 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Coefficient_traits::const_reference Coefficient_zero()
Returns a const reference to a Coefficient with value 0.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
bool Parma_Polyhedra_Library::Grid_Generator::is_line ( ) const
inline
bool Parma_Polyhedra_Library::Grid_Generator::is_line_or_equality ( ) const
inlineprivate

Returns true if and only if *this row represents a line or an equality.

Definition at line 40 of file Grid_Generator_inlines.hh.

References kind_, and LINE_OR_EQUALITY.

Referenced by compare(), and is_line().

bool Parma_Polyhedra_Library::Grid_Generator::is_line_or_parameter ( ) const
inline
bool Parma_Polyhedra_Library::Grid_Generator::is_necessarily_closed ( ) const
inlineprivate

Returns true if and only if the topology of *this row is necessarily closed.

Definition at line 30 of file Grid_Generator_inlines.hh.

Referenced by OK().

30  {
31  return true;
32 }
bool Parma_Polyhedra_Library::Grid_Generator::is_not_necessarily_closed ( ) const
inlineprivate

Returns true if and only if the topology of *this row is not necessarily closed.

Definition at line 35 of file Grid_Generator_inlines.hh.

35  {
36  return false;
37 }
bool Parma_Polyhedra_Library::Grid_Generator::is_parameter ( ) const
inline

Returns true if and only if *this is a parameter.

Definition at line 208 of file Grid_Generator_inlines.hh.

References is_line_or_parameter(), and is_parameter_or_point().

Referenced by Parma_Polyhedra_Library::Grid::add_grid_generator(), Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid_Generator_System::insert(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), and strong_normalize().

208  {
210 }
bool is_parameter_or_point() const
Returns true if and only if *this row represents a parameter or a point.
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
bool Parma_Polyhedra_Library::Grid_Generator::is_parameter_or_point ( ) const
inline

Returns true if and only if *this row represents a parameter or a point.

Definition at line 223 of file Grid_Generator_inlines.hh.

References is_ray_or_point_or_inequality().

Referenced by Parma_Polyhedra_Library::Grid::add_grid_generator(), is_parameter(), Parma_Polyhedra_Library::Grid::multiply_grid(), Parma_Polyhedra_Library::Grid::normalize_divisors(), Parma_Polyhedra_Library::Grid::reduce_parameter_with_line(), and Parma_Polyhedra_Library::Grid::simplify().

223  {
225 }
bool is_ray_or_point_or_inequality() const
Returns true if and only if *this row represents a ray, a point or an inequality. ...
bool Parma_Polyhedra_Library::Grid_Generator::is_point ( ) const
inline

Returns true if and only if *this is a point.

Definition at line 218 of file Grid_Generator_inlines.hh.

References is_line_or_parameter().

Referenced by Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), Parma_Polyhedra_Library::Grid::time_elapse_assign(), and type().

218  {
219  return !is_line_or_parameter();
220 }
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
bool Parma_Polyhedra_Library::Grid_Generator::is_ray_or_point_or_inequality ( ) const
inlineprivate

Returns true if and only if *this row represents a ray, a point or an inequality.

Definition at line 45 of file Grid_Generator_inlines.hh.

References kind_, and RAY_OR_POINT_OR_INEQUALITY.

Referenced by is_parameter_or_point().

void Parma_Polyhedra_Library::Grid_Generator::linear_combine ( const Grid_Generator y,
dimension_type  i 
)
private

Linearly combines *this with y so that i-th coefficient is 0.

Parameters
yThe Grid_Generator that will be combined with *this object;
iThe index of the coefficient that has to become $0$.

Computes a linear combination of *this and y having the i-th coefficient equal to $0$. Then it assigns the resulting Grid_Generator to *this and normalizes it.

Definition at line 244 of file Grid_Generator.cc.

References expr.

245  {
246  expr.linear_combine(y.expr, i);
248 }
void strong_normalize()
Strong normalization: ensures that different Grid_Generator objects represent different hyperplanes o...
void linear_combine(const Linear_Expression &y, Variable v)
void Parma_Polyhedra_Library::Grid_Generator::m_swap ( Grid_Generator y)
inline

Swaps *this with y.

Definition at line 308 of file Grid_Generator_inlines.hh.

References expr, kind_, swap(), and Parma_Polyhedra_Library::swap().

Referenced by swap().

308  {
309  using std::swap;
310  swap(expr, y.expr);
311  swap(kind_, y.kind_);
312 }
void swap(CO_Tree &x, CO_Tree &y)
void swap(Grid_Generator &x, Grid_Generator &y)
Swaps x with y.
dimension_type Parma_Polyhedra_Library::Grid_Generator::max_space_dimension ( )
inlinestatic

Returns the maximum space dimension a Grid_Generator can handle.

Definition at line 161 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::Linear_Expression::max_space_dimension().

161  {
163 }
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_Expression can handle.
bool Parma_Polyhedra_Library::Grid_Generator::OK ( ) const

Checks if all the invariants are satisfied.

Definition at line 443 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Linear_Expression::coefficient(), divisor(), expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), is_necessarily_closed(), LINE, PARAMETER, POINT, Parma_Polyhedra_Library::Linear_Expression::space_dimension(), and type().

Referenced by Parma_Polyhedra_Library::Grid_Generator_System::add_universe_rows_and_columns(), Parma_Polyhedra_Library::Grid_Generator_System::affine_image(), Parma_Polyhedra_Library::Grid::Grid(), Grid_Generator(), Parma_Polyhedra_Library::Grid::reduce_line_with_line(), and Parma_Polyhedra_Library::Grid::relation_with().

443  {
444  // NOTE: do not check for normalization, as it does not hold.
445  const Grid_Generator& x = *this;
446 
447  if (!x.is_necessarily_closed()) {
448 #ifndef NDEBUG
449  std::cerr << "Grid_Generator should be necessarily closed.\n";
450 #endif
451  return false;
452  }
453 
454  if (x.expr.space_dimension() < 1) {
455 #ifndef NDEBUG
456  std::cerr << "Grid_Generator has fewer coefficients than the minimum "
457  << "allowed:\nspace dimension is " << x.expr.space_dimension()
458  << ", minimum is 1.\n";
459 #endif
460  return false;
461  }
462 
463  switch (x.type()) {
465  if (x.expr.inhomogeneous_term() != 0) {
466 #ifndef NDEBUG
467  std::cerr << "Inhomogeneous terms of lines must be zero!\n";
468 #endif
469  return false;
470  }
471  break;
472 
474  if (x.expr.inhomogeneous_term() != 0) {
475 #ifndef NDEBUG
476  std::cerr << "Inhomogeneous terms of parameters must be zero!\n";
477 #endif
478  return false;
479  }
480  if (x.divisor() <= 0) {
481 #ifndef NDEBUG
482  std::cerr << "Parameters must have positive divisors!\n";
483 #endif
484  return false;
485  }
486  break;
487 
489  if (x.expr.inhomogeneous_term() <= 0) {
490 #ifndef NDEBUG
491  std::cerr << "Points must have positive divisors!\n";
492 #endif
493  return false;
494  }
495  if (x.expr.coefficient(Variable(space_dimension())) != 0) {
496 #ifndef NDEBUG
497  std::cerr << "Points must have a zero parameter divisor!\n";
498 #endif
499  return false;
500  }
501  break;
502 
503  } // switch (x.type())
504 
505  // All tests passed.
506  return true;
507 }
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
Grid_Generator & Parma_Polyhedra_Library::Grid_Generator::operator= ( const Grid_Generator g)
inline

Assignment operator.

Definition at line 269 of file Grid_Generator_inlines.hh.

References swap().

269  {
270  Grid_Generator tmp = g;
271  swap(*this, tmp);
272 
273  return *this;
274 }
void swap(Grid_Generator &x, Grid_Generator &y)
Swaps x with y.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
PPL::Grid_Generator Parma_Polyhedra_Library::Grid_Generator::parameter ( const Linear_Expression e = Linear_Expression::zero(),
Coefficient_traits::const_reference  d = Coefficient_one(),
Representation  r = default_representation 
)
static

Returns the parameter of direction e and size e/d, with the same representation as e.

Both e and d are optional arguments, with default values Linear_Expression::zero() and Coefficient_one(), respectively.

Exceptions
std::invalid_argumentThrown if d is zero.

Definition at line 56 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Coefficient_zero(), Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), and Parma_Polyhedra_Library::Linear_Expression::space_dimension().

Referenced by parameter().

58  {
59  if (d == 0) {
60  throw std::invalid_argument("PPL::parameter(e, d):\n"
61  "d == 0.");
62  }
63  // Add 1 to space dimension to allow for parameter divisor column.
64  Linear_Expression ec(e, e.space_dimension() + 1, r);
65 
66  ec.set_inhomogeneous_term(Coefficient_zero());
67  const Variable divisor_var(e.space_dimension());
68  ec.set(divisor_var, d);
69 
70  // If the divisor is negative, negate it and all the coefficients of
71  // the parameter, so as to satisfy the invariant.
72  if (d < 0) {
73  neg_assign(ec);
74  }
75 
76  // Using this constructor saves reallocation when creating the
77  // coefficients.
78  const Grid_Generator gg(ec, PARAMETER);
79 
80  // NOTE: normalize() must *not* be called here, because this is a parameter,
81  // and it would change the represented parameter.
82  return gg;
83 }
void neg_assign(GMP_Integer &x)
Coefficient_traits::const_reference Coefficient_zero()
Returns a const reference to a Coefficient with value 0.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
static Grid_Generator Parma_Polyhedra_Library::Grid_Generator::parameter ( Representation  r)
static

Returns the parameter of direction and size Linear_Expression::zero() .

static Grid_Generator Parma_Polyhedra_Library::Grid_Generator::parameter ( const Linear_Expression e,
Representation  r 
)
static

Returns the parameter of direction and size e .

void Parma_Polyhedra_Library::Grid_Generator::permute_space_dimensions ( const std::vector< Variable > &  cycle)

Permutes the space dimensions of the grid generator.

Definition at line 167 of file Grid_Generator.cc.

167  {
168  if (cycle.size() < 2) {
169  // No-op. No need to call sign_normalize().
170  return;
171  }
172 
174 
175  // *this is still normalized but may be not strongly normalized: sign
176  // normalization is necessary.
177  // Sign-normalizing a parameter changes its meaning, so do nothing for
178  // parameters.
179  if (!is_parameter()) {
180  sign_normalize();
181  }
182  PPL_ASSERT(OK());
183 }
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the expression.
void sign_normalize()
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a lin...
bool is_parameter() const
Returns true if and only if *this is a parameter.
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Grid_Generator::print ( ) const

Prints *this to std::cerr using operator<<.

bool Parma_Polyhedra_Library::Grid_Generator::remove_space_dimensions ( const Variables_Set vars)

Removes all the specified dimensions from the grid generator.

The space dimension of the variable with the highest space dimension in vars must be at most the space dimension of this.

Always returns true. The return value is needed for compatibility with the Generator class.

Definition at line 156 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Variables_Set::space_dimension().

156  {
157  PPL_ASSERT(vars.space_dimension() <= space_dimension());
158 
160 
161  PPL_ASSERT(OK());
162  return true;
163 }
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the expression.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
Representation Parma_Polyhedra_Library::Grid_Generator::representation ( ) const
inline

Returns the current representation of *this.

Definition at line 151 of file Grid_Generator_inlines.hh.

References expr, and Parma_Polyhedra_Library::Linear_Expression::representation().

151  {
152  return expr.representation();
153 }
Representation representation() const
Returns the current representation of *this.
void Parma_Polyhedra_Library::Grid_Generator::scale_to_divisor ( Coefficient_traits::const_reference  d)

Scales *this to be represented with a divisor of d (if \*this is a parameter or point). Does nothing at all on lines.

It is assumed that d is a multiple of the current divisor and different from zero. The behavior is undefined if the assumption does not hold.

Definition at line 302 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::exact_div_assign(), and PPL_DIRTY_TEMP_COEFFICIENT.

Referenced by Parma_Polyhedra_Library::Grid::Grid().

302  {
303  PPL_ASSERT(d != 0);
304  if (is_line()) {
305  return;
306  }
307 
309  exact_div_assign(factor, d, divisor());
310  set_divisor(d);
311  PPL_ASSERT(factor > 0);
312  if (factor > 1) {
313  // Don't scale the first and last coefficients.
314  expr.mul_assign(factor, 1, expr.space_dimension());
315  }
316 }
bool is_line() const
Returns true if and only if *this is a line.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void exact_div_assign(Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z)
Coefficient_traits::const_reference divisor() const
Returns the divisor of *this.
void set_divisor(Coefficient_traits::const_reference d)
Sets the divisor of *this to d.
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).
void Parma_Polyhedra_Library::Grid_Generator::set_divisor ( Coefficient_traits::const_reference  d)
inline

Sets the divisor of *this to d.

Exceptions
std::invalid_argumentThrown if *this is a line.

Definition at line 228 of file Grid_Generator_inlines.hh.

References expr, is_line(), is_line_or_parameter(), Parma_Polyhedra_Library::Linear_Expression::set_coefficient(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), and space_dimension().

228  {
229  PPL_ASSERT(!is_line());
230  if (is_line_or_parameter()) {
231  expr.set_coefficient(Variable(space_dimension()), d);
232  }
233  else {
235  }
236 }
bool is_line() const
Returns true if and only if *this is a line.
void set_coefficient(Variable v, Coefficient_traits::const_reference n)
Sets the coefficient of v in *this to n.
void set_inhomogeneous_term(Coefficient_traits::const_reference n)
Sets the inhomogeneous term of *this to n.
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void Parma_Polyhedra_Library::Grid_Generator::set_is_line ( )
inlineprivate

Sets the Grid_Generator kind to LINE_OR_EQUALITY.

Definition at line 259 of file Grid_Generator_inlines.hh.

References set_is_line_or_equality().

259  {
261 }
void set_is_line_or_equality()
Sets to LINE_OR_EQUALITY the kind of *this row.
void Parma_Polyhedra_Library::Grid_Generator::set_is_line_or_equality ( )
inlineprivate

Sets to LINE_OR_EQUALITY the kind of *this row.

Definition at line 55 of file Grid_Generator_inlines.hh.

References kind_, and LINE_OR_EQUALITY.

Referenced by set_is_line().

void Parma_Polyhedra_Library::Grid_Generator::set_is_parameter ( )
private

Converts the Grid_Generator into a parameter.

Definition at line 232 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Coefficient_zero().

Referenced by Parma_Polyhedra_Library::Grid::relation_with(), and Parma_Polyhedra_Library::Grid::time_elapse_assign().

232  {
233  if (is_line()) {
235  }
236  else if (!is_line_or_parameter()) {
237  // The grid generator is a point.
238  expr.set(Variable(expr.space_dimension() - 1), expr.inhomogeneous_term());
240  }
241 }
void set_is_parameter_or_point()
Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY.
void set(dimension_type i, Coefficient_traits::const_reference n)
Sets the i-th coefficient to n.
bool is_line() const
Returns true if and only if *this is a line.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void set_inhomogeneous_term(Coefficient_traits::const_reference n)
Sets the inhomogeneous term of *this to n.
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
Coefficient_traits::const_reference Coefficient_zero()
Returns a const reference to a Coefficient with value 0.
void Parma_Polyhedra_Library::Grid_Generator::set_is_parameter_or_point ( )
inlineprivate

Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY.

Definition at line 264 of file Grid_Generator_inlines.hh.

References set_is_ray_or_point_or_inequality().

264  {
266 }
void set_is_ray_or_point_or_inequality()
Sets to RAY_OR_POINT_OR_INEQUALITY the kind of *this row.
void Parma_Polyhedra_Library::Grid_Generator::set_is_ray_or_point_or_inequality ( )
inlineprivate
void Parma_Polyhedra_Library::Grid_Generator::set_necessarily_closed ( )
inlineprivate

Sets to NECESSARILY_CLOSED the topological kind of *this row.

Definition at line 71 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::NECESSARILY_CLOSED, and set_topology().

71  {
73 }
void set_topology(Topology x)
Sets to x the topological kind of *this row.
void Parma_Polyhedra_Library::Grid_Generator::set_not_necessarily_closed ( )
inlineprivate

Sets to NOT_NECESSARILY_CLOSED the topological kind of *this row.

Definition at line 76 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, and set_topology().

76  {
78 }
void set_topology(Topology x)
Sets to x the topological kind of *this row.
void Parma_Polyhedra_Library::Grid_Generator::set_representation ( Representation  r)
inline

Converts *this to the specified representation.

Definition at line 156 of file Grid_Generator_inlines.hh.

References expr, and Parma_Polyhedra_Library::Linear_Expression::set_representation().

156  {
158 }
void set_representation(Representation r)
Converts *this to the specified representation.
void Parma_Polyhedra_Library::Grid_Generator::set_space_dimension ( dimension_type  space_dim)
inline

Sets the dimension of the vector space enclosing *this to space_dim .

Definition at line 171 of file Grid_Generator_inlines.hh.

References expr, Parma_Polyhedra_Library::Linear_Expression::set_space_dimension(), space_dimension(), and Parma_Polyhedra_Library::Linear_Expression::swap_space_dimensions().

Referenced by set_space_dimension_no_ok().

171  {
172  const dimension_type old_space_dim = space_dimension();
173  if (space_dim > old_space_dim) {
174  expr.set_space_dimension(space_dim + 1);
175  expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
176  }
177  else {
178  expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
179  expr.set_space_dimension(space_dim + 1);
180  }
181  PPL_ASSERT(space_dimension() == space_dim);
182 }
void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
size_t dimension_type
An unsigned integral type for representing space dimensions.
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void Parma_Polyhedra_Library::Grid_Generator::set_space_dimension_no_ok ( dimension_type  space_dim)
inlineprivate

Sets the dimension of the vector space enclosing *this to space_dim . Sets the space dimension of the rows in the system to space_dim .

This method is for internal use, it does *not* assert OK() at the end, so it can be used for invalid objects.

Definition at line 185 of file Grid_Generator_inlines.hh.

References set_space_dimension().

185  {
186  set_space_dimension(space_dim);
187 }
void set_space_dimension(dimension_type space_dim)
void Parma_Polyhedra_Library::Grid_Generator::set_topology ( Topology  x)
inlineprivate

Sets to x the topological kind of *this row.

Definition at line 65 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::NECESSARILY_CLOSED, and PPL_USED.

Referenced by Parma_Polyhedra_Library::Grid::conversion(), set_necessarily_closed(), and set_not_necessarily_closed().

65  {
66  PPL_USED(x);
67  PPL_ASSERT(x == NECESSARILY_CLOSED);
68 }
#define PPL_USED(v)
No-op macro that allows to avoid unused variable warnings from the compiler.
Definition: compiler.hh:39
void Parma_Polyhedra_Library::Grid_Generator::shift_space_dimensions ( Variable  v,
dimension_type  n 
)
inline

Shift by n positions the coefficients of variables, starting from the coefficient of v. This increases the space dimension by n.

Definition at line 190 of file Grid_Generator_inlines.hh.

References expr, and Parma_Polyhedra_Library::Linear_Expression::shift_space_dimensions().

190  {
192 }
void shift_space_dimensions(Variable v, dimension_type n)
void Parma_Polyhedra_Library::Grid_Generator::sign_normalize ( )
private

Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a line-or-equality is positive.

Definition at line 319 of file Grid_Generator.cc.

Referenced by strong_normalize().

319  {
320  if (is_line_or_equality()) {
322  }
323 }
bool is_line_or_equality() const
Returns true if and only if *this row represents a line or an equality.
void Parma_Polyhedra_Library::Grid_Generator::strong_normalize ( )
inlineprivate

Strong normalization: ensures that different Grid_Generator objects represent different hyperplanes or hyperspaces.

Applies both Grid_Generator::normalize() and Grid_Generator::sign_normalize().

Definition at line 301 of file Grid_Generator_inlines.hh.

References expr, is_parameter(), Parma_Polyhedra_Library::Linear_Expression::normalize(), and sign_normalize().

Referenced by check_strong_normalized(), grid_line(), and Parma_Polyhedra_Library::Grid::relation_with().

301  {
302  PPL_ASSERT(!is_parameter());
303  expr.normalize();
304  sign_normalize();
305 }
void sign_normalize()
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a lin...
bool is_parameter() const
Returns true if and only if *this is a parameter.
void Parma_Polyhedra_Library::Grid_Generator::swap_space_dimensions ( Variable  v1,
Variable  v2 
)

Swaps the coefficients of the variables v1 and v2 .

Definition at line 144 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Variable::space_dimension().

144  {
145  PPL_ASSERT(v1.space_dimension() <= space_dimension());
146  PPL_ASSERT(v2.space_dimension() <= space_dimension());
147  expr.swap_space_dimensions(v1, v2);
148  // *this is still normalized but it may not be strongly normalized.
149  if (!is_parameter()) {
150  sign_normalize();
151  }
152  PPL_ASSERT(OK());
153 }
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
void sign_normalize()
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a lin...
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool is_parameter() const
Returns true if and only if *this is a parameter.
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Grid_Generator::throw_dimension_incompatible ( const char *  method,
const char *  name_var,
const Variable  v 
) const
private

Throw a std::invalid_argument exception containing the appropriate error message.

Definition at line 36 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::Variable::space_dimension(), and space_dimension().

Referenced by coefficient().

38  {
39  std::ostringstream s;
40  s << "PPL::Grid_Generator::" << method << ":" << std::endl
41  << "this->space_dimension() == " << space_dimension() << ", "
42  << name_var << ".space_dimension() == " << v.space_dimension() << ".";
43  throw std::invalid_argument(s.str());
44 }
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void Parma_Polyhedra_Library::Grid_Generator::throw_invalid_argument ( const char *  method,
const char *  reason 
) const
private

Throw a std::invalid_argument exception containing the appropriate error message.

Definition at line 47 of file Grid_Generator.cc.

Referenced by divisor().

48  {
49  std::ostringstream s;
50  s << "PPL::Grid_Generator::" << method << ":" << std::endl
51  << reason << ".";
52  throw std::invalid_argument(s.str());
53 }
Topology Parma_Polyhedra_Library::Grid_Generator::topology ( ) const
inlineprivate

Returns the topological kind of *this.

Definition at line 50 of file Grid_Generator_inlines.hh.

References Parma_Polyhedra_Library::NECESSARILY_CLOSED.

memory_size_type Parma_Polyhedra_Library::Grid_Generator::total_memory_in_bytes ( ) const
inline

Returns a lower bound to the total size in bytes of the memory occupied by *this.

Definition at line 285 of file Grid_Generator_inlines.hh.

References external_memory_in_bytes().

285  {
286  return sizeof(*this) + external_memory_in_bytes();
287 }
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
Grid_Generator::Type Parma_Polyhedra_Library::Grid_Generator::type ( ) const
inline
const Grid_Generator & Parma_Polyhedra_Library::Grid_Generator::zero_dim_point ( )
inlinestatic

Returns the origin of the zero-dimensional space $\Rset^0$.

Definition at line 295 of file Grid_Generator_inlines.hh.

References zero_dim_point_p.

Referenced by Parma_Polyhedra_Library::Grid_Generator_System::initialize().

295  {
296  PPL_ASSERT(zero_dim_point_p != 0);
297  return *zero_dim_point_p;
298 }
static const Grid_Generator * zero_dim_point_p
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional...

Friends And Related Function Documentation

int compare ( const Grid_Generator x,
const Grid_Generator y 
)
related

The basic comparison function.

Returns
The returned absolute value can be $0$, $1$ or $2$.
Parameters
xA row of coefficients;
yAnother row.

Compares x and y, where x and y may be of different size, in which case the "missing" coefficients are assumed to be zero. The comparison is such that:

  1. equalities are smaller than inequalities;
  2. lines are smaller than points and rays;
  3. the ordering is lexicographic;
  4. the positions compared are, in decreasing order of significance, 1, 2, ..., size(), 0;
  5. the result is negative, zero, or positive if x is smaller than, equal to, or greater than y, respectively;
  6. when x and y are different, the absolute value of the result is 1 if the difference is due to the coefficient in position 0; it is 2 otherwise.

When x and y represent the hyper-planes associated to two equality or inequality constraints, the coefficient at 0 is the known term. In this case, the return value can be characterized as follows:

  • -2, if x is smaller than y and they are not parallel;
  • -1, if x is smaller than y and they are parallel;
  • 0, if x and y are equal;
  • +1, if y is smaller than x and they are parallel;
  • +2, if y is smaller than x and they are not parallel.
int compare ( const Grid_Generator x,
const Grid_Generator y 
)
related

Definition at line 252 of file Grid_Generator.cc.

References Parma_Polyhedra_Library::compare(), expr, and is_line_or_equality().

252  {
253  const bool x_is_line_or_equality = x.is_line_or_equality();
254  const bool y_is_line_or_equality = y.is_line_or_equality();
255  if (x_is_line_or_equality != y_is_line_or_equality) {
256  // Equalities (lines) precede inequalities (ray/point).
257  return y_is_line_or_equality ? 2 : -2;
258  }
259 
260  return compare(x.expr, y.expr);
261 }
friend int compare(const Grid_Generator &x, const Grid_Generator &y)
int compare ( const Grid_Generator x,
const Grid_Generator y 
)
friend
friend class Expression_Adapter< Grid_Generator >
friend

Definition at line 704 of file Grid_Generator_defs.hh.

friend class Grid
friend

Definition at line 706 of file Grid_Generator_defs.hh.

friend class Grid_Generator_System
friend

Definition at line 705 of file Grid_Generator_defs.hh.

Grid_Generator grid_line ( const Linear_Expression e,
Representation  r 
)
related

Definition at line 328 of file Grid_Generator_inlines.hh.

References grid_line().

328  {
329  return Grid_Generator::grid_line(e, r);
330 }
static Grid_Generator grid_line(const Linear_Expression &e, Representation r=default_representation)
Returns the line of direction e.
Grid_Generator grid_point ( const Linear_Expression e,
Coefficient_traits::const_reference  d,
Representation  r 
)
related

Definition at line 353 of file Grid_Generator_inlines.hh.

References grid_point().

354  {
355  return Grid_Generator::grid_point(e, d, r);
356 }
static Grid_Generator grid_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the point at e / d.
Grid_Generator grid_point ( Representation  r)
related

Definition at line 360 of file Grid_Generator_inlines.hh.

References grid_point().

360  {
361  return Grid_Generator::grid_point(r);
362 }
static Grid_Generator grid_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the point at e / d.
Grid_Generator grid_point ( const Linear_Expression e,
Representation  r 
)
related

Definition at line 366 of file Grid_Generator_inlines.hh.

References grid_point().

366  {
367  return Grid_Generator::grid_point(e, r);
368 }
static Grid_Generator grid_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the point at e / d.
std::ostream& IO_Operators::operator<< ( std::ostream &  s,
const Grid_Generator g 
)
friend
friend class Linear_System< Grid_Generator >
friend

Definition at line 707 of file Grid_Generator_defs.hh.

bool operator!= ( const Grid_Generator x,
const Grid_Generator y 
)
related

Definition at line 322 of file Grid_Generator_inlines.hh.

322  {
323  return !(x == y);
324 }
bool operator!= ( const Grid_Generator x,
const Grid_Generator y 
)
related

Returns true if and only if x is not equivalent to y.

std::ostream & operator<< ( std::ostream &  s,
const Grid_Generator g 
)
related

Output operator.

std::ostream & operator<< ( std::ostream &  s,
const Grid_Generator g 
)
related

Definition at line 417 of file Grid_Generator.cc.

References fancy_print().

417  {
418  g.fancy_print(s);
419  return s;
420 }
std::ostream & operator<< ( std::ostream &  s,
const Grid_Generator::Type t 
)
related

Definition at line 424 of file Grid_Generator.cc.

References LINE, PARAMETER, and POINT.

425  {
426  const char* n = 0;
427  switch (t) {
429  n = "LINE";
430  break;
432  n = "PARAMETER";
433  break;
435  n = "POINT";
436  break;
437  }
438  s << n;
439  return s;
440 }
std::ostream & operator<< ( std::ostream &  s,
const Grid_Generator::Type t 
)
related

Output operator.

bool operator== ( const Grid_Generator x,
const Grid_Generator y 
)
related

Definition at line 316 of file Grid_Generator_inlines.hh.

References is_equivalent_to().

316  {
317  return x.is_equivalent_to(y);
318 }
bool operator== ( const Grid_Generator x,
const Grid_Generator y 
)
related

Returns true if and only if x is equivalent to y.

Grid_Generator parameter ( const Linear_Expression e,
Coefficient_traits::const_reference  d,
Representation  r 
)
related

Definition at line 334 of file Grid_Generator_inlines.hh.

References parameter().

335  {
336  return Grid_Generator::parameter(e, d, r);
337 }
static Grid_Generator parameter(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Grid_Generator parameter ( Representation  r)
related

Definition at line 341 of file Grid_Generator_inlines.hh.

References parameter().

341  {
342  return Grid_Generator::parameter(r);
343 }
static Grid_Generator parameter(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Grid_Generator parameter ( const Linear_Expression e,
Representation  r 
)
related

Definition at line 347 of file Grid_Generator_inlines.hh.

References parameter().

347  {
348  return Grid_Generator::parameter(e, r);
349 }
static Grid_Generator parameter(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
friend class Scalar_Products
friend

Definition at line 708 of file Grid_Generator_defs.hh.

void swap ( Grid_Generator x,
Grid_Generator y 
)
related

Swaps x with y.

Referenced by Grid_Generator(), m_swap(), and operator=().

void swap ( Grid_Generator x,
Grid_Generator y 
)
related

Definition at line 372 of file Grid_Generator_inlines.hh.

References m_swap().

372  {
373  x.m_swap(y);
374 }

Definition at line 709 of file Grid_Generator_defs.hh.

Member Data Documentation

const Representation Parma_Polyhedra_Library::Grid_Generator::default_representation = SPARSE
static

The representation used for new Grid_Generators.

Note
The copy constructor and the copy constructor with specified size use the representation of the original object, so that it is indistinguishable from the original object.

Definition at line 286 of file Grid_Generator_defs.hh.

Kind Parma_Polyhedra_Library::Grid_Generator::kind_
private
const PPL::Grid_Generator * Parma_Polyhedra_Library::Grid_Generator::zero_dim_point_p = 0
staticprivate

Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional space $\Rset^0$.

Definition at line 548 of file Grid_Generator_defs.hh.

Referenced by zero_dim_point().


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