00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PPL_Grid_Generator_System_defs_hh
00025 #define PPL_Grid_Generator_System_defs_hh 1
00026
00027 #include "Grid_Generator_System.types.hh"
00028 #include "Generator_System.defs.hh"
00029 #include "Grid_Generator.types.hh"
00030 #include "Variables_Set.types.hh"
00031 #include "Grid.types.hh"
00032 #include <iosfwd>
00033
00034 namespace Parma_Polyhedra_Library {
00035
00036 namespace IO_Operators {
00037
00039
00044 std::ostream& operator<<(std::ostream& s, const Grid_Generator_System& gs);
00045
00046 }
00047
00049
00050 bool operator==(const Grid_Generator_System& x,
00051 const Grid_Generator_System& y);
00052
00053 }
00054
00055 namespace std {
00056
00058
00059 void swap(Parma_Polyhedra_Library::Grid_Generator_System& x,
00060 Parma_Polyhedra_Library::Grid_Generator_System& y);
00061
00062 }
00063
00064
00066
00179 class Parma_Polyhedra_Library::Grid_Generator_System
00180 : private Generator_System {
00181 public:
00183 Grid_Generator_System();
00184
00186 explicit Grid_Generator_System(const Grid_Generator& g);
00187
00189 explicit Grid_Generator_System(dimension_type dim);
00190
00192 Grid_Generator_System(const Grid_Generator_System& gs);
00193
00195 ~Grid_Generator_System();
00196
00198 Grid_Generator_System& operator=(const Grid_Generator_System& y);
00199
00201 static dimension_type max_space_dimension();
00202
00204 dimension_type space_dimension() const;
00205
00210 void clear();
00211
00220 void insert(const Grid_Generator& g);
00221
00226 void recycling_insert(Grid_Generator& g);
00227
00232 void recycling_insert(Grid_Generator_System& gs);
00233
00235 static void initialize();
00236
00238 static void finalize();
00239
00244 static const Grid_Generator_System& zero_dim_univ();
00245
00247
00267 class const_iterator
00268 : public std::iterator<std::forward_iterator_tag,
00269 Grid_Generator,
00270 ptrdiff_t,
00271 const Grid_Generator*,
00272 const Grid_Generator&>,
00273 private Generator_System::const_iterator {
00274 public:
00276 const_iterator();
00277
00279 const_iterator(const const_iterator& y);
00280
00282 ~const_iterator();
00283
00285 const_iterator& operator=(const const_iterator& y);
00286
00288 const Grid_Generator& operator*() const;
00289
00291 const Grid_Generator* operator->() const;
00292
00294 const_iterator& operator++();
00295
00297 const_iterator operator++(int);
00298
00303 bool operator==(const const_iterator& y) const;
00304
00309 bool operator!=(const const_iterator& y) const;
00310
00311 private:
00312 friend class Grid_Generator_System;
00313
00315 const_iterator(const Generator_System::const_iterator& y);
00316 };
00317
00319 bool empty() const;
00320
00326 const_iterator begin() const;
00327
00329 const_iterator end() const;
00330
00332 dimension_type num_rows() const;
00333
00335 dimension_type num_parameters() const;
00336
00338 dimension_type num_lines() const;
00339
00344 bool has_points() const;
00345
00347 bool is_equal_to(const Grid_Generator_System& y) const;
00348
00350
00354 bool OK() const;
00355
00356 PPL_OUTPUT_DECLARATIONS
00357
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& vars);
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)