00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PPL_Generator_defs_hh
00024 #define PPL_Generator_defs_hh 1
00025
00026 #include "Generator.types.hh"
00027 #include "Scalar_Products.types.hh"
00028 #include "Row.defs.hh"
00029 #include "Variable.defs.hh"
00030 #include "Constraint_System.types.hh"
00031 #include "Generator_System.defs.hh"
00032 #include "Congruence_System.types.hh"
00033 #include "Linear_Expression.defs.hh"
00034 #include "Polyhedron.types.hh"
00035 #include "Grid_Generator.types.hh"
00036 #include "Grid_Generator_System.types.hh"
00037 #include <iosfwd>
00038
00039 namespace Parma_Polyhedra_Library {
00040
00041
00042
00043 namespace IO_Operators {
00044
00046
00047 std::ostream& operator<<(std::ostream& s, const Generator& g);
00048
00049 }
00050
00051 }
00052
00053 namespace std {
00054
00056
00057 void swap(Parma_Polyhedra_Library::Generator& x,
00058 Parma_Polyhedra_Library::Generator& y);
00059
00060 }
00061
00062
00064
00241 class Parma_Polyhedra_Library::Generator : private Linear_Row {
00242 public:
00244
00249 static Generator line(const Linear_Expression& e);
00250
00252
00257 static Generator ray(const Linear_Expression& e);
00258
00260
00267 static Generator point(const Linear_Expression& e
00268 = Linear_Expression::zero(),
00269 Coefficient_traits::const_reference d
00270 = Coefficient_one());
00271
00273
00280 static Generator
00281 closure_point(const Linear_Expression& e = Linear_Expression::zero(),
00282 Coefficient_traits::const_reference d = Coefficient_one());
00283
00285 Generator(const Generator& g);
00286
00288 ~Generator();
00289
00291 Generator& operator=(const Generator& g);
00292
00294 static dimension_type max_space_dimension();
00295
00297 dimension_type space_dimension() const;
00298
00300 enum Type {
00302 LINE,
00304 RAY,
00306 POINT,
00308 CLOSURE_POINT
00309 };
00310
00312 Type type() const;
00313
00315 bool is_line() const;
00316
00318 bool is_ray() const;
00319
00320 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00322 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00323 bool is_line_or_ray() const;
00324
00326 bool is_point() const;
00327
00329 bool is_closure_point() const;
00330
00332
00337 Coefficient_traits::const_reference coefficient(Variable v) const;
00338
00340
00344 Coefficient_traits::const_reference divisor() const;
00345
00347 static const Generator& zero_dim_point();
00348
00353 static const Generator& zero_dim_closure_point();
00354
00359 memory_size_type total_memory_in_bytes() const;
00360
00362 memory_size_type external_memory_in_bytes() const;
00363
00370 bool is_equivalent_to(const Generator& y) const;
00371
00372 PPL_OUTPUT_DECLARATIONS;
00373
00374 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00375
00380 #endif
00381 bool ascii_load(std::istream& s);
00382
00384 bool OK() const;
00385
00387 void swap(Generator& y);
00388
00389 private:
00394 Generator(Linear_Expression& e, Type type, Topology topology);
00395
00400 void
00401 throw_dimension_incompatible(const char* method,
00402 const char* name_var,
00403 Variable v) const;
00404
00409 void
00410 throw_invalid_argument(const char* method, const char* reason) const;
00411
00412 friend class Parma_Polyhedra_Library::Scalar_Products;
00413 friend class Parma_Polyhedra_Library::Topology_Adjusted_Scalar_Product_Sign;
00414 friend class Parma_Polyhedra_Library::Topology_Adjusted_Scalar_Product_Assign;
00415 friend class Parma_Polyhedra_Library::Generator_System;
00416 friend class Parma_Polyhedra_Library::Generator_System::const_iterator;
00417
00418 friend class Parma_Polyhedra_Library::Polyhedron;
00419 friend class Parma_Polyhedra_Library::Grid_Generator;
00420
00421 friend class Parma_Polyhedra_Library::Grid_Generator_System;
00422
00423 friend
00424 Parma_Polyhedra_Library
00425 ::Linear_Expression::Linear_Expression(const Generator& g);
00426
00427 friend std::ostream&
00428 Parma_Polyhedra_Library::IO_Operators::operator<<(std::ostream& s,
00429 const Generator& g);
00430
00432 Generator(const Generator& g, dimension_type dimension);
00433
00435 bool is_ray_or_point() const;
00436
00438 void set_is_line();
00439
00441 void set_is_ray_or_point();
00442
00450 bool is_matching_closure_point(const Generator& p) const;
00451
00453 Generator();
00454 };
00455
00456
00457 namespace Parma_Polyhedra_Library {
00458
00460
00461 Generator line(const Linear_Expression& e);
00462
00464
00465 Generator ray(const Linear_Expression& e);
00466
00473 Generator
00474 point(const Linear_Expression& e = Linear_Expression::zero(),
00475 Coefficient_traits::const_reference d = Coefficient_one());
00476
00483 Generator
00484 closure_point(const Linear_Expression& e = Linear_Expression::zero(),
00485 Coefficient_traits::const_reference d = Coefficient_one());
00486
00488
00489 bool operator==(const Generator& x, const Generator& y);
00490
00492
00493 bool operator!=(const Generator& x, const Generator& y);
00494
00495
00496 namespace IO_Operators {
00497
00499
00500 std::ostream& operator<<(std::ostream& s, const Generator::Type& t);
00501
00502 }
00503
00504 }
00505
00506 #include "Generator.inlines.hh"
00507
00508 #endif // !defined(PPL_Generator_defs_hh)