PPL  1.2
Generator_inlines.hh
Go to the documentation of this file.
1 /* Generator class implementation: inline functions.
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_Generator_inlines_hh
25 #define PPL_Generator_inlines_hh 1
26 
27 namespace Parma_Polyhedra_Library {
28 
29 inline bool
31  return (topology() == NECESSARILY_CLOSED);
32 }
33 
34 inline bool
36  return (topology() == NOT_NECESSARILY_CLOSED);
37 }
38 
42 }
43 
44 inline dimension_type
46  return expression().space_dimension();
47 }
48 
49 inline bool
51  return (kind_ == LINE_OR_EQUALITY);
52 }
53 
54 inline bool
57 }
58 
59 inline Topology
61  return topology_;
62 }
63 
64 inline void
67 }
68 
69 inline void
72 }
73 
74 inline void
76  if (topology() == x) {
77  return;
78  }
79  if (topology() == NECESSARILY_CLOSED) {
80  // Add a column for the epsilon dimension.
82  }
83  else {
84  PPL_ASSERT(expr.space_dimension() > 0);
86  }
87  topology_ = x;
88 }
89 
90 inline void
92  PPL_ASSERT(is_not_necessarily_closed());
94 }
95 
96 inline void
98  PPL_ASSERT(is_necessarily_closed());
100 }
101 
102 inline void
105 }
106 
107 inline void
110 }
111 
112 inline
114  : expr(r),
115  kind_(RAY_OR_POINT_OR_INEQUALITY),
116  topology_(NECESSARILY_CLOSED) {
118  PPL_ASSERT(space_dimension() == 0);
119  PPL_ASSERT(OK());
120 }
121 
122 inline
124  Representation r)
125  : expr(r),
126  kind_(kind),
127  topology_(topology) {
128  if (is_necessarily_closed()) {
129  expr.set_space_dimension(space_dim);
130  }
131  else {
132  expr.set_space_dimension(space_dim + 1);
133  }
134  PPL_ASSERT(space_dimension() == space_dim);
135  PPL_ASSERT(OK());
136 }
137 
138 inline
140  : topology_(topology) {
141  PPL_ASSERT(type != CLOSURE_POINT || topology == NOT_NECESSARILY_CLOSED);
142  swap(expr, e);
143  if (topology == NOT_NECESSARILY_CLOSED) {
145  }
146  if (type == LINE) {
148  }
149  else {
151  }
153 }
154 
155 inline
157  : kind_(kind),
158  topology_(topology) {
159  swap(expr, e);
160  if (topology == NOT_NECESSARILY_CLOSED) {
162  }
164 }
165 
166 inline
168  : expr(g.expr),
169  kind_(g.kind_),
170  topology_(g.topology_) {
171 }
172 
173 inline
175  : expr(g.expr, r),
176  kind_(g.kind_),
177  topology_(g.topology_) {
178  // This does not assert OK() because it's called by OK().
179  PPL_ASSERT(OK());
180 }
181 
182 inline
184  : expr(g.expr, g.is_necessarily_closed() ? space_dim : (space_dim + 1)),
185  kind_(g.kind_),
186  topology_(g.topology_) {
187  PPL_ASSERT(OK());
188  PPL_ASSERT(space_dimension() == space_dim);
189 }
190 
191 inline
193  Representation r)
194  : expr(g.expr, g.is_necessarily_closed() ? space_dim : (space_dim + 1), r),
195  kind_(g.kind_),
196  topology_(g.topology_) {
197  PPL_ASSERT(OK());
198  PPL_ASSERT(space_dimension() == space_dim);
199 }
200 
201 inline
203 }
204 
205 inline Generator&
207  Generator tmp = g;
208  swap(*this, tmp);
209 
210  return *this;
211 }
212 
213 inline Representation
215  return expr.representation();
216 }
217 
218 inline void
221 }
222 
223 inline dimension_type
226 }
227 
228 inline void
230  const dimension_type old_expr_space_dim = expr.space_dimension();
231  if (topology() == NECESSARILY_CLOSED) {
232  expr.set_space_dimension(space_dim);
233  }
234  else {
235  const dimension_type old_space_dim = space_dimension();
236  if (space_dim > old_space_dim) {
237  expr.set_space_dimension(space_dim + 1);
238  expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
239  }
240  else {
241  expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
242  expr.set_space_dimension(space_dim + 1);
243  }
244  }
245  PPL_ASSERT(space_dimension() == space_dim);
246  if (expr.space_dimension() < old_expr_space_dim) {
248  }
249 }
250 
251 inline void
253  set_space_dimension_no_ok(space_dim);
254  PPL_ASSERT(OK());
255 }
256 
257 inline void
260 }
261 
262 inline bool
264  return is_line_or_equality();
265 }
266 
267 inline bool
270 }
271 
272 inline bool
274  return expr.inhomogeneous_term() == 0;
275 }
276 
277 inline bool
279  return is_ray_or_point() && is_line_or_ray();
280 }
281 
282 inline Generator::Type
284  if (is_line()) {
285  return LINE;
286  }
287  if (is_line_or_ray()) {
288  return RAY;
289  }
290  if (is_necessarily_closed()) {
291  return POINT;
292  }
293  else {
294  // Checking the value of the epsilon coefficient.
295  if (epsilon_coefficient() == 0) {
296  return CLOSURE_POINT;
297  }
298  else {
299  return POINT;
300  }
301  }
302 }
303 
304 inline bool
306  return type() == POINT;
307 }
308 
309 inline bool
311  return type() == CLOSURE_POINT;
312 }
313 
314 inline void
317 }
318 
319 inline void
322 }
323 
324 inline Coefficient_traits::const_reference
326  if (v.space_dimension() > space_dimension()) {
327  throw_dimension_incompatible("coefficient(v)", "v", v);
328  }
329  return expr.coefficient(v);
330 }
331 
332 inline Coefficient_traits::const_reference
334  Coefficient_traits::const_reference d = expr.inhomogeneous_term();
335  if (!is_ray_or_point() || d == 0) {
336  throw_invalid_argument("divisor()",
337  "*this is neither a point nor a closure point");
338  }
339  return d;
340 }
341 
342 inline Coefficient_traits::const_reference
344  PPL_ASSERT(is_not_necessarily_closed());
346 }
347 
348 
349 inline void
350 Generator::set_epsilon_coefficient(Coefficient_traits::const_reference n) {
351  PPL_ASSERT(is_not_necessarily_closed());
353 }
354 
355 
356 inline memory_size_type
359 }
360 
361 inline memory_size_type
363  return sizeof(*this) + external_memory_in_bytes();
364 }
365 
366 inline void
368  expr.normalize();
369  sign_normalize();
370 }
371 
372 inline const Generator&
374  PPL_ASSERT(zero_dim_point_p != 0);
375  return *zero_dim_point_p;
376 }
377 
378 inline const Generator&
380  PPL_ASSERT(zero_dim_closure_point_p != 0);
381  return *zero_dim_closure_point_p;
382 }
383 
385 inline Generator
387  return Generator::line(e, r);
388 }
389 
391 inline Generator
393  return Generator::ray(e, r);
394 }
395 
397 inline Generator
398 point(const Linear_Expression& e, Coefficient_traits::const_reference d,
399  Representation r) {
400  return Generator::point(e, d, r);
401 }
402 
404 inline Generator
406  return Generator::point(r);
407 }
408 
410 inline Generator
412  return Generator::point(e, r);
413 }
414 
416 inline Generator
418  Coefficient_traits::const_reference d,
419  Representation r) {
420  return Generator::closure_point(e, d, r);
421 }
422 
424 inline Generator
426  return Generator::closure_point(r);
427 }
428 
430 inline Generator
432  Representation r) {
433  return Generator::closure_point(e, r);
434 }
435 
437 inline bool
438 operator==(const Generator& x, const Generator& y) {
439  return x.is_equivalent_to(y);
440 }
441 
443 inline bool
444 operator!=(const Generator& x, const Generator& y) {
445  return !x.is_equivalent_to(y);
446 }
447 
448 inline void
449 Generator::ascii_dump(std::ostream& s) const {
450 
451  expr.ascii_dump(s);
452 
453  s << " ";
454 
455  switch (type()) {
456  case Generator::LINE:
457  s << "L ";
458  break;
459  case Generator::RAY:
460  s << "R ";
461  break;
462  case Generator::POINT:
463  s << "P ";
464  break;
466  s << "C ";
467  break;
468  }
469  if (is_necessarily_closed()) {
470  s << "(C)";
471  }
472  else {
473  s << "(NNC)";
474  }
475  s << "\n";
476 }
477 
478 inline bool
479 Generator::ascii_load(std::istream& s) {
480  std::string str;
481 
482  expr.ascii_load(s);
483 
484  if (!(s >> str)) {
485  return false;
486  }
487  if (str == "L") {
488  set_is_line();
489  }
490  else if (str == "R" || str == "P" || str == "C") {
492  }
493  else {
494  return false;
495  }
496 
497  std::string str2;
498 
499  if (!(s >> str2)) {
500  return false;
501  }
502  if (str2 == "(C)") {
504  // TODO: Avoid using the mark_as_*() methods if possible.
506  }
507  }
508  else {
509  if (str2 == "(NNC)") {
510  if (is_necessarily_closed()) {
511  // TODO: Avoid using the mark_as_*() methods if possible.
513  }
514  }
515  else {
516  return false;
517  }
518  }
519 
520  // Checking for equality of actual and declared types.
521  switch (type()) {
522  case Generator::LINE:
523  if (str != "L") {
524  return false;
525  }
526  break;
527  case Generator::RAY:
528  if (str != "R") {
529  return false;
530  }
531  break;
532  case Generator::POINT:
533  if (str != "P") {
534  return false;
535  }
536  break;
538  if (str != "C") {
539  return false;
540  }
541  break;
542  }
543 
544  return true;
545 }
546 
547 inline void
549  using std::swap;
550  swap(expr, y.expr);
551  swap(kind_, y.kind_);
553 }
554 
555 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
556 
557 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
558 template <typename Specialization, typename Temp, typename To>
559 inline bool
561  const Generator& x,
562  const Generator& y,
563  const Rounding_Dir dir,
564  Temp& tmp0,
565  Temp& tmp1,
566  Temp& tmp2) {
567  // Generator kind compatibility check: we only compute distances
568  // between (closure) points.
569  if (x.is_line_or_ray() || y.is_line_or_ray()) {
570  return false;
571  }
572  const dimension_type x_space_dim = x.space_dimension();
573  // Dimension-compatibility check.
574  if (x_space_dim != y.space_dimension()) {
575  return false;
576  }
577 
578  // All zero-dim generators have distance zero.
579  if (x_space_dim == 0) {
580  assign_r(r, 0, ROUND_NOT_NEEDED);
581  return true;
582  }
583 
584  PPL_DIRTY_TEMP(mpq_class, x_coord);
585  PPL_DIRTY_TEMP(mpq_class, y_coord);
586  PPL_DIRTY_TEMP(mpq_class, x_div);
587  PPL_DIRTY_TEMP(mpq_class, y_div);
588  assign_r(x_div, x.divisor(), ROUND_NOT_NEEDED);
589  assign_r(y_div, y.divisor(), ROUND_NOT_NEEDED);
590 
591  assign_r(tmp0, 0, ROUND_NOT_NEEDED);
592  // TODO: This loop can be optimized more, if needed.
593  for (dimension_type i = x_space_dim; i-- > 0; ) {
595  div_assign_r(x_coord, x_coord, x_div, ROUND_NOT_NEEDED);
597  div_assign_r(y_coord, y_coord, y_div, ROUND_NOT_NEEDED);
598  const Temp* tmp1p;
599  const Temp* tmp2p;
600 
601  if (x_coord > y_coord) {
602  maybe_assign(tmp1p, tmp1, x_coord, dir);
603  maybe_assign(tmp2p, tmp2, y_coord, inverse(dir));
604  }
605  else {
606  maybe_assign(tmp1p, tmp1, y_coord, dir);
607  maybe_assign(tmp2p, tmp2, x_coord, inverse(dir));
608  }
609  sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
610  PPL_ASSERT(sgn(tmp1) >= 0);
611  Specialization::combine(tmp0, tmp1, dir);
612  }
613  Specialization::finalize(tmp0, dir);
614  assign_r(r, tmp0, dir);
615  return true;
616 }
617 
619 template <typename Temp, typename To>
620 inline bool
622  const Generator& x,
623  const Generator& y,
624  const Rounding_Dir dir,
625  Temp& tmp0,
626  Temp& tmp1,
627  Temp& tmp2) {
628  return l_m_distance_assign<Rectilinear_Distance_Specialization<Temp> >
629  (r, x, y, dir, tmp0, tmp1, tmp2);
630 }
631 
633 template <typename Temp, typename To>
634 inline bool
636  const Generator& x,
637  const Generator& y,
638  const Rounding_Dir dir) {
640  PPL_DIRTY_TEMP(Checked_Temp, tmp0);
641  PPL_DIRTY_TEMP(Checked_Temp, tmp1);
642  PPL_DIRTY_TEMP(Checked_Temp, tmp2);
643  return rectilinear_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
644 }
645 
647 template <typename To>
648 inline bool
650  const Generator& x,
651  const Generator& y,
652  const Rounding_Dir dir) {
653  return rectilinear_distance_assign<To, To>(r, x, y, dir);
654 }
655 
657 template <typename Temp, typename To>
658 inline bool
660  const Generator& x,
661  const Generator& y,
662  const Rounding_Dir dir,
663  Temp& tmp0,
664  Temp& tmp1,
665  Temp& tmp2) {
666  return l_m_distance_assign<Euclidean_Distance_Specialization<Temp> >
667  (r, x, y, dir, tmp0, tmp1, tmp2);
668 }
669 
671 template <typename Temp, typename To>
672 inline bool
674  const Generator& x,
675  const Generator& y,
676  const Rounding_Dir dir) {
678  PPL_DIRTY_TEMP(Checked_Temp, tmp0);
679  PPL_DIRTY_TEMP(Checked_Temp, tmp1);
680  PPL_DIRTY_TEMP(Checked_Temp, tmp2);
681  return euclidean_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
682 }
683 
685 template <typename To>
686 inline bool
688  const Generator& x,
689  const Generator& y,
690  const Rounding_Dir dir) {
691  return euclidean_distance_assign<To, To>(r, x, y, dir);
692 }
693 
695 template <typename Temp, typename To>
696 inline bool
698  const Generator& x,
699  const Generator& y,
700  const Rounding_Dir dir,
701  Temp& tmp0,
702  Temp& tmp1,
703  Temp& tmp2) {
704  return l_m_distance_assign<L_Infinity_Distance_Specialization<Temp> >
705  (r, x, y, dir, tmp0, tmp1, tmp2);
706 }
707 
709 template <typename Temp, typename To>
710 inline bool
712  const Generator& x,
713  const Generator& y,
714  const Rounding_Dir dir) {
716  PPL_DIRTY_TEMP(Checked_Temp, tmp0);
717  PPL_DIRTY_TEMP(Checked_Temp, tmp1);
718  PPL_DIRTY_TEMP(Checked_Temp, tmp2);
719  return l_infinity_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
720 }
721 
723 template <typename To>
724 inline bool
726  const Generator& x,
727  const Generator& y,
728  const Rounding_Dir dir) {
729  return l_infinity_distance_assign<To, To>(r, x, y, dir);
730 }
731 
733 inline void
735  x.m_swap(y);
736 }
737 
738 } // namespace Parma_Polyhedra_Library
739 
740 #endif // !defined(PPL_Generator_inlines_hh)
bool is_not_necessarily_closed() const
Returns true if and only if the topology of *this row is not necessarily closed.
void m_swap(Generator &y)
Swaps *this with y.
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &, Rounding_Dir dir)
bool euclidean_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir)
void set_necessarily_closed()
Sets to NECESSARILY_CLOSED the topological kind of *this row.
void swap(CO_Tree &x, CO_Tree &y)
void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void shift_space_dimensions(Variable v, dimension_type n)
void throw_invalid_argument(const char *method, const char *reason) const
Throw a std::invalid_argument exception containing the appropriate error message. ...
Definition: Generator.cc:48
A line, ray, point or closure point.
Linear_Expression expr
The linear expression encoding *this.
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
bool is_line_or_ray() const
Returns true if and only if *this is a line or a ray.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
Rounding_Dir
Rounding directions for arithmetic computations.
Representation representation() const
Returns the current representation of *this.
static const Generator & zero_dim_point()
Returns the origin of the zero-dimensional space .
bool euclidean_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
static Generator ray(const Linear_Expression &e, Representation r=default_representation)
Returns the ray of direction e.
Definition: Generator.cc:128
bool is_ray_or_point() const
Returns true if and only if *this is not a line.
Generator point(const Linear_Expression &e, Representation r)
static const Generator * zero_dim_closure_point_p
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional...
Expression_Hide_Last< Expression_Hide_Inhomo< Linear_Expression > > expr_type
The type of the (adapted) internal expression.
expr_type expression() const
Partial read access to the (adapted) internal expression.
void set_is_line_or_equality()
Sets to LINE_OR_EQUALITY the kind of *this row.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void set_coefficient(Variable v, Coefficient_traits::const_reference n)
Sets the coefficient of v in *this to n.
void swap(Generator &x, Generator &y)
Swaps x with y.
void set_inhomogeneous_term(Coefficient_traits::const_reference n)
Sets the inhomogeneous term of *this to n.
bool is_equivalent_to(const Generator &y) const
Returns true if and only if *this and y are equivalent generators.
Definition: Generator.cc:226
bool operator!=(const Generator &x, const Generator &y)
static Generator closure_point(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
Returns the closure point at e / d.
Definition: Generator.cc:92
void set_is_ray_or_point()
Sets the Generator kind to RAY_OR_POINT_OR_INEQUALITY.
void set_topology(Topology x)
Sets to x the topological kind of *this row.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
static Generator line(const Linear_Expression &e, Representation r=default_representation)
Returns the line of direction e.
Definition: Generator.cc:143
bool l_infinity_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
A dimension of the vector space.
Kind
The possible kinds of Generator objects.
void set_space_dimension_no_ok(dimension_type space_dim)
Rounding_Dir inverse(Rounding_Dir dir)
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_Expression can handle.
A wrapper for numeric types implementing a given policy.
bool rectilinear_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
Generator(Representation r=default_representation)
Constructs the point at the origin.
void set_representation(Representation r)
Converts *this to the specified representation.
void finalize()
Finalizes the library.
Definition: initializer.hh:60
bool operator==(const Generator &x, const Generator &y)
Generator ray(const Linear_Expression &e, Representation r)
Type type() const
Returns the generator type of *this.
bool OK() const
Checks if all the invariants are satisfied.
Definition: Generator.cc:432
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool l_infinity_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir)
void sign_normalize()
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a lin...
Definition: Generator.cc:264
void set_not_necessarily_closed()
Sets to NOT_NECESSARILY_CLOSED the topological kind of *this row.
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
void mark_as_necessarily_closed()
Marks the epsilon dimension as a standard dimension.
bool is_point() const
Returns true if and only if *this is a point.
#define PPL_DIRTY_TEMP(T, id)
Generator closure_point(const Linear_Expression &e, Coefficient_traits::const_reference d, Representation r)
Generator point(const Linear_Expression &e, Coefficient_traits::const_reference d, Representation r)
static const Generator & zero_dim_closure_point()
Returns, as a closure point, the origin of the zero-dimensional space .
void mark_as_not_necessarily_closed()
Marks the last dimension as the epsilon dimension.
static Generator 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.
Definition: Generator.cc:57
static const Generator * zero_dim_point_p
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional...
bool l_infinity_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir)
void set_space_dimension(dimension_type space_dim)
Generator closure_point(const Linear_Expression &e, Representation r)
Generator & operator=(const Generator &g)
Assignment operator.
Generator closure_point(Representation r)
void set_representation(Representation r)
Converts *this to the specified representation.
void set_is_ray_or_point_or_inequality()
Sets to RAY_OR_POINT_OR_INEQUALITY the kind of *this row.
void strong_normalize()
Strong normalization: ensures that different Generator objects represent different hyperplanes or hyp...
bool is_ray() const
Returns true if and only if *this is a ray.
The entire library is confined to this namespace.
Definition: version.hh:61
Representation representation() const
Returns the current representation of *this.
void set_epsilon_coefficient(Coefficient_traits::const_reference n)
Sets the epsilon coefficient to n. The generator must be NNC.
void set_is_line()
Sets the Generator kind to LINE_OR_EQUALITY.
bool rectilinear_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir)
bool is_ray_or_point_or_inequality() const
Returns true if and only if *this row represents a ray, a point or an inequality. ...
Topology topology() const
Returns the topological kind of *this.
bool l_m_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
Coefficient_traits::const_reference epsilon_coefficient() const
Returns the epsilon coefficient. The generator must be NNC.
I_Result combine(Result l, Result u)
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
int sgn(Boundary_Type type, const T &x, const Info &info)
bool euclidean_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir)
bool is_necessarily_closed() const
Returns true if and only if the topology of *this row is necessarily closed.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
Coefficient_traits::const_reference divisor() const
If *this is either a point or a closure point, returns its divisor.
Generator point(Representation r)
Generator line(const Linear_Expression &e, Representation r)
bool rectilinear_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const Generator &x, const Generator &y, const Rounding_Dir dir)
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
bool is_line_or_equality() const
Returns true if and only if *this row represents a line or an equality.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
bool is_line() const
Returns true if and only if *this is a line.
An adapter for Linear_Expression that maybe hides the last coefficient.
void throw_dimension_incompatible(const char *method, const char *v_name, Variable v) const
Throw a std::invalid_argument exception containing the appropriate error message. ...
Definition: Generator.cc:37
Topology
Kinds of polyhedra domains.
Result maybe_assign(const To *&top, To &tmp, const From &from, Rounding_Dir dir)
Assigns to top a pointer to a location that holds the conversion, according to dir, of from to type To. When necessary, and only when necessary, the variable tmp is used to hold the result of conversion.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Generator can handle.
bool is_closure_point() const
Returns true if and only if *this is a closure point.
Topology topology_
The topology of *this.
void shift_space_dimensions(Variable v, dimension_type n)