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_defs_hh
00024 #define PPL_Grid_Generator_defs_hh 1
00025
00026 #include "Grid_Generator.types.hh"
00027 #include "Grid_Generator_System.defs.hh"
00028 #include "Generator.defs.hh"
00029 #include "Grid.types.hh"
00030 #include <iosfwd>
00031
00032 namespace Parma_Polyhedra_Library {
00033
00034
00035
00036 namespace IO_Operators {
00037
00039
00040 std::ostream& operator<<(std::ostream& s, const Grid_Generator& g);
00041
00042 }
00043
00044 }
00045
00046 namespace std {
00047
00049
00050 void swap(Parma_Polyhedra_Library::Grid_Generator& x,
00051 Parma_Polyhedra_Library::Grid_Generator& y);
00052
00053 }
00054
00056
00226 class Parma_Polyhedra_Library::Grid_Generator : private Generator {
00227 public:
00228
00229
00231 dimension_type space_dimension() const;
00232
00234 enum Type {
00236 LINE,
00238 PARAMETER,
00240 POINT
00241 };
00242
00244 Type type() const;
00245
00247 bool is_line() const;
00248
00250 bool is_parameter() const;
00251
00256 bool is_line_or_parameter() const;
00257
00259 bool is_point() const;
00260
00265 bool is_parameter_or_point() const;
00266
00268
00273 static Grid_Generator line(const Linear_Expression& e);
00274
00276
00283 static Grid_Generator parameter(const Linear_Expression& e
00284 = Linear_Expression::zero(),
00285 Coefficient_traits::const_reference d
00286 = Coefficient_one());
00287
00289
00296 static Grid_Generator point(const Linear_Expression& e
00297 = Linear_Expression::zero(),
00298 Coefficient_traits::const_reference d
00299 = Coefficient_one());
00300
00302 Grid_Generator& operator=(const Grid_Generator& g);
00303
00305 Grid_Generator& operator=(const Generator& g);
00306
00308
00312 Coefficient_traits::const_reference divisor() const;
00313
00318 memory_size_type total_memory_in_bytes() const;
00319
00321 memory_size_type external_memory_in_bytes() const;
00322
00329 bool is_equivalent_to(const Grid_Generator& y) const;
00330
00332 bool is_equal_to(const Grid_Generator& y) const;
00333
00338 bool all_homogeneous_terms_are_zero() const;
00339
00347 void scale_to_divisor(Coefficient_traits::const_reference d);
00348
00350 bool OK() const;
00351
00353 void swap(Grid_Generator& y);
00354
00363 void coefficient_swap(Grid_Generator& y);
00364
00365 PPL_OUTPUT_DECLARATIONS;
00366
00367 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00368
00373 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00374 bool ascii_load(std::istream& s);
00375
00376 private:
00384 explicit Grid_Generator(Generator g);
00385
00387 dimension_type size() const;
00388
00390 void negate(dimension_type start, dimension_type end);
00391
00393
00397 Coefficient& divisor();
00398
00400 void set_is_line();
00401
00403 void set_is_parameter_or_point();
00404
00414 void strong_normalize();
00415
00417 Coefficient& operator[](dimension_type k);
00418
00420 Coefficient_traits::const_reference operator[](dimension_type k) const;
00421
00426 void
00427 throw_invalid_argument(const char* method, const char* reason) const;
00428
00429 friend std::ostream&
00430 IO_Operators::operator<<(std::ostream& s, const Grid_Generator& g);
00431
00432
00433 friend class Grid;
00434
00435 friend class Grid_Generator_System;
00436 friend class Grid_Generator_System::const_iterator;
00437 friend class Congruence_System;
00438 friend class Scalar_Products;
00439 friend class Topology_Adjusted_Scalar_Product_Sign;
00440 };
00441
00442
00443 namespace Parma_Polyhedra_Library {
00444
00450 Grid_Generator grid_line(const Linear_Expression& e);
00451
00458 Grid_Generator
00459 parameter(const Linear_Expression& e = Linear_Expression::zero(),
00460 Coefficient_traits::const_reference d = Coefficient_one());
00461
00468 Grid_Generator
00469 grid_point(const Linear_Expression& e = Linear_Expression::zero(),
00470 Coefficient_traits::const_reference d = Coefficient_one());
00471
00473
00474 bool operator==(const Grid_Generator& x, const Grid_Generator& y);
00475
00477
00478 bool operator!=(const Grid_Generator& x, const Grid_Generator& y);
00479
00480
00481 namespace IO_Operators {
00482
00484
00485 std::ostream& operator<<(std::ostream& s, const Grid_Generator::Type& t);
00486
00487 }
00488
00489 }
00490
00491 #include "Grid_Generator.inlines.hh"
00492
00493 #endif // !defined(PPL_Grid_Generator_defs_hh)