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 : private 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
00222 static const Generator_System& zero_dim_univ();
00223
00225
00245 class const_iterator
00246 : public std::iterator<std::forward_iterator_tag,
00247 Generator,
00248 ptrdiff_t,
00249 const Generator*,
00250 const Generator&> {
00251 public:
00253 const_iterator();
00254
00256 const_iterator(const const_iterator& y);
00257
00259 ~const_iterator();
00260
00262 const_iterator& operator=(const const_iterator& y);
00263
00265 const Generator& operator*() const;
00266
00268 const Generator* operator->() const;
00269
00271 const_iterator& operator++();
00272
00274 const_iterator operator++(int);
00275
00280 bool operator==(const const_iterator& y) const;
00281
00286 bool operator!=(const const_iterator& y) const;
00287
00288 private:
00289 friend class Generator_System;
00290
00292 Linear_System::const_iterator i;
00293
00295 const Linear_System* gsp;
00296
00298 const_iterator(const Linear_System::const_iterator& iter,
00299 const Generator_System& gsys);
00300
00305 void skip_forward();
00306 };
00307
00313 const_iterator begin() const;
00314
00316 const_iterator end() const;
00317
00319
00323 bool OK() const;
00324
00325 PPL_OUTPUT_DECLARATIONS;
00326
00327 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00328
00337 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00338 bool ascii_load(std::istream& s);
00339
00341 memory_size_type total_memory_in_bytes() const;
00342
00344 memory_size_type external_memory_in_bytes() const;
00345
00347 void swap(Generator_System& y);
00348
00349 private:
00350 friend class const_iterator;
00351 friend class Parma_Polyhedra_Library::Polyhedron;
00352 friend class Parma_Polyhedra_Library::Grid_Generator_System;
00353
00354 friend bool
00355 Parma_Polyhedra_Library::operator==(const Polyhedron& x,
00356 const Polyhedron& y);
00357
00359 explicit Generator_System(Topology topol);
00360
00366 Generator_System(Topology topol,
00367 dimension_type n_rows, dimension_type n_columns);
00368
00377 bool adjust_topology_and_space_dimension(Topology topol,
00378 dimension_type num_dimensions);
00379
00387 void add_corresponding_points();
00388
00393 bool has_points() const;
00394
00402 void add_corresponding_closure_points();
00403
00414 bool has_closure_points() const;
00415
00417 Generator& operator[](dimension_type k);
00418
00420 const Generator& operator[](dimension_type k) const;
00421
00426 Parma_Polyhedra_Library::Poly_Con_Relation
00427 relation_with(const Constraint& c) const;
00428
00430 bool satisfied_by_all_generators(const Constraint& c) const;
00431
00433
00436 bool satisfied_by_all_generators_C(const Constraint& c) const;
00437
00439
00442 bool satisfied_by_all_generators_NNC(const Constraint& c) const;
00443
00445
00471 void affine_image(dimension_type v,
00472 const Linear_Expression& expr,
00473 Coefficient_traits::const_reference denominator);
00474
00476 dimension_type num_lines() const;
00477
00479 dimension_type num_rays() const;
00480
00482
00486 void remove_invalid_lines_and_rays();
00487
00494 void simplify();
00495
00501 void insert_pending(const Generator& g);
00502 };
00503
00504
00505
00506 #endif // !defined(PPL_Generator_System_defs_hh)