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_Grid_Generator_System_defs_hh
00024 #define PPL_Grid_Generator_System_defs_hh 1
00025
00026 #include "Grid_Generator_System.types.hh"
00027 #include "Generator_System.defs.hh"
00028 #include "Grid_Generator.types.hh"
00029 #include "Variables_Set.types.hh"
00030 #include <iosfwd>
00031
00032 namespace Parma_Polyhedra_Library {
00033
00034 namespace IO_Operators {
00035
00037
00042 std::ostream& operator<<(std::ostream& s, const Grid_Generator_System& gs);
00043
00044 }
00045
00047
00048 bool operator==(const Grid_Generator_System& x,
00049 const Grid_Generator_System& y);
00050
00051 }
00052
00053 namespace std {
00054
00056
00057 void swap(Parma_Polyhedra_Library::Grid_Generator_System& x,
00058 Parma_Polyhedra_Library::Grid_Generator_System& y);
00059
00060 }
00061
00062
00064
00177 class Parma_Polyhedra_Library::Grid_Generator_System
00178 : private Generator_System {
00179 public:
00181 Grid_Generator_System();
00182
00184 explicit Grid_Generator_System(const Grid_Generator& g);
00185
00187 explicit Grid_Generator_System(dimension_type dim);
00188
00190 Grid_Generator_System(const Grid_Generator_System& gs);
00191
00193 ~Grid_Generator_System();
00194
00196 Grid_Generator_System& operator=(const Grid_Generator_System& y);
00197
00199 static dimension_type max_space_dimension();
00200
00202 dimension_type space_dimension() const;
00203
00208 void clear();
00209
00218 void insert(const Grid_Generator& g);
00219
00224 void recycling_insert(Grid_Generator& g);
00225
00230 void recycling_insert(Grid_Generator_System& gs);
00231
00233 static void initialize();
00234
00236 static void finalize();
00237
00242 static const Grid_Generator_System& zero_dim_univ();
00243
00245
00265 class const_iterator
00266 : public std::iterator<std::forward_iterator_tag,
00267 Grid_Generator,
00268 ptrdiff_t,
00269 const Grid_Generator*,
00270 const Grid_Generator&>,
00271 private Generator_System::const_iterator {
00272 public:
00274 const_iterator();
00275
00277 const_iterator(const const_iterator& y);
00278
00280 ~const_iterator();
00281
00283 const_iterator& operator=(const const_iterator& y);
00284
00286 const Grid_Generator& operator*() const;
00287
00289 const Grid_Generator* operator->() const;
00290
00292 const_iterator& operator++();
00293
00295 const_iterator operator++(int);
00296
00301 bool operator==(const const_iterator& y) const;
00302
00307 bool operator!=(const const_iterator& y) const;
00308
00309 private:
00310 friend class Grid_Generator_System;
00311
00313 const_iterator(const Generator_System::const_iterator& y);
00314 };
00315
00317 bool empty() const;
00318
00324 const_iterator begin() const;
00325
00327 const_iterator end() const;
00328
00330 dimension_type num_rows() const;
00331
00333 dimension_type num_parameters() const;
00334
00336 dimension_type num_lines() const;
00337
00342 bool has_points() const;
00343
00345 bool is_equal_to(const Grid_Generator_System& y) const;
00346
00348
00352 bool OK() const;
00353
00354 PPL_OUTPUT_DECLARATIONS
00355
00356 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00357
00366 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
00367 bool ascii_load(std::istream& s);
00368
00370 memory_size_type total_memory_in_bytes() const;
00371
00373 memory_size_type external_memory_in_bytes() const;
00374
00376 void swap(Grid_Generator_System& y);
00377
00378 private:
00383 static const Grid_Generator_System* zero_dim_univ_p;
00384
00385 friend class Grid;
00386
00387 friend bool
00388 operator==(const Grid_Generator_System& x, const Grid_Generator_System& y);
00389
00391 void set_sorted(bool b);
00392
00394 void unset_pending_rows();
00395
00397 void set_index_first_pending_row(dimension_type i);
00398
00400 Grid_Generator& operator[](dimension_type k);
00401
00403 const Grid_Generator& operator[](dimension_type k) const;
00404
00406
00434 void affine_image(dimension_type v,
00435 const Linear_Expression& expr,
00436 Coefficient_traits::const_reference denominator);
00437
00453 void add_universe_rows_and_columns(dimension_type dims);
00454
00456
00461 void remove_space_dimensions(const Variables_Set& to_be_removed);
00462
00470 void remove_higher_space_dimensions(dimension_type new_dimension);
00471
00473
00484 void resize_no_copy(dimension_type new_num_rows,
00485 dimension_type new_num_columns);
00486
00491 dimension_type num_columns() const;
00492
00497 void erase_to_end(dimension_type first_to_erase);
00498
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515 void permute_columns(const std::vector<dimension_type>& cycles);
00516 };
00517
00518
00519
00520 #endif // !defined(PPL_Grid_Generator_System_defs_hh)