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_System_defs_hh
00024 #define PPL_Generator_System_defs_hh 1
00025
00026 #include "Generator_System.types.hh"
00027 #include "Grid_Generator_System.types.hh"
00028 #include "Linear_Expression.types.hh"
00029 #include "Linear_System.defs.hh"
00030 #include "Generator.types.hh"
00031 #include "Constraint.types.hh"
00032 #include "Polyhedron.types.hh"
00033 #include "Poly_Con_Relation.defs.hh"
00034 #include "Grid.types.hh"
00035 #include <iosfwd>
00036
00037 namespace Parma_Polyhedra_Library {
00038
00039 namespace IO_Operators {
00040
00042
00047 std::ostream& operator<<(std::ostream& s, const Generator_System& gs);
00048
00049 }
00050
00051
00053 bool operator==(const Polyhedron& x, const Polyhedron& y);
00054
00055 }
00056
00057
00058 namespace std {
00059
00061
00062 void swap(Parma_Polyhedra_Library::Generator_System& x,
00063 Parma_Polyhedra_Library::Generator_System& y);
00064
00065 }
00066
00068
00183 class Parma_Polyhedra_Library::Generator_System : protected Linear_System {
00184 public:
00186 Generator_System();
00187
00189 explicit Generator_System(const Generator& g);
00190
00192 Generator_System(const Generator_System& gs);
00193
00195 ~Generator_System();
00196
00198 Generator_System& operator=(const Generator_System& y);
00199
00201 static dimension_type max_space_dimension();
00202
00204 dimension_type space_dimension() const;
00205
00210 void clear();
00211
00216 void insert(const Generator& g);
00217
00219 static void initialize();
00220
00222 static void finalize();
00223
00227 static const Generator_System& zero_dim_univ();
00228
00230
00250 class const_iterator
00251 : public std::iterator<std::forward_iterator_tag,
00252 Generator,
00253 ptrdiff_t,
00254 const Generator*,
00255 const Generator&> {
00256 public:
00258 const_iterator();
00259
00261 const_iterator(const const_iterator& y);
00262
00264 ~const_iterator();
00265
00267 const_iterator& operator=(const const_iterator& y);
00268
00270 const Generator& operator*() const;
00271
00273 const Generator* operator->() const;
00274
00276 const_iterator& operator++();
00277
00279 const_iterator operator++(int);
00280
00285 bool operator==(const const_iterator& y) const;
00286
00291 bool operator!=(const const_iterator& y) const;
00292
00293 private:
00294 friend class Generator_System;
00295
00297 Linear_System::const_iterator i;
00298
00300 const Linear_System* gsp;
00301
00303 const_iterator(const Linear_System::const_iterator& iter,
00304 const Generator_System& gsys);
00305
00310 void skip_forward();
00311 };
00312
00314 bool empty() const;
00315
00321 const_iterator begin() const;
00322
00324 const_iterator end() const;
00325
00327
00331 bool OK() const;
00332
00333 PPL_OUTPUT_DECLARATIONS
00334
00335 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00336
00345 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
00346 bool ascii_load(std::istream& s);
00347
00349 memory_size_type total_memory_in_bytes() const;
00350
00352 memory_size_type external_memory_in_bytes() const;
00353
00355 void swap(Generator_System& y);
00356
00357 private:
00362 static const Generator_System* zero_dim_univ_p;
00363
00364 friend class const_iterator;
00365 friend class Parma_Polyhedra_Library::Polyhedron;
00366 friend class Parma_Polyhedra_Library::Grid_Generator_System;
00367
00368 friend bool operator==(const Polyhedron& x, const Polyhedron& y);
00369
00371 explicit Generator_System(Topology topol);
00372
00378 Generator_System(Topology topol,
00379 dimension_type n_rows, dimension_type n_columns);
00380
00389 bool adjust_topology_and_space_dimension(Topology topol,
00390 dimension_type num_dimensions);
00391
00399 void add_corresponding_points();
00400
00405 bool has_points() const;
00406
00414 void add_corresponding_closure_points();
00415
00426 bool has_closure_points() const;
00427
00429 Generator& operator[](dimension_type k);
00430
00432 const Generator& operator[](dimension_type k) const;
00433
00438 Parma_Polyhedra_Library::Poly_Con_Relation
00439 relation_with(const Constraint& c) const;
00440
00442 bool satisfied_by_all_generators(const Constraint& c) const;
00443
00445
00448 bool satisfied_by_all_generators_C(const Constraint& c) const;
00449
00451
00454 bool satisfied_by_all_generators_NNC(const Constraint& c) const;
00455
00457
00483 void affine_image(dimension_type v,
00484 const Linear_Expression& expr,
00485 Coefficient_traits::const_reference denominator);
00486
00488 dimension_type num_lines() const;
00489
00491 dimension_type num_rays() const;
00492
00494
00498 void remove_invalid_lines_and_rays();
00499
00506 void simplify();
00507
00513 void insert_pending(const Generator& g);
00514 };
00515
00516
00517
00518 #endif // !defined(PPL_Generator_System_defs_hh)